Add support for custom license action handling.
Review Request #14470 — Created June 23, 2025 and updated — Latest diff uploaded
License Providers that register custom actions can now handle them in
requests from the client. This is done by registering the action name in
the License Provider'scustom_actions
set and then adding a
handle_<actionid>_action()
method to handle the response.
BaseLicenseProvider.call_action()
has been added to invoke these
actions. This does the work formerly done by the view, making it more
generally-useful outside of HTTP handling. This takes the action ID,
action request data, the license information to operate off of, and an
optional HTTP request (which may be needed by some actions).The action data may be any arbitrary JSON-safe data. Previously, when
the view handled an action, it expected keys and values in the HTTP POST
data to be used as arguments, but now it requires an explicit
action_data
JSON field, which can then be deserialized and passed to
action handlers.The built-in actions (
license-update-check
,process-license-update
,
andupload-license
) now live onBaseLicenseProvider
instead of the
view, givingcall_action()
access to them.
Unit tests pass.
Manually tested the license update flow and some custom actions.
Diff Revision 2
This is not the most recent revision of the diff. The latest diff is revision 4. See what's changed.
Commits
Files
docs/manual/extending/coderef/index.rst |
---|
reviewboard/licensing/actions.py |
---|
reviewboard/licensing/provider.py |
---|
reviewboard/licensing/views.py |
---|
reviewboard/licensing/tests/providers.py |
---|
reviewboard/licensing/tests/test_license_provider.py |
---|
reviewboard/licensing/tests/test_licenses_view.py |
---|
reviewboard/static/rb/js/admin/models/licenseModel.ts |
---|