Skip to content

Introduce manual renewal banner logic

Corinna Gogolok requested to merge 346259_manual_renewal_banner into master

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.

  1. Create both licenses in your CustomersDot instance.
  2. Start a rails console.
  3. Enable the feature flag: Feature.enable(:automated_email_provision)
  4. For each license build a new License object and pass in the license key: license = License.new(data: <LICENSE_KEY>).
  5. 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.

Edited by Corinna Gogolok

Merge request reports