Amend out-of-storage banner text
What does this MR do and why?
Relates to: #327193 (closed)
Adds a link to the docs on the out-of-storage banner text
Link: https://docs.gitlab.com/ee/user/usage_quotas.html
Screenshots or screen recordings
Alert 1: message starting with "Please purchase additional storage..."
Before | After |
---|---|
Alert 2: message starting with "You have consumed all of your additional storage..."
Before | After |
---|---|
Alert 3: message starting with "If you reach 100% storage capacity..."
Before | After |
---|---|
Alert 4: message starting with "my_group is now read-only..."
Before | After |
---|---|
How to set up and validate locally
I found 4 variations of this alert that are relevant to this change.
It was a bit tricky to set the data in order to show these alerts. Working backwards in the code execution I was able to find what I need to alter in order to show them. These were the steps I took:
rails c
Feature.disable(:namespace_storage_limit)
Gitlab::CurrentSettings.update!(automatic_purchased_storage_allocation: true)
Gitlab::CurrentSettings.update!(repository_size_limit: 10)
gdk restart
- Have a group you own, go to the Group's page: http://127.0.0.1:3000/my_group
This was the baseline for all the other alerts. After this setup you should be able to see the first alert variation: "Please purchase additional storage..."
To see the second alert variation, starting with "You have consumed all of your additional storage...", do these extra steps
- On the Group's page, copy the Group ID, in my case
385
- Go to a project page: http://127.0.0.1:3000/my_group/my_project
- Copy the Project ID, in my case
32
n = Group.find(385)
p = Project.find(32)
- Add some storage data at Group level
n.root_storage_statistics&.destroy! s = Namespace::RootStorageStatistics.new( namespace: n, build_artifacts_size: 400000, wiki_size: 300000, repository_size: 3900000, packages_size: 3800000, lfs_objects_size: 4800000 ) s.storage_size = s.repository_size + s.lfs_objects_size + s.wiki_size + s.build_artifacts_size + s.packages_size s.save!
- Add some storage data at Project level
p.statistics.update( repository_size: 3900000000, lfs_objects_size: 4800000000, build_artifacts_size: 400000000, wiki_size: 300000000, packages_size: 3800000000 )
n.update(additional_purchased_storage_size: 15)
gdk restart
- Go to the Group's page: http://127.0.0.1:3000/my_group
Now the alert message body should start with "You have consumed all of your additional storage..."
The third alert variation will show if you enable the Feature Flag and do these extra steps:
Feature.enable(:namespace_storage_limit)
n.update(additional_purchased_storage_size: 15000)
- Add more storage data at Group Level
n.root_storage_statistics&.destroy! s = Namespace::RootStorageStatistics.new( namespace: n, build_artifacts_size: 400000000, wiki_size: 300000000, repository_size: 3900000000, packages_size: 3800000000, lfs_objects_size: 4800000000 ) s.storage_size = s.repository_size + s.lfs_objects_size + s.wiki_size + s.build_artifacts_size + s.packages_size s.save!
Now the alert message body should start with "If you reach 100% storage capacity..."
To see the fourth alert variation we need to exceed storage size limit:
n.update(additional_purchased_storage_size: 12000)
gdk restart
- If you have a license on your local setup, you might need to bypass it by adding a
return true
after line 41 in root_storage_size.rb
Now you should see a message starting with "my_group is now read-only...."
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.