Render manual quarterly co-term banner
What does this MR do and why?
Part of https://gitlab.com/gitlab-org/gitlab/-/issues/346260
This change will use the logic that was introduced in !76255 (merged) to render the manual quarterly co-term banner.
The banner will only be displayed for customers with a self-managed cloud license but have restricted internet access that prevents their instance to do the quarterly co-term automatically and have to take manual action. The condition to determine an offline customer 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.
The banner will show up for upcoming quarterly co-terms within the next 14 days (notification window) or for overdue quarterly co-terms.
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.
Screenshots or screen recordings
How to set up and validate locally
- Start a rails console.
- Enable the feature flag:
Feature.enable(:automated_email_provision)
. - Make sure that
Gitlab::CurrentSettings.check_namespace_plan?
returnsfalse
or you won't be able to create a new recordGitlabSubscriptions::UpcomingReconciliation
record later. - If it returns
true
, doApplicationSetting.first.update(check_namespace_plan: false)
. - Check if you already have a
GitlabSubscriptions::UpcomingReconciliation
record:reconciliation = GitlabSubscriptions::UpcomingReconciliation.next
. - If one exists, update it to display the banner:
date = 14.days.from_now; reconciliation.update(next_reconciliation_date: date, display_alert_from: date - 7.days)
- If none exists, create one:
date = 14.days.from_now; reconciliation = GitlabSubscriptions::UpcomingReconciliation.create!(next_reconciliation_date: date, display_alert_from: date - 7.days)
- Visit your GitLab instance in the browser.
- Log into the admin area and make sure you are on
/admin
. - See the banner in the yellow version of the banner on
/admin
and on/admin/license
. - Go back to your rails console.
- Update the reconciliation record from above to be overdue:
date = Date.yesterday; reconciliation.update(next_reconciliation_date: date, display_alert_from: date - 7.days)
- Go back to your browser.
- See the banner in the red version of the banner on
/admin
and on/admin/license
.
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.