Allow license providers to update/remove multiple licenses at once.

Review Request #14460 — Created June 18, 2025 and submitted — Latest diff uploaded

Information

Review Board
release-7.1.x

Reviewers

The license update support is no longer limited to updating just the
information for the license being checked. Now, a license provider can
update the license information for multiple licenses at once when
returning a license payload, and can also remove licenses.

This enables a license provider to represent a main license with
multiple sub-licenses and then update or remove sub-licenses based on
the new license data, without having to do processing per-license.

To do this, the license provider's check license response now sets a
license_infos dictionary mapping license IDs to either payload data
(to add or update) or null (to remove). This is then handled on the
JavaScript side by updating all licenses from that provider that match
the ID.

Each license provider's set of licenses are managed client-side in a new
LicenseCollection, which performs those batch updates and also takes
care of performing a group of license update checks. These are now
checked sequentially instead of all at once.

Unit tests pass.

Tested this with the license support in Power Pack.

Diff Revision 2

This is not the most recent revision of the diff. The latest diff is revision 3. See what's changed.

orig
1
2
3

Commits

First Last Summary ID Author
Allow license providers to update/remove multiple licenses at once.
The license update support is no longer limited to updating just the information for the license being checked. Now, a license provider can update the license information for multiple licenses at once when returning a license payload, and can also remove licenses. This enables a license provider to represent a main license with multiple sub-licenses and then update or remove sub-licenses based on the new license data, without having to do processing per-license. To do this, the license provider's check license response now sets a `license_infos` dictionary mapping license IDs to either payload data (to add or update) or `null` (to remove). This is then handled on the JavaScript side by updating all licenses from that provider that match the ID. Each license provider's set of licenses are managed client-side in a new `LicenseCollection`, which performs those batch updates and also takes care of performing a group of license update checks. These are now checked sequentially instead of all at once.
5b4da72a37b80f3a78a46e3773f3797bcb463f30 Christian Hammond
reviewboard/licensing/license_checks.py
reviewboard/licensing/views.py
reviewboard/licensing/tests/test_licenses_view.py
reviewboard/static/rb/js/admin/index.ts
reviewboard/static/rb/js/admin/collections/licenseCollection.ts
reviewboard/static/rb/js/admin/collections/tests/index.ts
reviewboard/static/rb/js/admin/collections/tests/licenseCollectionTests.ts
reviewboard/static/rb/js/admin/models/licenseModel.ts
reviewboard/static/rb/js/admin/models/tests/licenseModelTests.ts
reviewboard/static/rb/js/admin/views/licenseView.ts
reviewboard/static/rb/js/tests/index.ts
reviewboard/templates/admin/licensing.html
Loading...