Extend post-trial status widget window to 45 days

What does this MR do and why?

On GitLab.com, the trial status widget now stays in its post-trial state for 45 days after a trial ends. Before, it disappeared after 10 days. The billing page card for post-trial namespaces already uses a 45-day window, so now both disappear at the same time.

  • GitlabSubscriptions::Trials.recently_expired? takes an optional time_frame: argument. The default stays at 10 days.
  • The GitLab.com StatusWidgetPresenter sets its own 45-day window and passes it in.

Dismissal works the same as before. If a user dismisses the widget, it stays hidden. Copy, layout and styling are unchanged.

Deviation from the workplan: the workplan said to change the shared TIME_FRAME_AFTER_EXPIRATION constant to 45 days. That constant also controls the end-of-trial modal (EndOfTrialModalComponent), which also calls recently_expired?. Changing it would have kept the modal showing for 45 days too, which the issue doesn't ask for. So only the widget gets the new window. If the modal should also use 45 days, that's a one-line follow-up.

Out of scope (still 10 days): the self-managed trial widget and the Duo Pro add-on trial widget.

Namespaces whose trial ended 11–44 days ago will see the widget again after deploy, unless they already dismissed it. The issue asks for this behavior.

References

Screenshots or screen recordings

No UI changes. Only how long the widget stays visible changes.

Verification

Validated locally in GDK (SaaS mode, Free group, trial dates set via Rails console). Widget behavior matches the issue, and the end-of-trial modal stays on its 10-day window.

Trial ended master This MR
5 days ago Shows Shows
20 days ago Hidden Shows
44 days ago Hidden Shows
45 days ago Hidden Hidden
  1. Dismissal still persists: dismissed at 20 days, widget stays hidden on reload.
  2. No end-of-trial modal at 20 days, as intended per the workplan deviation in the description.
  3. Specs pass locally: trials_spec.rb and status_widget_presenter_spec.rb, 78 examples, 0 failures.

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.

Edited by Elyse Mallinger

Merge request reports

Loading
Loading