webhooks: Move github/ to github_legacy/ and remove docs.

This commit is contained in:
Eeshan Garg
2018-04-18 16:50:25 -02:30
committed by Tim Abbott
parent 2cc3fb7564
commit 48b8558c02
38 changed files with 6 additions and 61 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 41 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 43 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 24 KiB

View File

@@ -105,7 +105,7 @@ not_yet_fully_covered = {
'zerver/webhooks/beanstalk/view.py',
'zerver/webhooks/bitbucket2/view.py',
'zerver/webhooks/freshdesk/view.py',
'zerver/webhooks/github/view.py',
'zerver/webhooks/github_legacy/view.py',
'zerver/webhooks/github_webhook/view.py',
'zerver/webhooks/gitlab/view.py',
'zerver/webhooks/gogs/view.py',

View File

@@ -297,15 +297,6 @@ WEBHOOK_INTEGRATIONS = [
WebhookIntegration('flock', ['customer-support'], display_name='Flock'),
WebhookIntegration('freshdesk', ['customer-support']),
WebhookIntegration('front', ['customer-support'], display_name='Front'),
GithubIntegration(
'github',
['version-control'],
function='zerver.webhooks.github.view.api_github_landing',
display_name='GitHub',
secondary_line_text='(deprecated)',
stream_name='commits',
legacy=True
),
GithubIntegration(
'github_webhook',
['version-control'],

View File

@@ -13,7 +13,7 @@ from zerver.lib.response import json_success
from zerver.lib.webhooks.common import check_send_webhook_message
from zerver.lib.validator import check_dict
from zerver.models import UserProfile, get_client
from zerver.webhooks.github.view import build_message_from_gitlog
from zerver.webhooks.github_legacy.view import build_message_from_gitlog
# Beanstalk's web hook UI rejects url with a @ in the username section of a url
# So we ask the user to replace them with %40

View File

@@ -1,44 +0,0 @@
This webhook is based on the deprecated
[GitHub Services](https://github.com/github/github-services).
{!create-stream.md!}
The integration will use the default stream `commits`
if no stream is supplied in the hook; you still need to create
the stream even if you are using this default.
Next, go to your repository page and click **Settings**:
![](/static/images/integrations/github/001.png)
From there, select **Webhooks & Services**:
![](/static/images/integrations/github/002.png)
To find the Zulip hook, you have to click on **Configure services**.
![](/static/images/integrations/github/003.png)
Select **Zulip** from the list of service hooks. Fill in the API key
and email address for your bot that you created earlier and check
the **"active"** checkbox. Specify
`{{ api_url }}/v1/external/github` as the
**Alternative endpoint**. You can optionally supply the Zulip stream
(the default is `commits`) and restrict Zulip notifications to a
specified set of branches.
Further configuration is possible. By default, commits traffic
(pushes, commit comments), GitHub issues traffic, and pull requests
are enabled. You can exclude certain types of traffic via the checkboxes.
If you want commit traffic, issue traffic, and pull requests to go to
different places, you can use the **Commit Stream** and **Issue Stream**
overrides; otherwise, it is safe to leave these fields blank and just
have it default to the **Stream** setting.
Click the **Update settings** button to complete the configuration:
![](/static/images/integrations/github/004.png)
{!congrats.md!}
![](/static/images/integrations/github/005.png)

View File

@@ -1,7 +1,7 @@
from django.http import HttpRequest, HttpResponse
from django.views.decorators.csrf import csrf_exempt
from .github.view import api_github_landing
from .github_legacy.view import api_github_landing
from .github_webhook.view import api_github_webhook
# Since this dispatcher is an API-style endpoint, it needs to be

View File

@@ -9,7 +9,7 @@ from zerver.models import Message
class GithubV1HookTests(WebhookTestCase):
STREAM_NAME = None # type: Optional[Text]
URL_TEMPLATE = u"/api/v1/external/github"
FIXTURE_DIR_NAME = 'github'
FIXTURE_DIR_NAME = 'github_legacy'
SEND_STREAM = False
BRANCHES = None # type: Optional[Text]
@@ -134,7 +134,7 @@ class GithubV1HookTests(WebhookTestCase):
class GithubV2HookTests(WebhookTestCase):
STREAM_NAME = None # type: Optional[Text]
URL_TEMPLATE = u"/api/v1/external/github"
FIXTURE_DIR_NAME = 'github'
FIXTURE_DIR_NAME = 'github_legacy'
SEND_STREAM = False
BRANCHES = None # type: Optional[Text]

View File

@@ -1,6 +1,4 @@
For the integration based on the deprecated
[GitHub Services](https://github.com/github/github-services),
see [here](./github).
Get GitHub notifications in Zulip!
1. {!create-stream.md!}