Add some features and UI polish for Webhooks.
Review Request #6391 — Created Oct. 1, 2014 and submitted
Now that we have support for webhooks in Review Board, it's time to make
them completely awesome and flexible, without being annoyingly hard to
use.Previously, our webhooks were global across repositories and were forced
into pre-built JSON payloads. This is pretty par-for-the-course for
webhook implementations, but a few implementations out there had some
nice features that were worth bringing in.Now, webhooks can be tied to one or more repositories, can be set to
apply only for events not matching a repository (such as review requests
that are only used for file uploads), or can be set to always fire
regardless of whether there's a repository.They can be set to output JSON, XML, or form data payloads (in which
case there will be apayload=<encoded form data>
sent to the server.Payloads are also no longer limited to what we generate. Users can
toggle an option for specifying a custom payload, which gives them a
CodeMirror widget they can edit. This supports the Django template
format, allowing the use of template tags, with the original payload
provided as the variable context. Several scary tags (such as include,
load, etc.) are disabled, and RequestContext is not used, keeping this
safe.The webhook UI has been updated to provide a bit more guidance, especially
with the new options.There were a few changes under the hood as well. Instead of a
X-ReviewBoard-Signature
, we now use the more standardX-Hub-Signature
(followed by GitHub and others). We also provide a properUser-Agent
.
Added unit tests for all the conditions.
Played around with creating some webhooks.
Database evolved successfully.
Description | From | Last Updated |
---|---|---|
"Without repositories" is kind of weird. How about "...not associated with a repository (file attachments only)"? |
david | |
This should link to documentation on what to put in here. |
david | |
local variable 'target1' is assigned to but never used |
reviewbot | |
local variable 'target2' is assigned to but never used |
reviewbot | |
local variable 'target1' is assigned to but never used |
reviewbot | |
local variable 'target3' is assigned to but never used |
reviewbot | |
local variable 'target3' is assigned to but never used |
reviewbot | |
local variable 'target2' is assigned to but never used |
reviewbot | |
local variable 'target3' is assigned to but never used |
reviewbot | |
'Q' imported but unused |
reviewbot | |
'Template' imported but unused |
reviewbot | |
Col: 80 E501 line too long (80 > 79 characters) |
reviewbot | |
Can you use the word "not" instead of "blocks"? I was initially kind of confused because I read it as … |
david |
- Change Summary:
-
Fixed unused variables in tests, and a couple other warnings.
- Commit:
-
e5d21b464fcdb96432093018a7d3eb61dd8476116549d5d4579bac58aa7296ec979271fd7dee07df
- Diff:
-
Revision 2 (+777 -55)
-
Tool: PEP8 Style Checker Processed Files: reviewboard/notifications/evolutions/webhooktarget_extra_state.py reviewboard/notifications/models.py reviewboard/notifications/tests.py reviewboard/notifications/admin.py reviewboard/notifications/evolutions/__init__.py reviewboard/staticbundles.py reviewboard/notifications/webhooks.py reviewboard/notifications/forms.py Ignored Files: reviewboard/static/rb/js/webhooksAdmin/views/webhookFormView.js reviewboard/static/rb/css/pages/admin.less reviewboard/templates/admin/notifications/webhooktarget/change_form.html Tool: Pyflakes Processed Files: reviewboard/notifications/evolutions/webhooktarget_extra_state.py reviewboard/notifications/models.py reviewboard/notifications/tests.py reviewboard/notifications/admin.py reviewboard/notifications/evolutions/__init__.py reviewboard/staticbundles.py reviewboard/notifications/webhooks.py reviewboard/notifications/forms.py Ignored Files: reviewboard/static/rb/js/webhooksAdmin/views/webhookFormView.js reviewboard/static/rb/css/pages/admin.less reviewboard/templates/admin/notifications/webhooktarget/change_form.html
- Change Summary:
-
- Renamed the "no repositories" option to be a bit more clear, and made it the last radio button.
- Clarified some wording in docs.
- Commit:
-
6549d5d4579bac58aa7296ec979271fd7dee07dfbffb925b21c6b9d49298b34154a3ddac46bc7d56
- Diff:
-
Revision 3 (+778 -55)
-
Tool: Pyflakes Processed Files: reviewboard/notifications/evolutions/webhooktarget_extra_state.py reviewboard/notifications/models.py reviewboard/notifications/tests.py reviewboard/notifications/admin.py reviewboard/notifications/evolutions/__init__.py reviewboard/staticbundles.py reviewboard/notifications/webhooks.py reviewboard/notifications/forms.py Ignored Files: reviewboard/static/rb/js/webhooksAdmin/views/webhookFormView.js reviewboard/static/rb/css/pages/admin.less reviewboard/templates/admin/notifications/webhooktarget/change_form.html Tool: PEP8 Style Checker Processed Files: reviewboard/notifications/evolutions/webhooktarget_extra_state.py reviewboard/notifications/models.py reviewboard/notifications/tests.py reviewboard/notifications/admin.py reviewboard/notifications/evolutions/__init__.py reviewboard/staticbundles.py reviewboard/notifications/webhooks.py reviewboard/notifications/forms.py Ignored Files: reviewboard/static/rb/js/webhooksAdmin/views/webhookFormView.js reviewboard/static/rb/css/pages/admin.less reviewboard/templates/admin/notifications/webhooktarget/change_form.html