Show subscription expiry banner 30 days before end
What does this MR do and why?
Self-service renewal in the Customers Portal now opens 30 days before the subscription end date (https://gitlab.com/gitlab-org/customers-gitlab-com/-/work_items/13843). The expiry banner for administrators still appeared only 15 days before the end date. This MR moves it to 30 days on both offerings, which use separate constants:
- GitLab.com:
SubscriptionPresenter::RENEWAL_ALLOWED_PERIOD_DAYS(used bySubscriptionPresenter#notify_admins?for top-level group subscriptions) from15to30. - Self-Managed:
License::ADMIN_NOTIFICATION_DAYS_BEFORE_EXPIRY(used byLicense#notify_admins?for the instance license) from15.daysto30.days.
The banner text contains dates only, so no copy changes. The specs that assert the 15-day boundary are updated to 30 days, and doc/administration/license_file.md now says "Thirty days" with a history entry.
GitLab Dedicated instances use the same License path as Self-Managed, so their administrators also see the banner at 30 days.
Out of scope
doc/subscriptions/manage_subscription.md: updated in !266301.- The trial license notification (1 week), the 14-day grace period and the banner copy: unchanged.
- The "upcoming auto-renewal" email: owned by https://gitlab.com/gitlab-org/customers-gitlab-com/-/work_items/13844.
No feature flag: the change is two constants, and the MRs that introduced them (!77625 (merged) and !78000 (merged)) did not use one.
References
- https://gitlab.com/gitlab-org/gitlab/-/work_items/637249
- https://gitlab.com/gitlab-org/customers-gitlab-com/-/work_items/13843
- !266301 (comment 4117514936)
Screenshots or screen recordings
Captured from feature specs on the same setup as ee/spec/features/subscriptions/expiring_subscription_message_spec.rb, with the subscription or license ending 30 days from today (2026-11-29).
| Before | After | |
|---|---|---|
| Self-Managed, administrator | ![]() |
![]() |
| GitLab.com, group Owner | ![]() |
![]() |
notify_admins? at 31, 30, 20 and 15 days |
![]() |
![]() |
Local results on the branch:
subscription_presenter_spec.rb,license_spec.rb,expiring_subscription_message_spec.rb: 416 examples, 0 failures.expiring_subscription_message_spec.rb(lib),subscribable_banner_helper_spec.rb,_ee_subscribable_banner.html.haml_spec.rb,admin_subscription_alerts_spec.rb: 83 examples, 0 failures.- RuboCop, markdownlint and Vale: no offenses.
How to set up and validate locally
-
Check out this branch in your GDK and open a Rails console from the
gitlabdirectory:bin/rails console -
Build a GitLab.com subscription and a Self-Managed license that end 30 days from today, without saving anything:
subscription = SubscriptionPresenter.new(GitlabSubscription.new(end_date: Date.current + 30.days)) license = License.new license.define_singleton_method(:expires_at) { Date.current + 30.days } license.define_singleton_method(:expired?) { false } license.define_singleton_method(:trial?) { false } [subscription.notify_admins?, license.notify_admins?]Expected:
[true, true]. Onmasterthe same lines return[false, false]. -
Optional: change both
30.daysto31.daysand run the lines again. Expected:[false, false].
Whether the banner renders also depends on the existing auto-renew, future-dated license and future renewal checks in Gitlab::ExpiringSubscriptionMessage#require_notification?, which this MR does not change.
MR acceptance checklist
Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
Resolves https://gitlab.com/gitlab-org/gitlab/-/work_items/637249





