mirror of
https://github.com/zulip/zulip.git
synced 2025-11-06 15:03:34 +00:00
webhooks: Move github/ to github_legacy/ and remove docs.
This commit is contained in:
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 |
@@ -105,7 +105,7 @@ not_yet_fully_covered = {
|
|||||||
'zerver/webhooks/beanstalk/view.py',
|
'zerver/webhooks/beanstalk/view.py',
|
||||||
'zerver/webhooks/bitbucket2/view.py',
|
'zerver/webhooks/bitbucket2/view.py',
|
||||||
'zerver/webhooks/freshdesk/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/github_webhook/view.py',
|
||||||
'zerver/webhooks/gitlab/view.py',
|
'zerver/webhooks/gitlab/view.py',
|
||||||
'zerver/webhooks/gogs/view.py',
|
'zerver/webhooks/gogs/view.py',
|
||||||
|
|||||||
@@ -297,15 +297,6 @@ WEBHOOK_INTEGRATIONS = [
|
|||||||
WebhookIntegration('flock', ['customer-support'], display_name='Flock'),
|
WebhookIntegration('flock', ['customer-support'], display_name='Flock'),
|
||||||
WebhookIntegration('freshdesk', ['customer-support']),
|
WebhookIntegration('freshdesk', ['customer-support']),
|
||||||
WebhookIntegration('front', ['customer-support'], display_name='Front'),
|
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(
|
GithubIntegration(
|
||||||
'github_webhook',
|
'github_webhook',
|
||||||
['version-control'],
|
['version-control'],
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ from zerver.lib.response import json_success
|
|||||||
from zerver.lib.webhooks.common import check_send_webhook_message
|
from zerver.lib.webhooks.common import check_send_webhook_message
|
||||||
from zerver.lib.validator import check_dict
|
from zerver.lib.validator import check_dict
|
||||||
from zerver.models import UserProfile, get_client
|
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
|
# 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
|
# So we ask the user to replace them with %40
|
||||||
|
|||||||
@@ -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**:
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
From there, select **Webhooks & Services**:
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
To find the Zulip hook, you have to click on **Configure services**.
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
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:
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
{!congrats.md!}
|
|
||||||
|
|
||||||

|
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
from django.http import HttpRequest, HttpResponse
|
from django.http import HttpRequest, HttpResponse
|
||||||
from django.views.decorators.csrf import csrf_exempt
|
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
|
from .github_webhook.view import api_github_webhook
|
||||||
|
|
||||||
# Since this dispatcher is an API-style endpoint, it needs to be
|
# Since this dispatcher is an API-style endpoint, it needs to be
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ from zerver.models import Message
|
|||||||
class GithubV1HookTests(WebhookTestCase):
|
class GithubV1HookTests(WebhookTestCase):
|
||||||
STREAM_NAME = None # type: Optional[Text]
|
STREAM_NAME = None # type: Optional[Text]
|
||||||
URL_TEMPLATE = u"/api/v1/external/github"
|
URL_TEMPLATE = u"/api/v1/external/github"
|
||||||
FIXTURE_DIR_NAME = 'github'
|
FIXTURE_DIR_NAME = 'github_legacy'
|
||||||
SEND_STREAM = False
|
SEND_STREAM = False
|
||||||
BRANCHES = None # type: Optional[Text]
|
BRANCHES = None # type: Optional[Text]
|
||||||
|
|
||||||
@@ -134,7 +134,7 @@ class GithubV1HookTests(WebhookTestCase):
|
|||||||
class GithubV2HookTests(WebhookTestCase):
|
class GithubV2HookTests(WebhookTestCase):
|
||||||
STREAM_NAME = None # type: Optional[Text]
|
STREAM_NAME = None # type: Optional[Text]
|
||||||
URL_TEMPLATE = u"/api/v1/external/github"
|
URL_TEMPLATE = u"/api/v1/external/github"
|
||||||
FIXTURE_DIR_NAME = 'github'
|
FIXTURE_DIR_NAME = 'github_legacy'
|
||||||
SEND_STREAM = False
|
SEND_STREAM = False
|
||||||
BRANCHES = None # type: Optional[Text]
|
BRANCHES = None # type: Optional[Text]
|
||||||
|
|
||||||
@@ -1,6 +1,4 @@
|
|||||||
For the integration based on the deprecated
|
Get GitHub notifications in Zulip!
|
||||||
[GitHub Services](https://github.com/github/github-services),
|
|
||||||
see [here](./github).
|
|
||||||
|
|
||||||
1. {!create-stream.md!}
|
1. {!create-stream.md!}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user