Add a view for retrieving updates to the review request page.
Review Request #9133 — Created Aug. 14, 2017 and submitted
This introduces a new internally-facing view that provides information
on the updates made to existing entries on the page (along with certain
UI elements, such as the issue summary table). The client will be able
to poll for this information and dynamically update the page without a
Each update contains JSON metadata consisting of basic information on
that entry/UI element, model attributes, and view options. The update
also contains new HTML for that part of the page.
Rather than using JSON or some other standard serialization format to
represent all the resulting changes on the page, the payload instead
uses a custom format that serializes updates as:
- The byte length of the JSON metadata
- The JSON metadata contents
- The byte length of the HTML content
- The HTML content
This is more compact than using a format like JSON, as the HTML can be
represented as-is and doesn't need to be escaped when serializing. It's
faster, as the JSON can be quickly parsed and the HTML directly set in
the DOM. It's also a streamable format, allowing us down the road to
push updates directly to the page piece-by-piece.
The view allows for filtering by specific entries or entry types, and
also allows for filtering by timestamp. The entries have been extended
to support ETag generation, allowing for flexible caching of results.
An upcoming change will make use of this client-side.
Unit tests pass.
Tested the filtering options manually with a series of different
Tested the updates capabilities with the upcoming client-side change.
Fixed PyFlakes complaints.
Revision 2 (+675 -22)
Checks run (2 succeeded)