Update the Gerrit hosting service to use the new client support.
Review Request #10930 — Created March 2, 2020 and submitted
The Gerrit hosting service had some compatibility issues with Python 3,
and this was due to a queryset ordering discrepency issue that was
solved in Review Board 4.0's hosting service client rewrite.Rather than take the easy route and apply the same fix to Gerrit's code,
this change updates the Gerrit codebase to make full use of the modern
client support. We now use the request/response capabilities in that
rewrite to better control how authentication is performed and to use the
standard methods for performing HTTP requests, allowing us to remove the
customapi_*
request methods.Since Gerrit's API has a security-related quirk where it prefixes JSON
payloads with a string we have to filter out, we still needed a way to
strip this out in a standard way. Previously, we overrode a private
method inHostingServiceClient
to do this, which wasn't future-proof.
Now, as part of this change, aHostingServiceClient
can designate a
subclass ofHostingServiceHTTPResponse
to use for all responses, which
the Gerrit implementation uses in order to strip out this prefix when
requesting a JSON-deserialized response.
Manually tested linking a new repository and account, viewing branches,
listing commits, and posting commits for review.Unit tests pass.
Summary | ID |
---|---|
47c2fbc0612516f95331424809878054d94f6be7 |
Description | From | Last Updated |
---|---|---|
F821 undefined name 'url' |
reviewbot |