Skip to content

Fix expiring subscription message on subgroups

Vijay Hawoldar requested to merge vij-fix-subgroup-expiration-banner into master

What does this MR do?

As discussed in #331459 (closed), when a user visits a sub-group that is within the hierarchy of a namespace that has an expiring subscription, they currently see the expiring subscription banner even if the root namespace has already purchased a renewal ("future dated renewal").

This MR fixes that by modifying the method being used from namespace#gitlab_subscription to namespace#closest_gitlab_subscription when checking if a subscription exists at all.

This means that we now check for future dated renewals when viewing an applicable sub-group, whereas before it would just assume no future renewal and always render the banner.

Testing

Testing this can be a little tricky unless you have a working CustomersDot setup (installation docs), or already have a group with a subscription with a future renewal.

If/once you have CustomersDot setup:

  • add a subscription to a namespace
  • renew that subscription so that it has a future dated renewal
  • (skip to here if you already have the correct data setup) modify your current GitLab subscription to have an end date in the near future, i.e. considered expiring, and not set to auto-renew:
GitlabSubscription.last.update(end_date: Date.today + 10.days, auto_renew: false)

You'll also need the feature flag relating to this service enabled:

Feature.enable(:gitlab_subscription_future_renewal)
  • navigate to your root namespace and you should not see an expiry message due to the future renewal being in place
  • navigate to your sub group and you should also not see the expiry message (👈🏽 this is what this MR resolves)

Screenshots

Before this MR After this MR
Screenshot_2021-06-21_at_13.51.56 Screenshot_2021-06-21_at_13.48.25

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

Edited by Vijay Hawoldar

Merge request reports