Add an admin page for viewing and managing licenses.

Review Request #14404 — Created April 28, 2025 and updated

Information

Review Board
release-7.1.x

Reviewers

This adds a new dedicated Licenses page in the Admin UI for seeing all
current registered licenses across License Providers. These indicate the
state of the licenses, expiration information, provide license
management, actions, and custom line items.

Each license is represented by a License model and LicenseView view,
backed by state provided by the License Provider. Custom models, views,
and data can be provided as needed.

Some basic infrastructure is set up for custom actions and license
checks. To ease review, those capabilities will be introduced in a
follow-up change.

Python and JavaScript unit tests passed.

Tested this with some custom License Providers registered in extensions
as tests, and with Power Pack ported over to License Providers. Verified
that all the state and status updates introduced in this change function
as expected.

Summary ID
Add an admin page for viewing and managing licenses.
This adds a new dedicated Licenses page in the Admin UI for seeing all current registered licenses across License Providers. These indicate the state of the licenses, expiration information, provide license management, actions, and custom line items. Each license is represented by a `License` model and `LicenseView` view, backed by state provided by the License Provider. Custom models, views, and data can be provided as needed. Some basic infrastructure is set up for custom actions and license checks. To ease review, those capabilities will be introduced in a follow-up change.
94a6067c0c98c25dd29cdc1e12649c75ab56826b

Description From Last Updated

'json' imported but unused Column: 1 Error code: F401

reviewbotreviewbot

'uuid.uuid4' imported but unused Column: 1 Error code: F401

reviewbotreviewbot

'reviewboard.licensing.errors.LicenseActionError' imported but unused Column: 1 Error code: F401

reviewbotreviewbot

'reviewboard.licensing.license_checks.ProcessCheckLicenseResult' imported but unused Column: 1 Error code: F401

reviewbotreviewbot

'reviewboard.licensing.license_checks.ProcessCheckLicenseResultStatus' imported but unused Column: 1 Error code: F401

reviewbotreviewbot

'djblets.util.typing.JSONValue' imported but unused Column: 5 Error code: F401

reviewbotreviewbot

'djblets.util.typing.SerializableJSONValue' imported but unused Column: 5 Error code: F401

reviewbotreviewbot

Why are we doing it this way instead of include('reviewboard.licensing.urls')? Seems like we should stay consistent.

daviddavid

Should we define a TypedDict for this return type so we get warnings about if anything we're assigning isn't the …

daviddavid

Switch these two import lines

daviddavid

These should come from collections.abc, not typing

daviddavid

Can we either mark this as internal (prefix with _) or add docstrings to it? Future docstring linting will complain …

daviddavid

Same here.

daviddavid

And here.

daviddavid

Can we add doc comments on these?

daviddavid

Please add a docstring.

daviddavid

Please add a docstring.

daviddavid

Please add a docstring.

daviddavid

Please add a docstring.

daviddavid

tuple -> dict

daviddavid

This should fit on one line.

daviddavid
Checks run (1 failed, 1 succeeded)
flake8 failed.
JSHint passed.

flake8

chipx86
Review request changed
Change Summary:

Removed unused imports intended for the follow-up change.

Commits:
Summary ID
Add an admin page for viewing and managing licenses.
This adds a new dedicated Licenses page in the Admin UI for seeing all current registered licenses across License Providers. These indicate the state of the licenses, expiration information, provide license management, actions, and custom line items. Each license is represented by a `License` model and `LicenseView` view, backed by state provided by the License Provider. Custom models, views, and data can be provided as needed. Some basic infrastructure is set up for custom actions and license checks. To ease review, those capabilities will be introduced in a follow-up change.
dbc60a990cb29fad5e214c98abaa8b6977c7c0bf
Add an admin page for viewing and managing licenses.
This adds a new dedicated Licenses page in the Admin UI for seeing all current registered licenses across License Providers. These indicate the state of the licenses, expiration information, provide license management, actions, and custom line items. Each license is represented by a `License` model and `LicenseView` view, backed by state provided by the License Provider. Custom models, views, and data can be provided as needed. Some basic infrastructure is set up for custom actions and license checks. To ease review, those capabilities will be introduced in a follow-up change.
94a6067c0c98c25dd29cdc1e12649c75ab56826b

Checks run (2 succeeded)

flake8 passed.
JSHint passed.
david
  1. 
      
  2. reviewboard/admin/urls.py (Diff revision 2)
     
     
    Show all issues

    Why are we doing it this way instead of include('reviewboard.licensing.urls')? Seems like we should stay consistent.

  3. reviewboard/licensing/provider.py (Diff revision 2)
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
    Show all issues

    Should we define a TypedDict for this return type so we get warnings about if anything we're assigning isn't the right type?

  4. Show all issues

    Switch these two import lines

  5. Show all issues

    These should come from collections.abc, not typing

  6. Show all issues

    Can we either mark this as internal (prefix with _) or add docstrings to it? Future docstring linting will complain otherwise.

  7. Show all issues

    Same here.

  8. Show all issues

    And here.

  9. Show all issues

    Can we add doc comments on these?

  10. Show all issues

    Please add a docstring.

  11. Show all issues

    Please add a docstring.

  12. Show all issues

    Please add a docstring.

  13. Show all issues

    Please add a docstring.

  14. reviewboard/licensing/views.py (Diff revision 2)
     
     
    Show all issues

    tuple -> dict

  15. Show all issues

    This should fit on one line.

  16.