Refactor RootStorageSize date constants
What does this MR do and why?
In order to allow us to manually test date dependant logic within Namespaces::RootStorageSize
, this MR allows us to bypass the date comparisons via a feature flag that we can enable for our test groups.
Refs https://gitlab.com/gitlab-org/gitlab/-/issues/340887#note_937881408
These dates will eventually be set to more logical values during rollout but until then we need to be able to test any feature development we do. This MR will enable us to do that on staging and production environments.
Screenshots or screen recordings
These are strongly recommended to assist reviewers and reduce the time to merge your change.
How to set up and validate locally
Numbered steps to set up and validate the change are strongly suggested.
- Ensure you're GDK instance is running in SaaS mode:
export GITLAB_SIMULATE_SAAS=1
- Create a new root Group then look it up in a Rails console:
group = Group.last
- Enable the prerequisite feature flag:
Feature.enable(:enforce_storage_limit_for_free, group)
- Confirm existing behaviour:
rss = Namespace::RootStorageSize.new(group) rss.enforce_limit? => false
- Enable the new feature flag
Feature.enable(:namespace_storage_limit_bypass_date_check, group)
- Confirm the new behaviour:
rss.enforce_limit? => true
- Create another Group (or use an existing one) and confirm the method still returns
false
for that group:other_group = Group.find(x) Feature.enable(:enforce_storage_limit_for_free, other_group) rss = Namespace::RootStorageSize.new(group) rss.enforce_limit? => false
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.