WebHooks now use the ResourceAPIEncoder
Review Request #7822 — Created Dec. 22, 2015 and submitted
Previously, a when uploading a new diff for a review request, if there
were webhooks configured, they would fail to execute becauseDiffSet
s
could not be serialized. Now that Djblets supports serialization of
arbitrary Django models, we implement this behaviour forDiffSet
s so
they can be serialized in web hook payloads (as their diffviewer URL).Web hooks have been updated to use the
ResourceAPIEncoder
so if any
model present in a payload is registered with a resource, it will be
serialized accordingly. This should avoid future serialization issues
with web hooks.
- Ran unit tests.
- Could not reproduce issue 4042 with this patch applied.
- The new unit test fails without this patch applied.
Description | From | Last Updated |
---|---|---|
Undo this please. |
|
|
Saves -> Save. |
|
|
"serialize it as its URL" is kind of confusing. How about: DiffSet objects are serialized as the link to the … |
|
|
This would be much easier as: self.history.review_request |
|
|
I'd rather these docstring cleanups be in their own change. It gets harder to track down changes when there are … |
|
|
This will have to go somewhere else. Nothing in diffviewer/ should ever know about review requests. It should only know … |
|
|
The """ is indented one layer too far. |
|
|
How do the other items in the payload look? Can you show me what the payload ends up looking like? … |
|
-
-
-
-
reviewboard/diffviewer/models.py (Diff revision 1) "serialize it as its URL" is kind of confusing. How about:
DiffSet objects are serialized as the link to the "View Diff" page at the given revision.
-
reviewboard/diffviewer/models.py (Diff revision 1) This would be much easier as:
self.history.review_request
-
-
reviewboard/diffviewer/models.py (Diff revision 2) I'd rather these docstring cleanups be in their own change. It gets harder to track down changes when there are modifications in a file that are unrelated to the purpose of the commit.
-
reviewboard/diffviewer/models.py (Diff revision 2) This will have to go somewhere else. Nothing in
diffviewer/
should ever know about review requests. It should only know about diffs and the things it needs to access them.We'll need a different approach for this particular patch.

-
Tool: PEP8 Style Checker Processed Files: reviewboard/diffviewer/models.py Tool: Pyflakes Processed Files: reviewboard/diffviewer/models.py
Description: |
|
|||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Diff: |
Revision 3 (+28) |

-
Tool: Pyflakes Processed Files: reviewboard/diffviewer/models.py Tool: PEP8 Style Checker Processed Files: reviewboard/diffviewer/models.py
Change Summary:
Addressed Christian's issues.
Depends On: |
|
||||
---|---|---|---|---|---|
Diff: |
Revision 4 (+47) |

-
Tool: Pyflakes Processed Files: reviewboard/notifications/webhooks.py Tool: PEP8 Style Checker Processed Files: reviewboard/notifications/webhooks.py

-
Tool: PEP8 Style Checker Processed Files: reviewboard/notifications/webhooks.py Tool: Pyflakes Processed Files: reviewboard/notifications/webhooks.py

-
Tool: Pyflakes Processed Files: reviewboard/notifications/webhooks.py reviewboard/notifications/tests.py Tool: PEP8 Style Checker Processed Files: reviewboard/notifications/webhooks.py reviewboard/notifications/tests.py
-
-
-
reviewboard/notifications/webhooks.py (Diff revision 6) How do the other items in the payload look? Can you show me what the payload ends up looking like?
The reason I ask is that we don't really use
'url'
in our API payloads, and I thought that the webhooks used the same format. I'm not sure I fully know how this should be looking, though.
Summary: |
|
|||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Description: |
|
|||||||||||||||||||||||||||||||||
Depends On: |
|
|||||||||||||||||||||||||||||||||
Diff: |
Revision 7 (+27 -2) |