Fix a bug when checking future renewals for a subgroup
What does this MR do?
The CheckFutureRenewalService
class is used to determine if a customer's expiring subscription has already been renewed on our subscription purchasing application, CustomersDot.
When enabling the gitlab_subscription_future_renewal
feature flag, it highlighted an oversight in the class whereby it could be called with a sub-group namespace, which is a problem because the class calls namespace.gitlab_subscription
, but a GitlabSubscription
can only be associated with a root namespace.
This MR addresses the problem by doing two things:
- ensuring we use the
root_ancestor
of the given namespace - returning early if that root namespace doesn't have any gitlab subscription associated
Point 2 shouldn't be needed, or ever happen, because you cannot have an expiring subscription without a subscription
Refs #329985 (closed)
Screenshots (strongly suggested)
Does this MR meet the acceptance criteria?
Conformity
-
📋 Does this MR need a changelog?-
I have included a changelog entry. -
I have not included a changelog entry because the service is behind a disabled feature flag.
-
-
Documentation (if required) -
Code review guidelines -
Merge request performance guidelines -
Style guides -
Database guides -
Separation of EE specific content
Availability and Testing
-
Review and add/update tests for this feature/bug. Consider all test levels. See the Test Planning Process. -
Tested in all supported browsers -
Informed Infrastructure department of a default or new setting change, if applicable per definition of done
Security
If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:
-
Label as security and @ mention @gitlab-com/gl-security/appsec
-
The MR includes necessary changes to maintain consistency between UI, API, email, or other methods -
Security reports checked/validated by a reviewer from the AppSec team