Add support for custom license action handling.

Review Request #14470 — Created June 23, 2025 and updated — Latest diff uploaded

Information

Review Board
release-7.1.x

Reviewers

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's custom_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,
and upload-license) now live on BaseLicenseProvider instead of the
view, giving call_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.

orig
1
2
3
4

Commits

First Last Summary ID Author
Add support for custom license action handling.
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's `custom_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`, and `upload-license`) now live on `BaseLicenseProvider` instead of the view, giving `call_action()` access to them.
4b30f67dd7a699d3848a37165703c9d7c2156bd8 Christian Hammond
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
Loading...