Commit Graph

874 Commits

Author SHA1 Message Date
Eeshan Garg
b741f45408 webhooks/splunk: Migrate docs to Markdown. 2017-06-13 15:33:22 -07:00
Eeshan Garg
df28bb40f2 webhooks/sentry: Migrate docs to Markdown. 2017-06-13 15:33:22 -07:00
Eeshan Garg
84da473da5 webhooks/semaphore: Migrate docs to Markdown. 2017-06-13 15:33:22 -07:00
Eeshan Garg
d5fa02c7da webhooks/pingdom: Migrate docs to Markdown. 2017-06-13 15:33:22 -07:00
Eeshan Garg
0b1296ed83 webhooks/librato: Migrate docs to Markdown. 2017-06-13 15:33:21 -07:00
Eeshan Garg
ac1ddc4dc8 webhooks/jira: Migrate docs to Markdown. 2017-06-13 15:33:21 -07:00
Eeshan Garg
571130e2fe webhooks/homeassistant: Migrate docs to Markdown. 2017-06-13 15:33:21 -07:00
Eeshan Garg
cfa0f5332a webhooks/freshdesk: Migrate docs to Markdown. 2017-06-13 15:30:35 -07:00
Eeshan Garg
902ae31e15 webhooks/deskdotcom: Migrate docs to Markdown. 2017-06-13 15:30:35 -07:00
Eeshan Garg
c3c004743c github/doc.md: Use Integration.stream_name as default stream. 2017-06-13 15:30:35 -07:00
wizsid11
d309cd29f3 webhooks/zapier: Add weather update example.
Add documentation for weather update through Zapier.
Contains tests and fixtures for weather example.

With minor fixes, docs migration to Markdown, and
rebasing by Eeshan Garg.
2017-06-08 09:14:18 -07:00
Rohitt Vashishtha
5a3a41a644 webhooks/travis: Migrate docs to markdown. 2017-06-07 14:06:01 -07:00
Eeshan Garg
ffb3994b4e webhooks/bitbucket: Migrate docs to Markdown. 2017-06-05 11:22:06 -07:00
Eeshan Garg
def4650d84 webhooks/beanstalk: Migrate docs to Markdown. 2017-06-05 11:22:06 -07:00
Eeshan Garg
0cfe089152 webhooks/github: Migrate docs to Markdown. 2017-06-05 11:22:06 -07:00
Eeshan Garg
7cfc592202 webhooks/bitbucket2: Migrate docs to Markdown.
The change to `render_markdown_path` in `app_filters.py` was
required because for bitbucket2, `integrations.name` is
`bitbucket2`, which is substituted for the stream name in our
Markdown macros. It didn't make sense to recommend the name
`bitbucket2` as a default stream name to our users (for them,
it's just bitbucket). However, the URL is still
`api/v1/external/bitbucket2`.
2017-06-05 11:22:05 -07:00
Eeshan Garg
2f28b3d35b webhooks/gogs: Migrate docs to Markdown. 2017-06-05 11:22:05 -07:00
Eeshan Garg
a12fe65166 webhooks/gitlab: Migrate docs to Markdown. 2017-06-05 11:22:04 -07:00
Eeshan Garg
dd15b2d997 github_webhook: Migrate docs to Markdown. 2017-06-05 11:20:49 -07:00
Aditya Bansal
e28cafebaf pep8: Add compliance with rule E261 hellosign/view.py. 2017-06-04 09:18:18 -07:00
Aditya Bansal
90cdebb04a pep8: Add compliance with rule E261 bitbucket2/view.py. 2017-06-04 09:18:11 -07:00
Tomasz Kolek
acd986d959 integrations: Fix custom topic of hellosign integration.
This fixes support for using custom topics in the HelloSign
integration.

With significant fixes and rebasing by Eeshan Garg.
2017-06-02 22:08:12 -07:00
Eeshan Garg
e510c5d15a webhooks/pivotal: Migrate docs to Markdown. 2017-06-01 22:16:12 -07:00
Eeshan Garg
829491fde7 webhooks/papertrail: Migrate docs to Markdown. 2017-06-01 22:16:12 -07:00
Eeshan Garg
5d868b1612 webhooks/helloworld: Migrate docs to Markdown. 2017-06-01 22:16:12 -07:00
Eeshan Garg
6defd7f36e webhooks/pagerduty: Migrate docs to Markdown. 2017-06-01 22:16:12 -07:00
Eeshan Garg
36c5e8d11f webhooks/mention: Migrate docs to Markdown. 2017-06-01 22:16:12 -07:00
Eeshan Garg
ccd079b425 webhooks/solano: Migrate docs to Markdown. 2017-06-01 22:16:12 -07:00
Eeshan Garg
c3dda04270 webhooks/zapier: Migrate docs to Markdown. 2017-06-01 22:16:12 -07:00
Eeshan Garg
6e6c5c8fa6 webhooks/newrelic: Migrate docs to Markdown. 2017-06-01 22:16:12 -07:00
Eeshan Garg
88ed657412 webhooks/updown: Migrate docs to Markdown. 2017-06-01 22:16:12 -07:00
Eeshan Garg
a8e4abfb7c webhooks/teamcity: Migrate docs to Markdown. 2017-06-01 22:16:12 -07:00
Eeshan Garg
28a2166bd0 webhooks/transifex: Migrate docs to Markdown. 2017-06-01 22:16:12 -07:00
Eeshan Garg
624bab83a7 webhooks: Use append-topic.md for gosquared, greenhouse, hellosign. 2017-06-01 22:16:12 -07:00
Eeshan Garg
b309c403e0 webhooks/gitlab: Support Merge Request Hook reopen event.
Fixes #4795.
2017-05-30 22:11:37 -07:00
Eeshan Garg
44ec27c122 webhooks/gosquared: Migrate docs to Markdown. 2017-05-28 18:44:00 -07:00
Eeshan Garg
e5484f1bf5 webhooks/ifttt: Migrate docs to Markdown. 2017-05-28 18:44:00 -07:00
Eeshan Garg
846e560bfd webhooks/hellosign: Migrate docs to Markdown. 2017-05-28 18:44:00 -07:00
Eeshan Garg
372d6a2aa6 webhooks/heroku: Migrate docs to Markdown. 2017-05-28 18:44:00 -07:00
Eeshan Garg
2d25b6581e webhooks/greenhouse: Migrate docs to Markdown. 2017-05-28 18:44:00 -07:00
Eeshan Garg
dd5ce955bd webhooks/delighted: Migrate docs to Markdown. 2017-05-28 18:44:00 -07:00
Eeshan Garg
074e3d7401 webhooks/crashlytics: Migrate docs to Markdown. 2017-05-28 18:44:00 -07:00
Eeshan Garg
14ce3a94db webhooks/codeship: Migrate docs to Markdown. 2017-05-28 18:44:00 -07:00
Eeshan Garg
6111b56753 webhooks/circleci: Migrate docs to Markdown. 2017-05-28 18:44:00 -07:00
Eeshan Garg
1c50a85601 webhooks/basecamp: Migrate docs to Markdown. 2017-05-28 18:44:00 -07:00
Yago González
55b4a3792d lint: Fix violation in the GitHub webhook view. 2017-05-24 22:09:14 -07:00
umkay
f4617d0408 mypy: Fix a few webhook tests to work with strict-optional. 2017-05-24 20:31:21 -07:00
umkay
c1a8fb615c mypy: Fix strict-optional errors in webhooks directory. 2017-05-24 18:57:06 -07:00
Eeshan Garg
b5d271456a webhooks/trello: Use parametric Markdown macros. 2017-05-24 17:00:19 -07:00
Eeshan Garg
e9b3b56105 webhooks/appfollow: Use parametric Markdown macros. 2017-05-24 17:00:19 -07:00
Eeshan Garg
c433a7981a webhooks/airbrake: Use parametric Markdown macros for documentation. 2017-05-24 17:00:19 -07:00
umkay
ccc70445d6 mypy: Fix strict-optional errors for test files.
Fix mypy --strict-optional errors in zerver/tests
2017-05-24 12:43:28 -07:00
Eeshan Garg
ed8c6943f2 webhooks/airbrake: Use Markdown macros for documentation. 2017-05-22 18:19:14 -07:00
Eeshan Garg
4f358f4034 webhooks/gitlab: Support pushing a local branch without commits.
This mostly just adds a test for GitLab related to the last commit.
2017-05-16 19:33:43 -07:00
Eeshan Garg
5687b2cdc5 webhooks/github*: Support pushing a local branch without commits.
Changes made to get_push_commits_event_message in
zerver/lib/webhooks/git.py are common to all Git integrations
that use get_push_commits_event_message. These include github,
github_webhook, gitlab, gogs, bitbucket, bitbucket2. In some
cases (for instance, gitlab), no further changes to gitlab/view.py
will be required to support pushing a local branch without commits;
adding a fixture and tests should suffice.
2017-05-16 23:51:19 -02:30
Eeshan Garg
21e0db03e1 webhooks/appfollow: Migrate docs to Markdown. 2017-05-15 20:14:23 -07:00
Eeshan Garg
0b5711aa7e webhooks/airbrake: Migrate docs to Markdown. 2017-05-15 20:14:23 -07:00
Eeshan Garg
7227f488c8 webhooks: Add support for a GitHub push event deleting a branch.
Fixes: #4742.
2017-05-16 00:11:20 -02:30
Tim Abbott
f36000d670 docs: Fix last reference to old fixtures directory structure. 2017-05-13 21:39:12 -07:00
Eeshan Garg
597db11a98 webhooks: Rename webhook fixtures to only include event type.
All webhook fixtures have now been renamed from
<webhook_name>/fixtures/<webhook_name>_<event_type>.json to
<webhook_name>/fixtures/<event_type>.json.
2017-05-13 20:07:40 -02:30
Aditya Bansal
3a097a2a6c pep8: Add compliance with rule E261 to semaphore/view.py. 2017-05-07 23:21:50 -07:00
Aditya Bansal
bf24e0c9db pep8: Add compliance with rule E261 to stripe/view.py. 2017-05-07 23:21:50 -07:00
Aditya Bansal
3791638985 pep8: Add compliance with rule E261 to semaphore/tests.py. 2017-05-07 23:21:50 -07:00
Aditya Bansal
21dd1384b4 pep8: Add compliance with rule E261 to pivotal/view.py. 2017-05-07 23:21:50 -07:00
Aditya Bansal
43c978e0f4 pep8: Add compliance with rule E261 to pagerduty/view.py. 2017-05-07 23:21:50 -07:00
Aditya Bansal
54989605e0 pep8: Add compliance with rule E261 to github/tests.py. 2017-05-07 23:21:50 -07:00
Aditya Bansal
f3c1557529 pep8: Add compliance with rule E261 to beanstalk/view.py. 2017-05-07 23:21:50 -07:00
Aditya Bansal
6bc653959f Remove empty comment statement from taiga/view.py. 2017-05-07 23:21:50 -07:00
Eeshan Garg
e87e246fcb zerver/decorator: Set request.client in api_key_only_webhook_view.
Previously, api_key_only_webhook_view passed 3 positional arguments
(request, user_profile, and client) into a function. However, most
of our other auth decorators only pass 2 positional arguments. For
the sake of consistency, we now make api_key_only_webhook_view set
request.client and pass only request and user_profile as positional
arguments.
2017-05-01 23:44:07 -07:00
Eeshan Garg
8ef18463d6 github_webhook: Use author's full name if username is not available.
In cases where the webhook payload doesn't have the username for the
author of a particular commit (this can happen if the author doesn't
have a GitHub account or the author's email is not associated with
their GitHub account), we now use the author's full name to format
messages.
2017-04-29 14:57:57 -07:00
Eeshan Garg
aa12002be7 webhooks: Move all fixtures to zerver/webhooks/<webhook_name>/fixtures.
All webhook fixtures in zerver/fixtures/<webhook_name> have now
been moved to dedicated webhook-specific directories under
zerver/webhooks/<webhook_name>/fixtures, where <webhook_name> is
the name of the webhook.
2017-04-28 11:07:03 -07:00
Eeshan Garg
ffdd5d3588 webhooks: Don't display "Commits by" when committer is the only author.
For our Git integrations, we now only display the number of commits
pushed when the pusher also happens to be the only author of the
commits being pushed.

Part of #3968.
Follow-up to #4006.
2017-04-26 18:26:09 -02:30
Eeshan Garg
b7ca533315 webhooks: Add a space between author and number of commits for Git messages.
For Git push messages, we now have a single space character between
the name of a commit's author and the number of commits by that
author, plus a period at the end.

Part of #3968.
Follow-up to #4006.
2017-04-26 18:26:09 -02:30
Eeshan Garg
af69faafc9 webhooks: Use author's name to format Git push messages.
We now use the name of the author of a commit as opposed to the
committer to format Git messages with multiple committers.

Part of #3968.
Follow-up to #4006.
2017-04-26 18:26:09 -02:30
Eeshan Garg
46b6475066 webhooks/gitlab: Use branches.find to filter Git notifications. 2017-04-25 10:46:21 -07:00
Eeshan Garg
8900e99ae5 github_webhook: Use branches.find to filter Git notifications. 2017-04-25 10:46:21 -07:00
Cynthia Lin
ef2ff9f9a0 integrations: Remove deprecated Stash integration. 2017-04-24 22:35:23 -07:00
Eeshan Garg
ce0f1453b9 webhooks: Filter specific BitBucket Git branches.
This is the last of the Git integrations that didn't have this
feature.

Fixes #4327.
2017-04-22 11:29:53 -07:00
Eeshan Garg
55e1154871 webhooks/beanstalk: Filter specific Git branches. 2017-04-21 22:06:11 -02:30
Eeshan Garg
dded73ec6f webhooks: Stop overriding build_webhook_url for URL query parameters. 2017-04-21 22:06:11 -02:30
Eeshan Garg
e68b957f3d webhooks/gogs: Filter specific Gogs branches. 2017-04-21 22:06:11 -02:30
Tim Abbott
e7974b3b65 git: Fix nondeterministic ordering of commit authors.
This should fix the nondeterministic test failures introduced by
e7455e276b.
2017-04-21 11:45:30 -07:00
Siddharth Mahapatra
e7455e276b git integrations: Expand details in commit push notifications.
We now show a few new things:
(1) The number of commits pushed.
(2) Who authored the commits (just counts, not which specific ones, for brevity).

Add tests for case of multiple committers.

Part of #3968.
2017-04-21 11:07:44 -07:00
hackerkid
55c3d12078 Replace timezone.utc with timezone_utc. 2017-04-16 12:28:56 -07:00
Tomasz Kolek
2a55eff44b integrations: Add test event handler to Solano. 2017-04-11 16:59:06 -07:00
Umair Khan
5a3f83bba8 integrations: Move Trello webhook docs to markdown. 2017-04-07 15:52:15 -07:00
Tomasz Kolek
4867e68461 integrations: Add setup webhook message for Crashlytics.
This makes it easier to debug the setup process.
2017-04-06 11:27:48 -07:00
Eeshan Garg
da599ad28c webhooks/gitlab: Add support for filtering GitLab branches. 2017-04-04 13:51:08 -07:00
Eeshan Garg
8933b5b31d github_webhook: Filter specific GitHub branches.
Fixes: #4000
2017-03-26 13:32:24 -07:00
Tim Abbott
22d284950d trello: Clean up the documentation. 2017-03-25 17:04:52 -07:00
wizsid11
95789eb879 Add Slack webhook.
Adds a new webhook integration for Slack to receive messages
from one's Slack team's public channels.
Contains negative tests for broken, missing or invalid data.

Allows two different option for integration:
1. Receive notification on a single stream with different topics
for each of Slack's public channels.
2. Receive notification on different streams for each of Slack's
public channels.

Steps to choose between the two options is described in the documentation.

Fixes #3569.
2017-03-23 23:32:38 -07:00
Tomasz Kolek
be0a2cb20b Add basecamp3 webhook integration.
Fixes: #3949.
2017-03-23 23:28:53 -07:00
Tomasz Kolek
09f5180da9 github_webhook: Return 200 OK if event is not supported.
Change raising exception when event is not supported to just logging it.
2017-03-23 23:26:55 -07:00
Tomasz Kolek
fcd091132d jira: Return 200 OK if event is not supported. 2017-03-23 23:26:55 -07:00
Akash Kothawale
9e45f32275 gogs: Add webhook integration.
- Add push, create and pull request event.
- Handle 'opened', 'closed' and 'merged' in 'pull request' event.
- Include tests for all the above events including 'push' with commits
  more than limits.
2017-03-17 12:22:06 -07:00
Akash Kothawale
edfb9c21bc github_webhook: Send test message sent by GitHub webhook integration.
Fixes #3994.
2017-03-17 11:47:04 -07:00
wizsid11
19d1f4cab7 git integration: Change push commits message to show url at the end. 2017-03-16 11:06:03 -07:00
Tim Abbott
1c5e9ae7f6 mypy: Fix unicode error in Jira webhook. 2017-03-15 22:01:04 -07:00
Tomasz Kolek
51b839ac11 jira integration: Add support for unicode chars.
Fixes: #3967
2017-03-15 16:26:57 -07:00
wizsid11
f066e3e8d6 git integrations: Change the limit of shown commits from 10 to 20. 2017-03-14 13:24:45 -07:00
Tim Abbott
ae12f3dfd0 github: Fix URL in GitHub webhook documentation. 2017-03-08 23:25:30 -08:00
Tomasz Kolek
114c80efae Add ignore pull requests mechanism in Travis integration.
Add ignore_pull_requests param to url, with a default of true.

Fixes: #3912.
2017-03-08 21:51:04 -08:00
Tomasz Kolek
15485ec972 Refactor travis integration. 2017-03-08 21:49:32 -08:00
Feorlen
e0acdfde0d Add a Splunk webhook integration.
Add a webhook to create messages from Splunk search alerts. The search
alert JSON includes the first search result and a link to view the full
results. The following fields are used:

* search_name - the name of the saved search
* results_link - URL of the full search results
* host - the host the search result came from
* source - the source file on that host
* _raw - the raw text of the logged event.

The Zulip message contains:
* search name
* host
* source
* raw

The destination stream and message topic are configurable: the default
stream is "splunk" and the default topic "Splunk Alert". If the topic is
not provided in the URL, the search name is used instead (truncated if too
long. If a needed field is missing, a default value is used instead.

Example: "Missing source"

It is possible to configure a Splunk search to not include some values,
so I've provided defaults rather than return an error for missing data.
In practice, these fields are unlikely to be deliberately suppressed.

Note: alerts are only available for Splunk servers using a valid trial,
developer, or paid license.

I've added tests for the normal case of one search result, the topic from
the search name, and for a search missing one of the fields used. Tested
using Splunk Enterprise 6.5.1.

Fixes #3477
2017-03-07 21:48:26 -08:00
sinwar
6f0564e9f4 python: Fix remaining bare excepts in codebase.
Fixes #2862.
2017-03-05 16:17:04 -08:00
Raghav Jajodia
a3a03bd6a5 mypy: Added Dict, List and Set imports.
Fixed mypy errors associated with the upgrade.
2017-03-04 14:33:44 -08:00
Rishi Gupta
a1813e004e Remove local datetimes from webhook messages.
"Local" datetimes are local to the server (or rather, are using
settings.TIME_ZONE), which in most cases is not what the recipient of the
message is expecting.
2017-03-03 19:00:02 -08:00
Feorlen
6494b84193 Update WordPress webhook to say self-installed blogs are experimental.
Reword the doc to be clear that WordPress.com blogs are supported and
self-installed blogs are experimental. Change the screen captures to show
WordPress.com.

For more details, see:
original issue https://github.com/zulip/zulip/issues/3245
original PR https://github.com/zulip/zulip/pull/2691
2017-03-03 17:15:32 -08:00
Rishi Gupta
2bbfdeeb7b Fix more errors caught by mypy 0.501.
Another set of relatively easy to review changes.
2017-03-03 14:15:38 -08:00
Tomasz Kolek
e1d73ea36f github: Add list and fixtures for ignored events to webhook. 2017-02-26 19:17:53 -08:00
Tomasz Kolek
349835e619 Add PR edited, assigned and unassigned to github webhook integration. 2017-02-26 19:16:12 -08:00
Tim Abbott
0383ff1dfd lint: Fix homeassistant PEP8 violations. 2017-02-18 21:51:14 -08:00
ausDensk
14024963f2 Add a simple Home Assistant integration for Zulip. 2017-02-18 21:18:10 -08:00
Tim Abbott
4060a97656 messages: Strip trailing whitespace in message contents.
I dug into why we never did this before, and it turns out we did, but
using `$.trim()` (which removes leading whitespace as well!).  When
removing the `$.trim()` usage.

Fixes #3294.
2017-02-11 23:01:22 -08:00
Jackson
dcca54e8a9 integrations: Add Greenhouse integration. 2017-02-07 19:08:35 -08:00
Feorlen
676f0ad63f Add WordPress webhook.
Adds a new webhook integration for WordPress blogs. Both WordPress.com
and self-installed blogs are supported, with minor differences that
are described in the documentation. It creates a new message for each
action, the stream and topic may be specified or use default values.

WordPress actions supported:

publish_post:  a new blog post was published
publish_page:  a new page was published
user_register: a new user account was created
wp_login:      a user logged in

Notes: comment_post only provides the id of the parent post, not title
or link, so was not included. On further testing, I found edit_post is
not very practical, it also fires while a new post is being written, and
when posts are deleted. (I think it tracks drafts too.) I've removed it,
as it seems more confusing than useful.

Fixes #3245
2017-02-07 18:14:31 -08:00
Tim Abbott
28a123f00e webhooks: Fix spelling of GitHub webhook client name.
This will make the Zulip analytics on /stats be consistent with the
old integration.
2017-02-05 16:26:12 -08:00
Tomasz Kolek
7bcba19e99 Add handling synchronize PR event to github webhook integration. 2017-02-02 12:33:08 -08:00
Tomasz Kolek
3f1b21fe61 Add ping event handling to github webhook integration. 2017-02-01 00:38:16 +01:00
Tomasz Kolek
39bd685dd5 Update How to create jira webhook url in Jira doc. 2017-01-31 15:17:12 -08:00
Tomasz Kolek
11a1f1d72b Add support for old Jira API's version to Jira integration. 2017-01-31 15:17:12 -08:00
Tomasz Kolek
d598fae52e docs: Add missing configuration step to github webhook doc. 2017-01-30 13:02:48 -08:00
Tomasz Kolek
6e6cbeb89d Split webhooks doc and move to particular directories. 2017-01-26 11:56:45 -08:00
Tomasz Kolek
7de45951e2 Make webhooks as separate modules with view and tests.
Create python packege for every webhook with view.py and tests.py
2017-01-25 23:14:19 -08:00