Create StorageUsageStatistics in CE
What does this MR do and why?
This is the second of a series of MRs that aim to migrate the Namespace Storage Vue App to CE so that this view is available for all GitLab Editions and Distributions. Related to: Move storage app to CE (#371824 - closed)
Here we're moving/creating StorageUsageStatistics in CE, while we move code that's 100% CE to /app, and create overrides in EE whenever necessary:
- Create
StorageUsageStatisticsin/app-
StorageUsageOverviewCardis used here, so we need to move it to/apptoo.
-
- Add
StorageUsageStatisticsto be rendered usingee_else_cestrategy - Adjusts the tests in
ee/spec/frontend/usage_quotas/storage/ - Some tests that should be migrated to
spec/frontend/usage_quotas/storage/will be done in a separate MR because this MR is already big - Because this is a transitional state, the EE
NamespaceStorageApploads the CENamespaceStorageAppand passes all the data down viaprops, and whenever necessary we emit events up so the logic is handled in the parent app. This will be removed in !139568 (merged)
MR Cadence
| Description | MR |
|---|---|
| Introduce NamespaceStorageApp in core | !138689 (merged) |
| Create StorageUsageStatistics in CE |
|
| Move DependencyProxyUsage to CE | !139248 (merged) |
| Move ContainerRegistryUsage to CE | !139252 (merged) |
| Move Usage Quotas test fixtures to CE | !142067 (merged) |
| Move SearchAndSortBar to CE | !139434 (merged) |
| Move ProjectList to CE | !139449 (merged) |
| Finish moving NamespaceStorageApp to CE | !139568 (merged) |
| Replace placeholder with NamespaceStorageApp | !140209 (closed) |
Previous MRs:
| Description | MR |
|---|---|
Move :read_usage_quotas policy to Core app |
!103021 (merged) |
| Create Usage Quotas route/controller/view in Core | !102906 (merged) |
| Add menu entry on sidebar | !106083 (merged) |
| Create usage quotas Vue app | !107359 (merged) |
Reorganize Backend code for storage tab |
!109806 (merged) |
Screenshots or screen recordings
All the changes here are behind a Feature Flag: usage_quotas_for_all_editions, so there should be no UI or behavior change for now.
How to set up and validate locally
We need to validate this in 4 scenarios:
- GitLab EE Unlicensed: this is probably how your GDK is right now. If you have a license in your GDK, remove it in https://gdk.test:3443/admin/subscription
- GitLab EE: by having a test license in your GDK.
- GitLab SaaS: setup a license like the above and simulate SaaS
-
GitLab CE: by executing
export FOSS_ONLY=1gdk restart- Tanuki gdk website icon (the one in the browser tab) should be blue, then you're in
CE
Now go to any Group Usage Quotas: https://gdk.test:3443/groups/flightjs/-/usage_quotas and check if your local setup matches the expected behavior.
- To enable the FF:
Feature.enable(:usage_quotas_for_all_editions) - To disable the FF:
Feature.disable(:usage_quotas_for_all_editions)
Expected behavior:
- Expected behavior with Feature Flag on: Page loads a placeholder (
storage_app_placeholder) for all the scenarios.
| GitLab Distribution | Expected behavior FF off |
|---|---|
| GitLab EE Unlicensed | Renders a 404 page |
| GitLab EE | Loads the page normally, hiding SaaS UI (e.g. the right hand side card in Namespace overview) |
| GitLab SaaS | Page loads normally, like it is on master/GitLab.com
|
| GitLab CE | Renders a 404 page |
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.