Show storage pre-enforcement banner only to impacted namespaces
What does this MR do and why?
Relates to https://gitlab.com/gitlab-org/gitlab/-/issues/367531
This show's the banner only to affected namespaces, i.e. the namespace has 5+ GB of storage
Screenshots or screen recordings
There are no UI changes, so putting just the banner for reference
(Obs: some images show usage below 5GB because I didn't mock the data in my GDK in all scenarios)
User accessing their own namespace | |
---|---|
User as a project maintainer on other user's namespace | |
Subgroup | |
Project | |
Root Group |
How to set up and validate locally
- Create a new Group, take note of the Group ID (e.g.
123
) - Make sure the banner does NOT show on this group's page
- Add namespace storage that reaches the limit
n = Group.find(166) n.root_storage_statistics&.destroy! s = Namespace::RootStorageStatistics.new( namespace: n, build_artifacts_size: 0, wiki_size: 0, repository_size: 0, packages_size: 0, lfs_objects_size: 5.gigabytes ) s.storage_size = s.repository_size + s.lfs_objects_size + s.wiki_size + s.build_artifacts_size + s.packages_size s.save!
- Make sure the banner appears
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.
Edited by Sheldon Led