Notify admins 15 days prior to license expiration
What does this MR do and why?
Related to #337250 (closed)
As stated in #337250 (closed), the subscription expiration banner was being shown to SM Admins up to a month before the license expiration. However, SM customers aren't able to renew their subscriptions until 15 days prior to expiration (or later). This led to some understandable confusion from customers where the warning didn't align with the call to action.
The agreed solution was to align the admin notification timing with the renewal ability (15 days prior). It was found that the admin and user notification windows is actually set by 2 attributes in the Gitlab::License
object. IOW, the timing was being driven by the license key and not logic in the GitLab codebase. We decided to change this so that GitLab has this notification logic and we will remove the attributes from the Gitlab::License
class as it was unnecessary.
In this MR, the notification method, notify_admins?
, in Gitlab::License
is overridden so that admins are notified only 15 days prior to license expiration. Similarly, the notification method, notify_users?
, is overridden for consistency. This will allow us to remove these methods from Gitlab::License
at some point in the future.
Screenshots or screen recordings
Example of expiring license admin notification
Example of expired license admin notification
How to set up and validate locally
I was able to test this by uploading license keys under various conditions. Here's the procedure I followed:
- Generate a license key manually using CustomersDot Admin, http://localhost:5000/admin/license/new_license
- Upload the license key in the SM instance, http://localhost:3000/admin/license/new
- Visit any page to see the notification. You can visit as an admin or a regular user to see various scenarios.
Examples:
- Upload a license that expires in 2 days; see that the notification banner shows for Admins but not for Users.
- Upload a license that expires in 16 days; see that no notification banner shows for Admins or Users.
- Upload a license that expired 2 days ago; see that the expired notification banner shows for Admins but not Users.
- Upload a license that expired more than 2 weeks ago; see that the expired notification banner shows for both Admins and Users.
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Merge request reports
Activity
changed milestone to %14.7
added UI text auto updated backend customer devopsfulfillment groupprovision missed:14.3 missed:14.6 sectionfulfillment typebug workflowin dev + 1 deleted label
assigned to @tyleramos
1 Message This merge request adds or changes documentation files. A review from the Technical Writing team before you merge is recommended. Reviews can happen after you merge. Documentation review
The following files require a review from a technical writer:
doc/user/admin_area/license.md
The review does not need to block merging this merge request. See the:
-
Metadata for the
*.md
files that you've changed. The first few lines of each*.md
file identify the stage and group most closely associated with your docs change. - The Technical Writer assigned for that stage and group.
- Documentation workflows for information on when to assign a merge request for review.
Reviewer roulette
Changes that require review have been detected!
Please refer to the table below for assigning reviewers and maintainers suggested by Danger in the specified category:
Category Reviewer Maintainer backend Albert Salim ( @alberts-gitlab
) (UTC+8, 13 hours ahead of@tyleramos
)Andy Soiron ( @Andysoiron
) (UTC+1, 6 hours ahead of@tyleramos
)test Quality for spec/features/*
Dan Davison ( @ddavison
) (UTC-5, same timezone as@tyleramos
)Maintainer review is optional for test Quality for spec/features/*
To spread load more evenly across eligible reviewers, Danger has picked a candidate for each review slot, based on their timezone. Feel free to override these selections if you think someone else would be better-suited or use the GitLab Review Workload Dashboard to find other available reviewers.
To read more on how to use the reviewer roulette, please take a look at the Engineering workflow and code review guidelines. Please consider assigning a reviewer or maintainer who is a domain expert in the area of the merge request.
Once you've decided who will review this merge request, assign them as a reviewer! Danger does not automatically notify them for you.
If needed, you can retry the
danger-review
job that generated this comment.Generated by
Dangeradded 1 commit
- 35a5583d - Notify admins 15 days prior to license expiration
marked the checklist item I have evaluated the MR acceptance checklist for this MR. as completed
added documentation label
- Resolved by Tyler Amos
@sselhorn Would you mind reviewing the tiny documentation change with this MR? Thanks in advance!
requested review from @sselhorn
@shreyasagarwal Would you mind reviewing this MR when you have a chance? Since this was originally a ~"group::purchase" issue, I figured it would be good to get at least one review from the group. Thanks in advance!
requested review from @shreyasagarwal
added workflowin review label and removed workflowin dev label
mentioned in issue #337250 (closed)
added Technical Writing docsfeature labels
removed docsfeature label
added docsimprovement label
@sselhorn
, thanks for approving this merge request.This is the first time the merge request is approved. To ensure full test coverage, a new pipeline has been started.
For more info, please refer to the following links:
added 259 commits
-
35a5583d...04868ac7 - 258 commits from branch
master
- 45262a12 - Notify admins 15 days prior to license expiration
-
35a5583d...04868ac7 - 258 commits from branch
- Resolved by Tyler Amos
- Resolved by Tyler Amos
- Resolved by Tyler Amos
- Resolved by Shreyas Agarwal
Thank you @tyleramos for the ping. The changes looks good to me and apart from few little things it is good to go from my end.
added 1 commit
- 6fc41ce3 - Notify admins 15 days prior to license expiration
@tyleramos The changes LGTM. Approved from my end.
removed review request for @shreyasagarwal
- Resolved by Sincheol (David) Kim
@dskim_gitlab Do you mind running the maintainer review for this MR? Thanks in advance!
requested review from @dskim_gitlab and removed review request for @sselhorn
removed review request for @dskim_gitlab
- Resolved by Tyler Amos
- Resolved by Tyler Amos
- Resolved by Sincheol (David) Kim
added 1 commit
- 9c1ff2d4 - Notify admins 15 days prior to license expiration
requested review from @dskim_gitlab
removed review request for @dskim_gitlab
added 1 commit
- b07a83f7 - Notify admins 15 days prior to license expiration
- Resolved by Sincheol (David) Kim
@dskim_gitlab I've pushed a few adjustments based on your recent round of feedback. Let me know what you think.
requested review from @dskim_gitlab
mentioned in commit 737ecf8b
- Resolved by Tyler Amos
mentioned in issue #349961 (closed)
mentioned in commit 8c9ceb55
mentioned in merge request !77966 (merged)
mentioned in merge request !78000 (merged)
added workflowstaging-canary label and removed workflowin review label
I opened !78000 (merged) as my next attempt at getting this fix merged. It includes a fix for the problem found about when a instance's license has no expiration.
added workflowstaging label and removed workflowstaging-canary label
added workflowcanary label and removed workflowstaging label
added workflowproduction label and removed workflowcanary label
added releasedcandidate label
added releasedpublished label and removed releasedcandidate label
mentioned in merge request kubitus-project/kubitus-installer!562 (merged)
mentioned in merge request !80121 (merged)