Rework some core licensing stubs and prepare for new license actions.
Review Request #14401 — Created April 21, 2025 and updated
License
has been updated to provide consistent expiration-related
information, factoring in hard expiration dates, grace periods, and
"expires soon" logic.
LicenseStatus
constants have been renamed to go with
licensed/unlicensed terms and expired-based terms.There are new classes, errors, and stubs for license update checks and
for license actions (which will include things like manually uploading a
license).License check updates will be driven in an upcoming change. The process
involves asking the License Provider for a license check payload,
sending that payload to an outside server, then passing the result back
to the License Provider for processing.Type hints have been updated to utilize
|
instead ofUnion
.Upcoming changes will begin to flesh out more of this, and add UI around
license displays.
Unit tests pass.
Tested this along with in-progress changes, verifying all these new
capabilities being stubbed out in this change.
Summary | ID |
---|---|
9c7405e1255632c833a2a031655137938a0dfc64 |
Description | From | Last Updated |
---|---|---|
'datetime.timedelta' imported but unused Column: 1 Error code: F401 |
![]() |
|
'django.utils.html.format_html' imported but unused Column: 1 Error code: F401 |
![]() |
|
'reviewboard.licensing.errors.LicenseActionError' imported but unused Column: 1 Error code: F401 |
![]() |
|
'reviewboard.licensing.license.LicenseStatus' imported but unused Column: 1 Error code: F401 |
![]() |
|
redefinition of unused 'datetime' from line 9 Column: 5 Error code: F811 |
![]() |
|
'datetime.datetime' imported but unused Column: 5 Error code: F401 |
![]() |
|
'djblets.util.typing.SerializableJSONDict' imported but unused Column: 5 Error code: F401 |
![]() |
|
'djblets.util.typing.SerializableJSONList' imported but unused Column: 5 Error code: F401 |
![]() |
|
Mind changing this to use | syntax? |
|
|
Mind changing this to use | syntax? |
|
|
Should we make this (and get_expires_soon_days_threshold) properties? |
|
|
Can we add a TODO comment to switch to StrEnum when we're 3.11+? |
|
|
This needs a docstring. |
|
|
'djblets.util.typing.SerializableJSONValue' imported but unused Column: 5 Error code: F401 |
![]() |
|
'reviewboard.licensing.license_checks.RRequestCheckLicenseResult' imported but unused Column: 5 Error code: F401 |
![]() |
|
redefinition of unused 'RequestCheckLicenseResult' from line 14 Column: 5 Error code: F811 |
![]() |
|
Typo: licene |
![]() |
- Change Summary:
-
Removed unused imports.
- Commits:
-
Summary ID 11705549fc4dadf6a836bc38c1d471608f2d92ca f0298a734d28ce2998231606c8402486237a3e59 - Diff:
-
Revision 2 (+820 -72)
Checks run (2 succeeded)
- Change Summary:
-
- Altered the license check requests to return a new payload and to centralize functions.
get_license_actions()
no longer returns any default actions.- Switched more types to
|
union syntax. - Added a missing docstring and a TODO.
- Commits:
-
Summary ID f0298a734d28ce2998231606c8402486237a3e59 327bb61425fb92a0c9172c058dc0fe82d3059cf8 - Diff:
-
Revision 3 (+870 -114)
- Change Summary:
-
Removed unused imports and fixed a typo in a typing import.
- Commits:
-
Summary ID 327bb61425fb92a0c9172c058dc0fe82d3059cf8 8bc4dbbf8a71fc98e7ba0aa66266e9c6ecb5fd2f - Diff:
-
Revision 4 (+866 -116)
- Change Summary:
-
Removed an extra import my editor helpfully added...
- Commits:
-
Summary ID 8bc4dbbf8a71fc98e7ba0aa66266e9c6ecb5fd2f 9c7405e1255632c833a2a031655137938a0dfc64 - Diff:
-
Revision 5 (+864 -116)