Commit Graph

1160 Commits

Author SHA1 Message Date
Eeshan Garg 8fbd8c68f4 webhooks: Update macros to specify custom topics and default PMs.
These changes are the result of migrating to
check_send_webhook_message.
2018-03-18 10:53:45 -07:00
Eeshan Garg 857569cbf7 webhooks/teamcity: Use check_send_webhook_message.
For a personal build, the teamcity webhook still sends a private
message using check_send_private_message since a personal build
should never trigger a public notification.

For a non-personal build, check_send_webhook_message is used,
which can either send a PM or a stream message based on whether
a stream is specified in the webhook URL or not.
2018-03-18 10:44:09 -07:00
Eeshan Garg 3dafbfa5f4 webhooks/beeminder: Use check_send_webhook_message and update docs.
We now only give users two options, to specify a stream and receive
public notifications for their goals, or to leave it out and receive
PMs and thus, keep their goals private. This simplifies the docs!
2018-03-18 10:44:09 -07:00
Tim Abbott 34e165c100 webhooks: Fix passing client string to authenticated webhook API views.
This fixes a regression in 93678e89cd
and a4979410f9, where the webhooks using
authenticated_rest_api_view were migrated to a new model that didn't
include setting a custom Client string for the webhook.

When restoring these webhooks' client strings, we also fix places
where the client string was not capitalized the same was as the
product's name.
2018-03-16 15:43:19 -07:00
Eeshan Garg a4979410f9 webhooks: Migrate most integrations to use check_send_webhook_message.
This commit migrates all of our webhooks to use
check_send_webhook_message, except the following:

beeminder: Rishi wanted to wait on this one.
teamcity: This one is slightly more work.

yo: This one is PM-only. I am still trying to decide whether we
    should have a force_private argument or something in
    check_send_webhook_message.

facebook: No point in migrating this, will be removed as part of
          #8433.

slack: Slightly more work too with the `channel_to_topics` feature.
       Warrants a longer discussion.
2018-03-16 19:23:50 -02:30
Eeshan Garg a1e3c91213 webhooks: Delete duplicate statuspage.io fixtures from GCI.
These fixtures were submitted by a GCI student but then another
student wrote the webhook from scratch anyway.
2018-03-16 19:12:09 -02:30
Eeshan Garg 93678e89cd webhooks: Migrate 14 webhooks to use check_send_webhook_message.
These are the straightforward ones.

Note that there is a line in zerver.lib.test_classes.build_webhook_url
that lost test coverage. That's because most of our tests test using
stream messages so the webhook URLs being tested always have a query
parameter. So the line that accounts for there being no query
parameters never gets called, which is fine, but we should still
keep it.
2018-03-16 11:34:20 -07:00
Eeshan Garg af56df7723 webhooks: Enable custom topics and default PM notifications.
This commit adds a generic function called check_send_webhook_message
that does the following:
* If a stream is specified in the webhook URL, it sends a stream
  message, otherwise sends a PM to the owner of the bot.
* In the case of a stream message, if a custom topic is specified
  in the webhook URL, it uses that topic as the subject of the
  stream message.

Also, note that we need not test this anywhere except for the
helloworld webhook. Since helloworld is our default example for
webhooks, it is here to stay and it made sense that tests for a
generic function such as check_send_webhook_message be tested
with an actual generic webhook!

Fixes #8607.
2018-03-16 11:34:20 -07:00
neiljp (Neil Pilgrim) e30ba19b79 mypy: Apply type: ignore to api_github_webhook_dispatch calls. 2018-03-15 14:33:56 -07:00
neiljp (Neil Pilgrim) 31dce7c87c minor: Request parameter should be of type HttpRequest. 2018-03-15 14:33:53 -07:00
neiljp (Neil Pilgrim) 17937175ac mypy: Centralize ViewFuncT definition into new file zerver/lib/types.py.
Originally was going to centralize this in zerver/lib/request.pyi, but this
file is not visible at run-time, being only a stub. The matching request.py
file seemed inappropriate, as it doesn't actually use ViewFuncT.
2018-03-15 14:16:40 -07:00
Eeshan Garg 5c1858e584 webhooks/taiga: Update text to conform to the new style guide.
Note that the "Save" button has no text in the Taiga webhook
setup UI. There is a small floppy disk symbol for saving which
is visible right beside the form fields. So I simply said,
"Save the form".
2018-03-14 18:13:13 -07:00
Eeshan Garg f89b3fdb1c webhooks/heroku: Update text to conform to new style guide. 2018-03-14 18:13:13 -07:00
Eeshan Garg cad422f4b6 webhooks/travis: Update text to conform to doc style guide.
Note that this file runs into the CSS bug addressed in #8433.
2018-03-13 20:15:04 -07:00
Eeshan Garg 71619f7d32 webhooks/insping: Update text to conform to style guide. 2018-03-13 20:12:26 -07:00
Eeshan Garg 5fdb0666dc webhooks/zapier: Update text to conform to doc style guide. 2018-03-13 20:12:26 -07:00
Eeshan Garg 0a3961502f webhooks/ifttt: Update text to conform to doc style guide. 2018-03-13 20:12:26 -07:00
neiljp (Neil Pilgrim) 9e1dbde82d mypy: Final small migrations to python3.5 annotations in many files. 2018-03-12 11:23:30 -07:00
Ricky 9e52a9f879 webhooks/flock: Add flock integration. 2018-03-11 20:31:13 -07:00
Ricky 7c830c5767 webhooks/beeminder: Mock time.time() to avoid race.
Rewritten in significant part by tabbott to actually be correct.

One particularly nasty thing the original webhook integration did is
do `current_time = time.time()` at the top of the `view.py` function
-- that means that code ran at import time, not runtime.
2018-03-09 11:12:40 -08:00
Eeshan Garg fa8525c862 webhooks/hellosign: Update text to conform to doc style guide. 2018-03-08 08:19:32 -08:00
Eeshan Garg f3590dc2f5 webhooks/gosquared: Update text to conform to doc style guide.
Note that the 5th step cannot be reached unless a webhook has been
configured first, which is why it is the last step.
2018-03-08 08:19:32 -08:00
Eeshan Garg 12396dd39b webhooks/gogs: Update text to conform to doc style guide. 2018-03-08 08:19:32 -08:00
Eeshan Garg 88a198041a webhooks/gitlab: Update text to conform to doc style guide. 2018-03-08 08:19:32 -08:00
Eeshan Garg f7a21b18dc webhooks/github_webhook: Update text to conform to doc style guide. 2018-03-08 08:19:32 -08:00
Eeshan Garg b6fc33e1da webhooks/gci: Update text to conform to doc style guide. 2018-03-08 08:19:32 -08:00
Eeshan Garg fa1583bf45 webhooks/dropbox: Update text to conform to doc style guide. 2018-03-08 08:19:32 -08:00
Eeshan Garg 4f039e4536 webhooks/delighted: Update text to conform to doc style guide. 2018-03-08 08:19:32 -08:00
Eeshan Garg 18c6cd9dd2 webhooks/codeship: Update text to conform to doc style guide. 2018-03-08 08:19:32 -08:00
Eeshan Garg 1c44a9c4c0 webhooks/bitbucket2: Update text to conform to doc style guide. 2018-03-08 08:19:32 -08:00
Eeshan Garg f551f3a9b8 webhooks/beanstalk: Update text to conform to doc style guide. 2018-03-08 08:19:32 -08:00
Eeshan Garg 9de90645f3 webhooks/basecamp: Update text to conform to doc style guide. 2018-03-08 08:19:32 -08:00
Eeshan Garg 7ee7d4a4d1 webhooks/appfollow: Update text to conform to doc style guide. 2018-03-08 08:19:32 -08:00
Tim Abbott 553634536c beeminder: Mostly eliminate nondeterministic failures in test suite.
There's probably follow-up work to do here to eliminate these
completely, but this dramatically shrinks the ~1 minute race window
that was previously present between import and test function being
called.
2018-03-06 13:44:06 -08:00
Eeshan Garg 12c4a8293d webhooks/crashlytics: Update the text.
This commit:

* Restructures the doc to use a numbered-step format.

Note that there are no screenshots. I signed up for a
Fabric/Crashlyics account but you have to link an Android/iOS app
to even get to the settings panel, which seemed like too much work
just to get a screenshot.

However, the way we can verify (somewhat) the correctness of the
last step is that it is a paraphrase of the first paragraph of
Fabric's Webhook docs, which can be found here:

https://docs.fabric.io/apple/crashlytics/custom-web-hooks.html
2018-03-06 12:52:22 -08:00
Eeshan Garg 53ccbdcfd6 webhooks/dropbox: Update text and remove screenshots.
This commit modifies the text to:

1. Removes unnecessary screenshots.

2. Use the numbered-style format.

3. I also removed the instructions for generating an access token.
   I took a look at Dropbox's docs and you shouldn't need that
   for a webhook setup. The whole point behind a webhook is that
   one can get by without using OAuth.

4. Rearranges the instructions to only contain 4 steps. For
   uncomplicated instructions, that seems to be the ideal number.
2018-03-06 12:52:22 -08:00
Alena Volkova 91983834e6 integrations: Add documentation for Front. 2018-02-28 16:18:19 -05:00
Alena Volkova 822dfc6a34 integrations: Add webhook code, API endpoint, and tests for Front. 2018-02-28 16:18:19 -05:00
Alena Volkova c45acad24b integrations: Add webhook payloads for Front. 2018-02-28 16:18:19 -05:00
Rishi Gupta 76898dd4d3 integrations: Make minor wording changes to integrations docs. 2018-02-27 08:23:51 -08:00
Eeshan Garg 1516e51126 webhooks/gitlab: Support both "Build Hook" and "Job Hook" events.
GitLab recently changed their event name for build notifications
from "Build Hook" to "Job Hook". Instead of just supporting the
latter, we should support both just in case people are running
older versions of GitLab.
2018-02-25 09:35:07 -08:00
Eeshan Garg fbbdc0110a webhooks/gitlab: Replace "Build Hook" with "Job Hook".
At some point, GitLab decided to change the name of the event for
CI notifications from "Build Hook" to "Job Hook" and we started
running into errors in webhook-logger.log.
2018-02-24 06:22:19 -05:00
Eeshan Garg 096c0b68f3 webhooks/basecamp: Update text and remove screenshots.
This commit:

* Removes the unnecessary screenshot. The UI is intuitive enough
  and standalone instructions should suffice.
* Rearranges the instructions into 4 steps.
* Makes the wording more explicit.
2018-02-24 06:21:02 -05:00
Eeshan Garg 3b7598014f webhooks/appfollow: Update text and remove screenshot.
This commit:

* Removes the unnecessary screenshot. The user should be able to
  easily see the fields in question in this case.
* Wraps the text at 80 chars.
* Combines the instructions into 4 steps.
2018-02-24 06:21:02 -05:00
Eeshan Garg ed345427e5 webhooks/airbrake: Combine instructions into 4 steps.
The docs for this can easily be combined into 4 steps. For
uncomplicated setups, 4 seems to be like a good number.

Again, I have no way of verifying the correctness of the instructions
here because Airbrake doesn't let you do anything till you specify
your credit card information, which I didn't want to.
2018-02-24 06:21:02 -05:00
Eeshan Garg 4d410a5eb7 webhooks/gci: Update text.
This commit modifies the text to:

* Use number 1 for all steps and let Markdown take care of the rest.
* Removes the line that says this webhook is "experimental". It isn't
  anymore.
2018-02-24 06:21:02 -05:00
Eeshan Garg 9667594a34 webhook/delighted: Update text and remove screenshot.
This commit modifies the doc.md to:
* Use consistent language and style.
* Use the number 1 for all numbered steps and let Markdown take
  care of the rest.
* Have detailed steps on how to get to the Integrations settings
  instead of just linking to the page.
* Remove unnecessary screenshots.
2018-02-24 06:21:02 -05:00
Eeshan Garg e139d29fca webhooks/codeship: Update text and remove screenshots.
This commit:

* Adds a missing step to the documentation.
* Replaces wording such as "Go to X" with "Click on X".
* Removes the unnecessary screenshots.
* Rearranges the doc to contain only 4 steps. For uncomplicated
  setups, 4 seems to be the right number.
2018-02-24 06:21:02 -05:00
Eeshan Garg 0d39b05cf6 webhooks/beanstalk: Update text and remove screenshots.
This commit:

* Removes the unnecessary screenshot.
* Reorders the instructions and combines them in to 4 steps.
* Improves the contents of the webhook-url-with-bot-email-indented.md
  macro and makes it more consistent with create-bot-construct-url.md.
* Sets the recommended stream name to "commits", since that's what
  the webhook function for Beanstalk expects in
  zerver/webhooks/beanstalk/view.py. This allows us to use the
  create-stream.md macro.
2018-02-24 06:21:02 -05:00
Eeshan Garg bd787c12c4 webhooks/bitbucket2: Update text and remove screenshots.
* Remove unnecessary screenshot. It doesn't help very much in this
  case.
* Update text to instruct users to not leave the `Title` field
  empty (it cannot be blank).
* Replace wording such as `Go to Settings` with `Click on Settings`.
* Combine the "fill out the form" and "click 'Save'" steps.
* Replace "Choose X on the left-hand side" with "Choose X".
* Replace "Remember to check the X" with "Check the X".
2018-02-24 06:21:02 -05:00
nyan-salmon 03624b78c2 webhooks: Add Facebook integration. 2018-02-19 09:41:49 -08:00
Rishi Gupta 08efd7828a integrations: Update text for bitbucket2 doc.
With minor fixes by eeshangarg.

Eeshan: I added a screenshot because I thought it would be helpful.
2018-02-13 22:28:48 -03:30
Rishi Gupta 7697adfcdc integrations: Update text for appfollow doc.
With minor fixes by eeshangarg.
2018-02-13 22:19:05 -03:30
Rishi Gupta 80a0976afe integrations: Update text for basecamp doc.
With minor fixes by eeshangarg.

Eeshan: I updated the screenshot. The old one was blurry, the
whole process is largely the same.
2018-02-13 22:15:10 -03:30
Rishi Gupta de3d478a80 integrations: Update text for airbrake doc.
With minor fixes by eeshangarg!

Eeshan: I decided to remove the screenshot. It looks very old and
was blurry and the instructions were very screenshot-agnostic
anyway!

I couldn't update the screenshot because Airbrake doesn't even let
you use the free trial till you give them your credit card info,
which I didn't want to do!
2018-02-13 21:56:31 -03:30
neiljp (Neil Pilgrim) 2ed1ab4b7a mypy: Amend topic REQ parameters in helloworld/mention webhooks. 2018-02-13 11:40:52 -08:00
Tim Abbott b9ca7bd954 beeminder: Clean up messy imports in tests. 2018-02-12 12:06:12 -08:00
Ricky 3f832b95de webhooks/beeminder: Fix documentation to append email to URL.
The Beeminder integration requires an `email` parameter that
our bot creation documentation macros don't yet support.
2018-02-12 12:03:25 -08:00
Ricky 76c56ad81d webhooks/beeminder: Make deadline time (time_remain) positive. 2018-02-12 12:03:25 -08:00
Sumana Harihareswara ea0fe90367 webhooks/beeminder/doc.md: Use better macros. 2018-02-09 11:53:32 -08:00
Eeshan Garg 037c891fcf webhooks/delighted: Reformat documentation steps into numbered list.
This is a part of our efforts to migrate our webhook docs to have
a more structured numbered-list format similar to our /help docs.
2018-02-08 17:45:56 -08:00
Eeshan Garg 69f248aaf9 webhooks/codeship: Reformat documentation steps into numbered list.
This is a part of our efforts to migrate our webhook docs to have
a more structured numbered-list format similar to our /help docs.
2018-02-08 17:45:56 -08:00
Eeshan Garg 06e86ce50d webhooks/bitbucket2: Reformat documentation steps into numbered list.
This is a part of our efforts to migrate our webhook docs to have
a more structured numbered-list format similar to our /help docs.
2018-02-08 17:45:56 -08:00
Eeshan Garg 5e1a193e76 webhooks/circleci: Reformat documentation steps into numbered list.
This is a part of our efforts to migrate our webhook docs to have
a more structured numbered-list format similar to our /help docs.
2018-02-08 17:45:56 -08:00
Eeshan Garg af683800fd webhooks/basecamp: Reformat documentation steps into numbered list.
This is a part of our efforts to migrate our webhook docs to have
a more structured numbered-list format similar to our /help
docs.
2018-02-08 17:45:56 -08:00
Eeshan Garg ad6dae1bf5 webhooks/appfollow: Reformat documentation steps into numbered list.
This is a part of our efforts to migrate our webhook docs to have
a more structured numbered-list format similar to our /help docs.
2018-02-08 17:45:56 -08:00
Eeshan Garg 2733540492 webhooks/airbrake: Reformat documentation steps into numbered list.
This is a part of our efforts to migrate our webhook docs to have
a more structured numbered-list format similar to our /help docs.
2018-02-08 17:45:56 -08:00
Eeshan Garg 4414f2b24b webhooks/beeminder: Use create-a-bot.md macro. 2018-02-08 16:22:55 -08:00
Josh Mandel 15eaafa50f Add underscores to thumbs_up and thumbs_down emoji 2018-02-07 11:55:02 -08:00
Ricky db152da7c9 webhooks/beeminder/doc.md: Add instructions for creating a bot. 2018-02-07 10:03:31 -08:00
Ricky 1303248b0b integration: Add statuspage.io webhook integration. 2018-02-07 09:59:12 -08:00
Privisus 9fdd6f2bd4 integrations: Add Insping integration. 2018-01-31 14:36:54 -08:00
Eeshan Garg e8fe4a65af webhooks/gitlab: Filter out hidden comments from issue descriptions.
Hidden comments of the form `<!-- comment -->` were previously
rendered as is when a new Issue was created. Now, we strip those
out completely!
2018-01-24 10:48:55 -08:00
Patrick Grave a2ed76c383 mypy: Use Python 3 syntax for typing in beanstalk/tests.py 2018-01-23 08:49:42 -08:00
Abijith10 7ed76eeb23 mypy: Use Python 3 type syntax in zerver/webhooks/zendesk/view.py. 2018-01-23 08:37:56 -08:00
Abijith10 c4420ba0c6 mypy: Use Python 3 type syntax in zerver/webhooks/librato/view.py. 2018-01-23 08:37:56 -08:00
Abijith10 8a0cd1a966 mypy: Use Python 3 type syntax in zerver/webhooks/github_webhook/view.py. 2018-01-23 08:37:56 -08:00
Abijith10 d30c2463c2 mypy: Use Python 3 type syntax in zerver/webhooks/deskdotcom/view.py. 2018-01-23 08:37:56 -08:00
Abijith10 c6804f5c8d mypy: Use Python 3 type syntax in zerver/webhooks/delighted/view.py. 2018-01-23 08:37:56 -08:00
Abijith10 39fe64132d mypy: Use Python 3 type syntax in zerver/webhooks/codeship/view.py. 2018-01-23 08:37:56 -08:00
Tim Abbott 2c16c76551 beeminder: Fix buggy coding tag at top of file. 2018-01-18 09:07:06 -08:00
infinitelooped 252a485621 integrations: Add documentation for Groove. 2018-01-17 13:00:11 -05:00
Privisus e5fc49e23a integrations: Add documentation for Raygun. 2018-01-17 12:53:22 -05:00
Privisus c758636c1e integrations: Add webhook code, API endpoint, and tests for Raygun. 2018-01-17 12:53:22 -05:00
Ricky a90e99dd3e webhooks: Add Beeminder webhook. 2018-01-17 09:24:12 -05:00
fredfishgames 4cb9edecda integrations: Add documentation for Opbeat. 2018-01-17 09:17:19 -05:00
fredfishgames 4e2b99a98b integrations: Add webhook code, API endpoint, and tests for Opbeat. 2018-01-17 09:17:19 -05:00
Eeshan Garg 457c5a7735 webhooks/gci: Support 'outoftime' event.
This commit adds support for the 'outoftime' event. Such an event
is triggered when the task deadline for a particular task has
passed.
2018-01-16 15:57:35 -08:00
Viraat Chandra 64034241a0 webhooks: Create Intercom integration and docs. 2018-01-16 08:51:17 -05:00
Sivagiri Visakan aeeb9d07a8 integrations: Handle errors in Groove payloads. 2018-01-16 07:31:50 -05:00
Kiy4h 68d86b62fa integrations: Add webhook payloads for rollbar. 2018-01-11 06:32:37 -05:00
Xavier Cooney e417a99830 webhooks/gitlab: Support topic parameter to specify a topic.
Fixes #7743.
2018-01-11 06:29:55 -05:00
infinitelooped ffa7637215 integrations: Add webhook code, API endpoint, and tests for Groove. 2018-01-09 09:32:52 -05:00
Privisus 4f700ddcbf integrations: Add webhook payloads for Raygun. 2018-01-04 11:44:39 -05:00
MadElf1337 7c113d185f integrations: Add webhook payloads for Facebook. 2018-01-03 14:47:50 -05:00
Eeshan Garg 18c3bec667 webhooks/gci: Support "unassign" event type.
This commit adds support for the "unassign" event type, the
payloads for which are generated when a mentor unassigns a student
from a task.
2018-01-02 16:42:00 -05:00
Eeshan Garg 2c7f4d2187 webhooks/gci: Support "extend" event type.
This commit adds support for events of type "extend", the payloads
for which are generated when a mentor extends the deadline for a
task.
2018-01-02 16:42:00 -05:00
MadElf1337 e7f1a9ee34 inetgrations: Add webhook payloads for Honeybadger. 2018-01-02 11:45:33 -05:00
rht 185fd99816 mypy: Use Python 3 type syntax in several files. 2017-12-30 07:34:51 -05:00
MadElf1337 39fc26deff integrations: Add webhook payloads for Runscope. 2017-12-29 07:27:20 -05:00
MadElf1337 de62e11c23 integrations: Add webhook payloads for StatusPage.io. 2017-12-28 15:53:06 -05:00
Kiy4h 2e35b7fd60 mypy: Use Python 3 type syntax in zerver/webhooks/taiga/view.py. 2017-12-28 07:26:44 -05:00
Kiy4h 93cc19e3f8 mypy: Use Python 3 type syntax in zerver/webhooks/helloworld/view.py. 2017-12-28 07:26:44 -05:00
Kiy4h 3b7fbc1a1d mypy: Use Python 3 type syntax in zerver/webhooks/gosquared/view.py. 2017-12-28 07:26:44 -05:00
Rhea Parekh bebd8df728 zerver/webhooks/github/view: Sweep force_str. 2017-12-26 09:09:31 -05:00
Rhea Parekh 99cb001345 zerver/webhooks/beanstalk/view.py: Sweep force_bytes and force_str. 2017-12-26 09:09:31 -05:00
Xavier Cooney f66f04f83a mypy: Use Python 3 type syntax in 'bitbucket/tests.py'. 2017-12-26 08:34:38 -05:00
Xavier Cooney 34aee15d63 mypy: Use Python 3 type syntax in 'gitlab/view.py'. 2017-12-26 08:34:38 -05:00
Xavier Cooney 78042d7f18 mypy: Use Python 3 type syntax in 'webhooks/gogs/tests.py'. 2017-12-26 08:34:38 -05:00
nyan-salmon 51be0e5e76 mypy: Use Python 3 type syntax in zerver/webhooks/solano/view.py. 2017-12-26 08:34:06 -05:00
nyan-salmon 4f4d689f86 mypy: Use Python 3 type syntax in zerver/webhooks/splunk/view.py. 2017-12-26 08:34:06 -05:00
nyan-salmon 6c5f66c561 mypy: Use Python 3 type syntax in zerver/webhooks/slack/view.py. 2017-12-26 08:34:06 -05:00
fredfishgames ccc3d69f61 mypy: Use Python 3 type syntax in zerver/webhooks/bitbucket2/tests.py. 2017-12-26 08:31:09 -05:00
greysome 6bcc01bfee mypy: Use Python 3 type syntax in zerver/webhooks/bitbucket/view.py 2017-12-26 08:30:33 -05:00
greysome da9c808db4 mypy: Use Python 3 type syntax in zerver/webhooks/transifex/view.py 2017-12-26 08:30:33 -05:00
greysome 64ce353d4b mypy: Use Python 3 type syntax in zerver/webhooks/circleci/view.py 2017-12-26 08:30:33 -05:00
Angelika Serwa 2f575cca72 Add Dropbox webhook integration.
This is just a basic Dropbox webhook integration. It just
notifies a user when something has changed, it does not
specify what changed. Doing so would require storing data,
as Dropbox API was created mainly for file managers, not
integrations like this.
Closes #5672
2017-12-22 10:36:21 -05:00
Marco Burstein 6fc50fa21a mypy: Use Python 3 type syntax in `zerver/webhooks/sentry/view.py`. 2017-12-22 08:17:00 -05:00
Marco Burstein 34001081c2 mypy: Use Python 3 type syntax in `zerver/webhooks/yo/view.py`. 2017-12-22 08:17:00 -05:00
Marco Burstein 678b43494b mypy: Use Python 3 type syntax in `zerver/webhooks/airbrake/view.py`. 2017-12-22 08:17:00 -05:00
Marco Burstein 2acf3cf1d4 mypy: Use Python 3 type syntax in `zerver/webhooks/mention/view.py`. 2017-12-22 08:17:00 -05:00
Marco Burstein e7f0139f69 mypy: Use Python 3 type syntax in `zerver/webhooks/travis/view.py`. 2017-12-22 08:17:00 -05:00
ViRu-ThE-ViRuS c8aadaa408 integrations: Add webhook payloads for Intercom. 2017-12-19 16:50:06 -05:00
Eeshan Garg 8936d03f3a webhooks/gitlab: Support Merge Request Hook approved event type.
Such payloads are generated when a GitLab repository has merge
request approvals enabled and a project member approves a merge
request. Approving is not the same as merging.
2017-12-18 19:12:54 -05:00
Eeshan Garg 21008a49b9 webhooks/gci: Support approve-pending-pc event type.
This event is generated when a mentor approves a task but
GCI is still waiting on a student's parental consent.
2017-12-18 10:00:20 -08:00
Callum Fraser a61a7f3965 mypy: Use Python 3 type syntax in zerver/webhooks/pingdom/view.py. 2017-12-18 11:32:52 -05:00
Callum Fraser 4508264f25 mypy: Use Python 3 type syntax in zerver/webhooks/opsgenie/view.py. 2017-12-18 11:32:52 -05:00
Callum Fraser 52f0c4472e mypy: Use Python 3 type syntax in zerver/webhooks/ifttt/view.py. 2017-12-18 11:32:52 -05:00
Callum Fraser 23b29212a3 mypy: Use Python 3 type syntax in zerver/webhooks/greenhouse/view.py. 2017-12-18 11:32:52 -05:00
Callum Fraser 403ea486e4 mypy: Use Python 3 type syntax in zerver/webhooks/gogs/view.py. 2017-12-18 11:32:52 -05:00
Callum Fraser 33e1879295 mypy: Use Python 3 type syntax in zerver/webhooks/beanstalk/view.py. 2017-12-18 11:32:52 -05:00
Callum Fraser c55685063f mypy: Use Python 3 type syntax in zerver/webhooks/appfollow/view.py. 2017-12-18 11:32:52 -05:00
Alena Volkova 90aa6c627e tests: Replace api_auth usages with auth methods in zerver/webhooks. 2017-12-18 09:24:09 -05:00
Sivagiri 3792bd2d69 integrations: Add webhook payloads for Groove. 2017-12-14 18:54:22 -05:00
Xavier Cooney ebc7c72d99 mypy: Use Python 3 type syntax in wordpress/view.py 2017-12-11 20:33:00 -08:00
Xavier Cooney 2db270be4b mypy: Use Python 3 type syntax in crashlytics/view.py 2017-12-11 20:33:00 -08:00
Xavier Cooney 1fa5233923 mypy: Use Python 3 type syntax in gitlab/tests.py 2017-12-11 20:33:00 -08:00
Xavier Cooney cc427911fa mypy: Use Python 3 type syntax in stripe/view.py 2017-12-11 20:33:00 -08:00
picapi_ f07d39353a mypy: Use Python 3 type syntax in zerver/webhooks/basecamp/view.py. 2017-12-11 20:27:55 -08:00
picapi_ d038e7ea6b mypy: Use Python 3 type syntax in zerver/webhooks/bitbucket2/view.py. 2017-12-11 20:27:55 -08:00
picapi_ 20c2e53de4 mypy: Use Python 3 type syntax in zerver/webhooks/jira/view.py. 2017-12-11 20:27:55 -08:00
picapi_ 15fb392dd1 mypy: Use Python 3 type syntax in zerver/webhooks/papertrail/view.py. 2017-12-11 20:27:55 -08:00
picapi_ 3fb9803398 mypy: Use Python 3 type syntax in zerver/webhooks/teamcity/view.py. 2017-12-11 20:27:55 -08:00
Ivche1337 1d202e30d8 integrations: Add webhook payloads for Opbeat. 2017-12-11 15:40:49 -06:00
Rishi Gupta 4eb3202b13 integrations: Remove weather example from zapier doc.
I don't think it made the page more readable, and doubled the length.
2017-12-11 15:39:26 -06:00
Arseny Chekanov 1f34300006 mypy: Use Python 3 type syntax in zerver/webhooks/trello/tests.py. 2017-12-09 16:50:12 -08:00
Xavier Cooney a6465e8e35 mypy: Use Python 3 syntax in zapier/view.py. 2017-12-08 18:34:26 -08:00
Xavier Cooney 1262d14d39 mypy: Use Python 3 syntax in gci/view.py. 2017-12-08 18:34:26 -08:00
Xavier Cooney 38e65570ae mypy: Use Python 3 syntax for typing in heroku/view.py. 2017-12-08 18:34:26 -08:00
picapi_ 5febd177cf mypy: Use Python 3 type syntax in zerver/webhooks/newrelic/view.py. 2017-12-05 16:32:18 -08:00
picapi_ d55d680758 mypy: Use Python 3 type syntax in zerver/webhooks/homeassistant/view.py. 2017-12-05 16:32:18 -08:00
picapi_ c2ef7e7ce5 mypy: Use Python 3 type syntax in zerver/webhooks/freshdesk/view.py. 2017-12-05 16:32:18 -08:00
picapi_ 67773a4b84 mypy: Use Python 3 type syntax in zerver/webhooks/semaphore/view.py. 2017-12-03 13:48:18 -08:00
derAnfaenger 6dd639454e integrations: Add topic parameter for Appfollow.
Tweaked by tabbott to document the integration.
2017-11-28 15:49:19 -08:00
Tim Abbott d5bb45db60 webhooks/gci: Fix missing mypy annotation. 2017-11-28 14:08:44 -08:00
Sampriti Panda bea653fabc webhooks/gci: Improve message formatting.
* Use Student Name instead of Task Name in subject.
* Use Task Instance URL instead of Task Definition URL (and workaround
  for a bug in the API).
2017-11-28 13:53:42 -08:00
Eeshan Garg 5b8f38f4e3 webhooks/bitbucket2: Ignore push events with no changes.
We now ignore payloads where payload['push']['changes'] is empty,
because an empty push doesn't really convey any useful information.

I couldn't find a way to replicate the action that would generate
such a payload, so I took one of our existing payloads and editted
out payload['push']['changes'] myself, so this payload is not
authentic.
2017-11-26 17:03:07 -08:00
Eeshan Garg 23162a1433 github_webhook: Use indented Markdown macros. 2017-11-25 17:01:11 -08:00
Eeshan Garg 1dca7cc367 webhooks/beanstalk: Use indented Markdown macros. 2017-11-25 17:01:11 -08:00
rht 5f6dbe6226 fixtures: replace optparse example with argparse. 2017-11-21 21:23:41 -08:00
Eeshan Garg 02a32e246e webhooks/gitlab: Support test payloads without an "action" attribute.
Payloads that don't have a payload['object_attributes']['action']
attribute are generated when GitLab sends a test payload to verify
if the webhook was set up successfully. In this case, we should
send a message notifying that the webhook was configured
successfully.
2017-11-19 20:56:10 -08:00
Tim Abbott 73a668e7ae python: Sort imports in webhooks. 2017-11-15 15:43:10 -08:00
rht bafba95eb7 Text-wrap the remaining long lines exceeding 110. 2017-11-15 10:58:03 -08:00
Tommy Ip 8480deb754 integration docs: Fix broken desk.com markdown. 2017-11-10 17:33:42 +00:00
Tommy Ip 325ca0df62 integration docs: Fix broken Stripe markdown.
More information: https://chat.zulip.org/#narrow/stream/issues/topic/.237336
2017-11-10 17:19:52 +00:00
Tommy Ip 7477fbb14e docs: Remove dangling </p> tag.
Fixes #7336
2017-11-09 14:39:40 -08:00
rht bb46bea44d Remove usage of six.moves.text_type. 2017-11-09 10:00:00 -08:00
rht 04eaec64f0 zerver/webhooks: Text-wrap long lines exceeding 110. 2017-11-07 17:24:09 -08:00
neiljp (Neil Pilgrim) d038bf89ac mypy: Adjust pivotal/view.py function parameter type based on body. 2017-11-07 11:26:46 -08:00
rht 549a26860f refactor: Remove six.moves.range import. 2017-11-07 10:46:42 -08:00
rht ec5120e807 refactor: Remove six.moves.zip import. 2017-11-07 10:46:42 -08:00
rht 19bd335cbb Change urllib import to be Python 3-specific. 2017-11-07 10:46:42 -08:00
rht 8990b1046d zerver: Remove inheritance from object. 2017-11-06 08:53:48 -08:00
neiljp (Neil Pilgrim) 42f5eea61f mypy: Improve typing of request.pyi (REQ).
This expands request.pyi to type-check the arguments passed into REQ.

Tweaked by tabbott to fix the report.py annotations.
2017-11-04 20:26:03 -07:00
neiljp (Neil Pilgrim) 720df640e7 mypy: Set freshdesk TicketDict to inherit from typed Dict. 2017-11-04 19:47:45 -07:00
rht 969cc506d2 zerver/webhooks: Use python 3 syntax for typing.
Tweaked by tabbott to fix various line-wrapping issues.
2017-11-04 19:40:32 -07:00
Eeshan Garg aaaed74c3d webhooks: Import REQ, has_request_variables from zerver.lib.request.
We now import REQ and has_request_variables from zerver.lib.request,
which is where these methods are defined.

Fixes #7195.
2017-11-02 14:40:55 -07:00
Eeshan Garg 20f3e9b779 webhooks/gci: Support 'needswork' event_type.
This commit adds support for payloads that are generated when a
mentor submits a task for more work.
2017-11-02 16:46:11 -02:30
Eeshan Garg 9969a3a40b webhooks/gci: Replace 'type' -> 'event_type', 'uuid' -> 'id'. 2017-11-02 16:39:48 -02:30
neiljp (Neil Pilgrim) 7d8de37299 mypy: Specify librato Callable type. 2017-10-31 00:03:35 -07:00
Greg Price eb55a3a1ba template context: Give better names to the URLs for the API.
The "subdomain" label is redundant, to the extent it's even
accurate -- this is really just the URL we want to display,
which may or may not involve a subdomain.  Similarly "external".

The former `external_api_path_subdomain` was never a path -- it's a
host, followed by a path, which together form a scheme-relative URL.
I'm not quite convinced that value is actually the right thing in
2 of the 3 places we use it, but fixing that can start by giving an
accurate name to the thing we have.
2017-10-30 18:29:29 -07:00
rht c4fcff7178 refactor: Replace super(.*self) with Python 3-specific super().
We change all the instances except for the `test_helpers.py`
TimeTrackingCursor monkey-patching, which actually needs to specify
the base class.
2017-10-30 14:30:25 -07:00
Steve Howell 655f37a34b Rename subject_name in send_message_backend(). 2017-10-27 10:48:11 -07:00
Tim Abbott 8e2cdedf9a lint: Fix lines in Python codebase longer than 120 characters. 2017-10-26 17:47:30 -07:00
Tim Abbott b936e8c24b lint: Fix lines in Python codebase longer than 125 characters. 2017-10-26 17:36:54 -07:00
Tim Abbott be619fe881 lint: Wrap many very long lines in the Python codebase.
This decreases the maximum line length in our Python codebase to 130.
2017-10-26 17:31:58 -07:00
Eeshan Garg bd814eea2b webhooks/taiga: Support relateduserstory events.
This commit adds support for the following:

1. When a user story is added to an epic.
2. When a user story is removed from an epic.
2017-10-25 10:59:58 -07:00
Eeshan Garg f8b5976335 webhooks/taiga: Support Epic events. 2017-10-23 11:09:43 -07:00
derAnfaenger cfadb43b93 codebase: Remove multiple whitespaces after comma. 2017-10-18 10:04:23 -07:00
Eeshan Garg fb17481a7f webhooks/gci: Support claim, comment, submit, approve event types. 2017-10-16 22:01:19 -07:00
neiljp (Neil Pilgrim) fc947d92e2 mypy: Improve return type in bitbucket2 webhook function. 2017-10-11 12:16:50 -07:00
Eeshan Garg 71eee35bce webhooks: Add a Google Code-in integration. 2017-10-09 09:04:39 -07:00
Tim Abbott e3c395f247 webhooks: Remove use of get_user_profile_by_email.
This function is deprecated.
2017-10-02 15:28:44 -07:00
Eeshan Garg 32bd609361 webhooks/yo: Migrate to check_send_private_message. 2017-10-02 15:27:26 -07:00
Eeshan Garg d20b57c20d webhooks/teamcity: Migrate to check_send_private_message. 2017-10-02 15:27:26 -07:00
derAnfaenger d1afab7199 Replace deprecated Logging.warn calls with Logging.warning. 2017-10-02 11:11:42 +02:00
Eeshan Garg 86c2c7ad34 webhooks: Migrate to check_send_stream_message.
This commit migrates all webhooks to use check_send_stream_message
instead of check_send_message. The only two webhooks that still
use check_send_message are our yo and teamcity webhooks. They
both use check_send_message for private messages.
2017-09-30 17:48:55 -07:00
Eeshan Garg da3c008872 webhooks/trello: Remove trello/view/templates.py.
TRELLO_MESSAGE_TEMPLATE and TRELLO_SUBJECT_TEMPLATE are
redundant. This commit removes them. Now, subjects don't end
in periods. And where a period is necessary in the message body,
one is appended at the end of the specific template for that
message.
2017-09-28 10:58:07 -07:00
Marco Matarazzo a6b83def8f webhooks/trello: Support updating Card descriptions.
We now support events that add, change or remove Trello Card
descriptions.

Minor fixes by eeshangarg.
2017-09-28 10:58:07 -07:00
Marco Matarazzo 765f8e7d41 webhooks/trello: Display Card comment's text in notifications.
Now, when someone makes a comment on a Trello Card, the text
of the comment is quoted in the notification.

Minor fixes by eeshangarg.
2017-09-28 10:58:07 -07:00
rht 7115a29bee zerver/webhooks: Remove absolute_import. 2017-09-27 10:00:39 -07:00
neiljp (Neil Pilgrim) e6daee441b mypy: Adjust board_actions.py to allow Optional[Text] values. 2017-09-25 16:02:56 -07:00
Eeshan Garg a041a23199 webhooks/trello: Ignore when Board background is changed.
I feel like getting notifications about a board's background being
changed isn't very useful information and could interrupt the flow
of other important information such as Card changes or movement,
so I think we should not support this event and
should simply ignore such payloads in the future.
2017-09-15 01:02:47 -07:00
Tim Abbott 27101ae931 trello: Use client_head wrapper in tests. 2017-08-26 13:45:27 -07:00
Tim Abbott 7d08ff69f0 tests: Remove most references to get_api_key.
This test helper doesn't really have value.
2017-08-24 23:30:46 -07:00
Tim Abbott 69059dcac8 tests: Clean up subscribing from webhook tests. 2017-08-24 21:37:57 -07:00
Eeshan Garg 31986d1b94 github_webhook: Update "pull_request unassigned" event fixture.
The older fixture for this event assumed that the "assignee" key
had a value of '{}' if no one was assigned to a PR anymore.
However, that is no longer true because testing with requestbin
showed that in the latest JSON payload for this event, the key
"assignee" now has the value of 'null' (None when converted to
Python) when a user is unassigned from a PR. The current code
didn't handle this correctly. This commit makes sure it does!

Its unclear as to whether the old fixture was simply wrong or
whether GitHub changed its payloads in any way.
2017-08-24 16:48:00 -07:00
Robert Hönig 18a080cd6c Don't handle json payload key errors inside webhooks.
Fixes first part of #6213.
2017-08-24 11:33:14 -07:00
Robert Hönig c5f0478374 linter: Add trailing whitespace check for json files. 2017-08-15 09:28:11 -07:00
Robert Hönig 4be814fc16 integrations: Add OpsGenie integration. 2017-08-15 08:42:19 -07:00
Jack Zhang f9b5a270d0 integrations: Remove titles from integration docs. 2017-08-10 10:21:53 -07:00
Jack Zhang e56b060ef4 github_webhook/doc.md: Add link to deprecated Github Services integration. 2017-08-10 10:21:53 -07:00
Jack Zhang 8187b7ab57 bitbucket2/doc.md: Add link to deprecated Enterprise integration. 2017-08-10 10:21:53 -07:00
Jack Zhang 9461f2f799 docs: Update /integrations links to new pushState routes.
Update Email, Beanstalk, Hubot, JIRA, and Trello integrations
links.

The Hubot integrations section (/integrations#hubot-integrations)
was removed  in an earlier redesign of /integrations. This commit
replaces the link with the hubot-scripts organization on
Github, which displays the comprehensive list of all integrations
available via Hubot.

Fixes #5875.
2017-08-10 10:21:53 -07:00
neiljp (Neil Pilgrim) 82bac5ca11 Webhook: Remove duplicate trello code. 2017-08-08 15:55:09 -07:00
neiljp (Neil Pilgrim) 60baedcab9 mypy: strict-optional fixes for Trello integration. 2017-08-07 21:27:50 -07:00
Eeshan Garg 8f3e997a47 webhooks/trello: Ignore Card movement within a single list. 2017-07-26 22:22:14 -07:00
Greg Price 7cd621bc9d webhooks/updown: Fix a JsonableError to provide a real error message. 2017-07-24 16:41:22 -07:00
Eeshan Garg 2ed7b7b6a1 webhooks/slack: Support unicode.
If an incoming payload contained a unicode character, it raised
a UnicodeEncodeError, because the message template was an str. Now,
the message template is unicode, so it can be formatted to include
unicode characters, should the incoming payloads contain any.
2017-07-20 10:30:03 -07:00
Eeshan Garg c16e4c7d32 github_webhook: Support "ping" events from organization webhooks.
In addition to "ping" webhook payloads from repository-specific
webhooks, we now also support "ping" events from organization-wide
webhooks.
2017-07-17 10:15:28 -07:00
neiljp (Neil Pilgrim) 8611a2cafa tidying: Combine multiple 'import typing' lines onto one line. 2017-07-16 16:43:21 -07:00
Vishnu Ks a25ba763bf semaphore: Remove unused get_user_profile_by_email import. 2017-07-14 13:35:43 -07:00
Vishnu Ks 795a1a5701 jira: Replace get_user_profile_by_email in view.py. 2017-07-14 13:35:43 -07:00
neiljp (Neil Pilgrim) 6cb3a2ab1a mypy: Move type annotation in jira/view.py before general comments. 2017-07-07 10:56:33 -07:00
Kenji Okimoto 2eb6c49a89 github_webhook: Fix a typo to handle issues event properly.
issue -> issues in the HTTP_X_GITHUB_EVENT.
2017-06-30 10:55:01 -07:00
Sadjad Fouladi 92fefa0e7e Fix a grammatical error in status change message. 2017-06-30 11:44:04 -04:00
Eeshan Garg 843dbbf3a1 webhooks/slack: Restructure docs to use create-stream.md macro. 2017-06-26 12:30:04 -04:00
Nick Sweeting 8e84c72acb Add error checking to payload['previous'] for Circle.CI.
This webhook used to fail if there was no previous payload.
2017-06-26 08:15:07 -04:00
Rohitt Vashishtha c802967808 webhooks/travis: Fix typos in docs. 2017-06-15 11:11:56 -07:00
Rohitt Vashishtha d671dea29f webhooks/yo: Migrate docs to markdown. 2017-06-15 11:10:44 -07:00
Rohitt Vashishtha 1fe58eb325 webhooks/slack: Migrate docs to markdown. 2017-06-15 11:10:44 -07:00
Eeshan Garg 2344e26b1a webhooks/zendesk: Migrate docs to Markdown. 2017-06-14 17:42:17 -07:00
Eeshan Garg 9e77749bfc webhooks/wordpress: Migrate docs to Markdown.
Markdown doesn't support tables, so I used an unordered list
instead for the HTML table at the end.
2017-06-14 17:42:17 -07:00
Eeshan Garg 4a3137be97 webhooks/taiga: Migrate docs to Markdown. 2017-06-14 17:42:17 -07:00
Eeshan Garg 1c5d0bb0fa webhooks/semaphore: Use append-stream-name.md macro. 2017-06-14 17:42:17 -07:00
Eeshan Garg 0d611d4c8a webhooks/stripe: Migrate docs to Markdown. 2017-06-14 17:42:17 -07:00
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