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. |
david | |
Saves -> Save. |
david | |
"serialize it as its URL" is kind of confusing. How about: DiffSet objects are serialized as the link to the … |
david | |
This would be much easier as: self.history.review_request |
david | |
I'd rather these docstring cleanups be in their own change. It gets harder to track down changes when there are … |
chipx86 | |
This will have to go somewhere else. Nothing in diffviewer/ should ever know about review requests. It should only know … |
chipx86 | |
The """ is indented one layer too far. |
chipx86 | |
How do the other items in the payload look? Can you show me what the payload ends up looking like? … |
chipx86 |
-
-
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.
-
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:
-
~ View the new Djblets serialization of Django models, DiffSets are now
~ serialized as their URL in webhook payloads. ~ Previously, a when uploading a new diff for a review request, if there
~ were webhooks configured, they would fail to execute because DiffSet
s+ could not be serialized. Now that Djblets supports serialization of + arbitrary Django models, we implement this behaviour for DiffSet
s so+ they can be serialized in webhook payloads (as their diffviewer URL).
-
Tool: Pyflakes Processed Files: reviewboard/diffviewer/models.py Tool: PEP8 Style Checker Processed Files: reviewboard/diffviewer/models.py
- Change Summary:
-
Addressed Christian's issues.
-
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
- Summary:
-
Serialize diffsets in webhooksWebHooks now use the ResourceAPIEncoder
- Description:
-
Previously, a when uploading a new diff for a review request, if there
were webhooks configured, they would fail to execute because DiffSet
scould not be serialized. Now that Djblets supports serialization of arbitrary Django models, we implement this behaviour for DiffSet
s so~ they can be serialized in webhook payloads (as their diffviewer URL). ~ 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.