Introduce manual renewal banner logic
What does this MR do and why?
Part of https://gitlab.com/gitlab-org/gitlab/-/issues/346259
This change will add the backend logic for the manual renewal banner that will be displayed to offline customers that have restricted internet access. The logic is behind a feature flag.
The banner will only be displayed for customers with a self-managed cloud license but have restricted internet access that prevents them from renewing their license automatically and have to take manual action. This condition is still under discussion though and therefore not added yet. Since the feature is behind a feature flag, the missing condition can be added at a later time.
Furthermore, there should be no future license in the system. The current license is either expired or expiring within the next 14 days (notification window) in order to show up.
To see the banner, the customer has to be logged in as an admin and can see the banner on the admin dashboard (/admin
) and the subscription page (/admin/subscription
).
Please see the issue for more information.
How to set up and validate locally
The code can be tested in the rails console. Different licenses have to be created in your local CustomersDot to test it. The most important scenarios are for an expired license and one that will expire in less than 14 days to see the two different versions of the banner message.
- Create both licenses in your CustomersDot instance.
- Start a rails console.
- Enable the feature flag:
Feature.enable(:automated_email_provision)
- For each license build a new
License
object and pass in the license key:license = License.new(data: <LICENSE_KEY>)
. - Then call the class
Gitlab::ManualRenewalBannerMessage.new(license: license).message
and see the appropriate messages.
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.