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 by SubscriptionPresenter#notify_admins? for top-level group subscriptions) from 15 to 30.
  • Self-Managed: License::ADMIN_NOTIFICATION_DAYS_BEFORE_EXPIRY (used by License#notify_admins? for the instance license) from 15.days to 30.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

No feature flag: the change is two constants, and the MRs that introduced them (!77625 (merged) and !78000 (merged)) did not use one.

References

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 shot_before_sm shot_after_sm
GitLab.com, group Owner shot_before_saas shot_after_saas
notify_admins? at 31, 30, 20 and 15 days gl_before gl_after

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

  1. Check out this branch in your GDK and open a Rails console from the gitlab directory:

    bin/rails console
  2. 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]. On master the same lines return [false, false].

  3. Optional: change both 30.days to 31.days and 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

Edited by Sid Verma

Merge request reports

Loading
Loading