Support automatic license updates and manual license uploads.

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

Information

Review Board
release-7.1.x

Reviewers

The new Licenses page now triggers update checks for licenses on load.
This process involves:

  1. POSTing to the Licenses page with a request for a license check.

    The License Provider will either provide an opaque payload that can
    be used for communicating with an external licensing server, or a
    flag stating that checks aren't supported.

  2. POSTing to the licensing server with the payload.

  3. POSTing back to the Licenses page with the response from the
    licensing server.

    The License Provider will process the result, which may involve
    installing a new license or altering the current one.

This whole process is designed to keep the details of any license
updates internal to the License Provider and licensing server. The
state is communicated in the UI, and the license information reloaded
from new attributes provided in the License Provider responses.

Along with this, licenses can be manually updated, if specified in the
license information. When enabled, this will show a button for uploading
a license, which will pop up a file chooser. After selecting a file, the
contents will be sent to the License Provider for processing via a POST
to the Licenses page.

The view for the Licenses page handles all POST requests. It requires a
CSRF token and some identifying information on the action, action target
(license provider and license), and arguments. It then dispatches to the
License Provider and handles any responses or error results.

Right now, there are specific actions that are supported by this view.
The longer-term plan is to enable arbitrary action support, so License
Providers can trigger custom behavior automatically or in response to
user actions.

All Python and JavaScript unit tests pass.

Tested manually uploading valid and invalid licenses for Power Pack
(ported to the new architecture), verifying the results.

Tested automatic license updates for Power Pack.

Tested all error results and display.

Summary ID
Support automatic license updates and manual license uploads.
The new Licenses page now triggers update checks for licenses on load. This process involves: 1. POSTing to the Licenses page with a request for a license check. The License Provider will either provide an opaque payload that can be used for communicating with an external licensing server, or a flag stating that checks aren't supported. 2. POSTing to the licensing server with the payload. 3. POSTing back to the Licenses page with the response from the licensing server. The License Provider will process the result, which may involve installing a new license or altering the current one. This whole process is designed to keep the details of any license updates internal to the License Provider and licensing server. The state is communicated in the UI, and the license information reloaded from new attributes provided in the License Provider responses. Along with this, licenses can be manually updated, if specified in the license information. When enabled, this will show a button for uploading a license, which will pop up a file chooser. After selecting a file, the contents will be sent to the License Provider for processing via a POST to the Licenses page. The view for the Licenses page handles all POST requests. It requires a CSRF token and some identifying information on the action, action target (license provider and license), and arguments. It then dispatches to the License Provider and handles any responses or error results. Right now, there are specific actions that are supported by this view. The longer-term plan is to enable arbitrary action support, so License Providers can trigger custom behavior automatically or in response to user actions.
4583d3adb531b047e35dcfe3297f08a989258e67
Description From Last Updated

Just a note that I don't see the review request where all of the license action handling functions were added …

maubinmaubin

undefined name 'HttpResponse' Column: 10 Error code: F821

reviewbotreviewbot

Swap these.

daviddavid

Agreement isn't right here. Should either be "There are no ... guarantees" or "There is no ... guarantee"

daviddavid

Should we log something here?

daviddavid

undefined name 'RequestCheckLicenseResult' Column: 10 Error code: F821

reviewbotreviewbot

We can get rid of the not action part of this check since we checked it above.

maubinmaubin

This sentence doesn't make sense.

maubinmaubin

This should say "check_response_data".

maubinmaubin

Can we change the error message here to match the log message here? Otherwise it's a bit redundant given the …

maubinmaubin

I notice this is the only place where we're setting a status in the payload. Should we be doing this …

maubinmaubin

There's no sanity check here? Looks like a copy-pasto.

maubinmaubin

This should be removed.

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

flake8

chipx86
david
  1. 
      
  2. reviewboard/licensing/views.py (Diff revision 2)
     
     
     
    Show all issues

    Swap these.

    1. This LSP plugin to vim helpfully adds imports, but it's any guess where it puts them... Sometimes they end up in the standard lib section.

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

    Agreement isn't right here. Should either be "There are no ... guarantees" or "There is no ... guarantee"

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

    Should we log something here?

    1. Everything that raises this performs detailed logging. The exception message is a simpler version for public consumption, telling people to check logs.

  5. 
      
chipx86
Review request changed
Change Summary:
  • Fixed an import location.
  • Fixed some bad grammar in a docstring.
Commits:
Summary ID
Support automatic license updates and manual license uploads.
The new Licenses page now triggers update checks for licenses on load. This process involves: 1. POSTing to the Licenses page with a request for a license check. The License Provider will either provide an opaque payload that can be used for communicating with an external licensing server, or a flag stating that checks aren't supported. 2. POSTing to the licensing server with the payload. 3. POSTing back to the Licenses page with the response from the licensing server. The License Provider will process the result, which may involve installing a new license or altering the current one. This whole process is designed to keep the details of any license updates internal to the License Provider and licensing server. The state is communicated in the UI, and the license information reloaded from new attributes provided in the License Provider responses. Along with this, licenses can be manually updated, if specified in the license information. When enabled, this will show a button for uploading a license, which will pop up a file chooser. After selecting a file, the contents will be sent to the License Provider for processing via a POST to the Licenses page. The view for the Licenses page handles all POST requests. It requires a CSRF token and some identifying information on the action, action target (license provider and license), and arguments. It then dispatches to the License Provider and handles any responses or error results. Right now, there are specific actions that are supported by this view. The longer-term plan is to enable arbitrary action support, so License Providers can trigger custom behavior automatically or in response to user actions.
8f7211ab72c2f394a66a46e2d0ffbc45fcf24043
Support automatic license updates and manual license uploads.
The new Licenses page now triggers update checks for licenses on load. This process involves: 1. POSTing to the Licenses page with a request for a license check. The License Provider will either provide an opaque payload that can be used for communicating with an external licensing server, or a flag stating that checks aren't supported. 2. POSTing to the licensing server with the payload. 3. POSTing back to the Licenses page with the response from the licensing server. The License Provider will process the result, which may involve installing a new license or altering the current one. This whole process is designed to keep the details of any license updates internal to the License Provider and licensing server. The state is communicated in the UI, and the license information reloaded from new attributes provided in the License Provider responses. Along with this, licenses can be manually updated, if specified in the license information. When enabled, this will show a button for uploading a license, which will pop up a file chooser. After selecting a file, the contents will be sent to the License Provider for processing via a POST to the Licenses page. The view for the Licenses page handles all POST requests. It requires a CSRF token and some identifying information on the action, action target (license provider and license), and arguments. It then dispatches to the License Provider and handles any responses or error results. Right now, there are specific actions that are supported by this view. The longer-term plan is to enable arbitrary action support, so License Providers can trigger custom behavior automatically or in response to user actions.
da39261ee70d6510d7b2861150a83d58e57ec982
Diff:

Revision 3 (+3522 -8)

Show changes

reviewboard/licensing/views.py
reviewboard/licensing/tests/test_licenses_view.py
reviewboard/static/rb/js/admin/models/licenseModel.ts
reviewboard/static/rb/js/admin/models/tests/index.ts
reviewboard/static/rb/js/admin/models/tests/licenseModelTests.ts
reviewboard/static/rb/js/admin/views/licenseView.ts
reviewboard/static/rb/js/admin/views/tests/licenseViewTests.ts
reviewboard/templates/admin/licensing.html

Checks run (1 failed, 1 succeeded)

flake8 failed.
JSHint passed.

flake8

chipx86
Review request changed
Change Summary:

Added a missing type checking import.

Commits:
Summary ID
Support automatic license updates and manual license uploads.
The new Licenses page now triggers update checks for licenses on load. This process involves: 1. POSTing to the Licenses page with a request for a license check. The License Provider will either provide an opaque payload that can be used for communicating with an external licensing server, or a flag stating that checks aren't supported. 2. POSTing to the licensing server with the payload. 3. POSTing back to the Licenses page with the response from the licensing server. The License Provider will process the result, which may involve installing a new license or altering the current one. This whole process is designed to keep the details of any license updates internal to the License Provider and licensing server. The state is communicated in the UI, and the license information reloaded from new attributes provided in the License Provider responses. Along with this, licenses can be manually updated, if specified in the license information. When enabled, this will show a button for uploading a license, which will pop up a file chooser. After selecting a file, the contents will be sent to the License Provider for processing via a POST to the Licenses page. The view for the Licenses page handles all POST requests. It requires a CSRF token and some identifying information on the action, action target (license provider and license), and arguments. It then dispatches to the License Provider and handles any responses or error results. Right now, there are specific actions that are supported by this view. The longer-term plan is to enable arbitrary action support, so License Providers can trigger custom behavior automatically or in response to user actions.
da39261ee70d6510d7b2861150a83d58e57ec982
Support automatic license updates and manual license uploads.
The new Licenses page now triggers update checks for licenses on load. This process involves: 1. POSTing to the Licenses page with a request for a license check. The License Provider will either provide an opaque payload that can be used for communicating with an external licensing server, or a flag stating that checks aren't supported. 2. POSTing to the licensing server with the payload. 3. POSTing back to the Licenses page with the response from the licensing server. The License Provider will process the result, which may involve installing a new license or altering the current one. This whole process is designed to keep the details of any license updates internal to the License Provider and licensing server. The state is communicated in the UI, and the license information reloaded from new attributes provided in the License Provider responses. Along with this, licenses can be manually updated, if specified in the license information. When enabled, this will show a button for uploading a license, which will pop up a file chooser. After selecting a file, the contents will be sent to the License Provider for processing via a POST to the Licenses page. The view for the Licenses page handles all POST requests. It requires a CSRF token and some identifying information on the action, action target (license provider and license), and arguments. It then dispatches to the License Provider and handles any responses or error results. Right now, there are specific actions that are supported by this view. The longer-term plan is to enable arbitrary action support, so License Providers can trigger custom behavior automatically or in response to user actions.
4583d3adb531b047e35dcfe3297f08a989258e67
Diff:

Revision 4 (+3524 -8)

Show changes

reviewboard/licensing/views.py
reviewboard/licensing/tests/test_licenses_view.py
reviewboard/static/rb/js/admin/models/licenseModel.ts
reviewboard/static/rb/js/admin/models/tests/index.ts
reviewboard/static/rb/js/admin/models/tests/licenseModelTests.ts
reviewboard/static/rb/js/admin/views/licenseView.ts
reviewboard/static/rb/js/admin/views/tests/licenseViewTests.ts
reviewboard/templates/admin/licensing.html

Checks run (2 succeeded)

flake8 passed.
JSHint passed.
david
  1. Ship It!
  2. 
      
maubin
  1. 
      
  2. Show all issues

    Just a note that I don't see the review request where all of the license action handling functions were added to BaseLicenseProvider.

  3. reviewboard/licensing/views.py (Diff revision 4)
     
     
    Show all issues

    We can get rid of the not action part of this check since we checked it above.

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

    This sentence doesn't make sense.

  5. reviewboard/licensing/views.py (Diff revision 4)
     
     
    Show all issues

    This should say "check_response_data".

  6. reviewboard/licensing/views.py (Diff revision 4)
     
     
     
     
    Show all issues

    Can we change the error message here to match the log message here? Otherwise it's a bit redundant given the error message below that catches this one.

  7. reviewboard/licensing/views.py (Diff revision 4)
     
     
     
     
     
    Show all issues

    I notice this is the only place where we're setting a status in the payload. Should we be doing this anywhere else?

  8. Show all issues

    There's no sanity check here? Looks like a copy-pasto.

  9. Show all issues

    This should be removed.

  10. 
      
Loading...