Add Pipelines app to conditionally render in CE
-
Review changes -
-
Download -
Patches
-
Plain diff
What does this MR do and why?
After we finish with #440195 (closed), i.e. after we merge !143633 (merged) and !143637 (merged), we're now able to migrate other tabs. The migration here is simpler because we just need to conditionally render this tab. In other words: This tab will be hooked to an App that is in CE
but will only render in EE
.
This implements Add Pipelines app to conditionally render in CE (#371823 - closed):
- Adds
PipelineUsageApp
to theEE
arrayusageQuotasTabsMetadata
- Adds
#js-pipeline-usage-app
element under#js-usage-quotas-view
only in theEE
haml file - Standardize DOM queries with
querySelector
method andPIPELINES_TAB_METADATA_EL_SELECTOR
constant
Screenshots or screen recordings
The View currently in .com | After ( FF on ) |
---|---|
![]() |
![]() |
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=1
gdk 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:
GitLab Distribution | Expected behavior FF off | Expected behavior FF on |
---|---|---|
GitLab EE Unlicensed | Renders a 404 page |
Renders the pipeline and storage tab |
GitLab EE | Loads the page normally, hiding SaaS UI (e.g. the right hand side card in Namespace overview) | Renders the pipeline and storage tab |
GitLab SaaS | Page loads normally, like it is on master /GitLab.com
|
Renders the pipeline and storage tab |
GitLab CE | Renders a 404 page |
Renders only the storage tab |
Generate mock data
To generate mock data, you can inspire in the script below, that uses a group (id 76
) and 2 projects (ids 21
and 23
):
mock data
# ------- Namespace's data ------------
Ci::Minutes::NamespaceMonthlyUsage.new(namespace_id: 76, date: Date.new(2021, 8, 01), amount_used: 20, shared_runners_duration: 30).save
Ci::Minutes::NamespaceMonthlyUsage.new(namespace_id: 76, date: Date.new(2021, 9, 01), amount_used: 40, shared_runners_duration: 30).save
Ci::Minutes::NamespaceMonthlyUsage.new(namespace_id: 76, date: Date.new(2022, 9, 01), amount_used: 40, shared_runners_duration: 30).save
Ci::Minutes::NamespaceMonthlyUsage.new(namespace_id: 76, date: Date.new(2022, 12, 01), amount_used: 80, shared_runners_duration: 30).save
Ci::Minutes::NamespaceMonthlyUsage.new(namespace_id: 76, date: Date.new(2023, 2, 01), amount_used: 100, shared_runners_duration: 30).save
Ci::Minutes::NamespaceMonthlyUsage.new(namespace_id: 76, date: Date.new(2023, 6, 01), amount_used: 180, shared_runners_duration: 30).save
Ci::Minutes::NamespaceMonthlyUsage.new(namespace_id: 76, date: Date.new(2023, 8, 01), amount_used: 200, shared_runners_duration: 80).save
# ------- Projects' data ------------
Ci::Minutes::ProjectMonthlyUsage.new(project_id: 21, date: Date.new(2021, 8, 01), amount_used: 10, shared_runners_duration: 10).save
Ci::Minutes::ProjectMonthlyUsage.new(project_id: 23, date: Date.new(2021, 8, 01), amount_used: 10, shared_runners_duration: 20).save
Ci::Minutes::ProjectMonthlyUsage.new(project_id: 21, date: Date.new(2021, 9, 01), amount_used: 10, shared_runners_duration: 10).save
Ci::Minutes::ProjectMonthlyUsage.new(project_id: 23, date: Date.new(2021, 9, 01), amount_used: 30, shared_runners_duration: 20).save
Ci::Minutes::ProjectMonthlyUsage.new(project_id: 21, date: Date.new(2022, 9, 01), amount_used: 20, shared_runners_duration: 20).save
Ci::Minutes::ProjectMonthlyUsage.new(project_id: 23, date: Date.new(2022, 9, 01), amount_used: 20, shared_runners_duration: 10).save
Ci::Minutes::ProjectMonthlyUsage.new(project_id: 21, date: Date.new(2022, 12, 01), amount_used: 20, shared_runners_duration: 10).save
Ci::Minutes::ProjectMonthlyUsage.new(project_id: 23, date: Date.new(2022, 12, 01), amount_used: 60, shared_runners_duration: 20).save
Ci::Minutes::ProjectMonthlyUsage.new(project_id: 21, date: Date.new(2023, 2, 01), amount_used: 20, shared_runners_duration: 10).save
Ci::Minutes::ProjectMonthlyUsage.new(project_id: 23, date: Date.new(2023, 2, 01), amount_used: 80, shared_runners_duration: 20).save
Ci::Minutes::ProjectMonthlyUsage.new(project_id: 21, date: Date.new(2023, 6, 01), amount_used: 80, shared_runners_duration: 20).save
Ci::Minutes::ProjectMonthlyUsage.new(project_id: 23, date: Date.new(2023, 6, 01), amount_used: 100, shared_runners_duration: 10).save
Ci::Minutes::ProjectMonthlyUsage.new(project_id: 21, date: Date.new(2023, 8, 01), amount_used: 100, shared_runners_duration: 20).save
Ci::Minutes::ProjectMonthlyUsage.new(project_id: 23, date: Date.new(2023, 8, 01), amount_used: 100, shared_runners_duration: 60).save
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.
Merge request reports
- version 28ec9f0df5
- version 27ec9f0df5
- version 2664ab922c
- version 2564ab922c
- version 2442fcc111
- version 2342fcc111
- version 22238fb00f
- version 21238fb00f
- version 20238fb00f
- version 191d29ce8e
- version 181d29ce8e
- version 1757727df8
- version 1657727df8
- version 154c279eea
- version 144c279eea
- version 137d1885d8
- version 127d1885d8
- version 1194694efa
- version 1094694efa
- version 91fab8964
- version 81fab8964
- version 71fab8964
- version 61fab8964
- version 5ae722be9
- version 4ae722be9
- version 3ae722be9
- version 23d98c53d
- version 13d98c53d
- master (base)
- latest version15bfbdd42 commits,
- version 28ec9f0df55 commits,
- version 27ec9f0df52 commits,
- version 2664ab922c7 commits,
- version 2564ab922c2 commits,
- version 2442fcc1113 commits,
- version 2342fcc1111 commit,
- version 22238fb00f5 commits,
- version 21238fb00f5 commits,
- version 20238fb00f1 commit,
- version 191d29ce8e4 commits,
- version 181d29ce8e1 commit,
- version 1757727df83 commits,
- version 1657727df81 commit,
- version 154c279eea2 commits,
- version 144c279eea1 commit,
- version 137d1885d82 commits,
- version 127d1885d81 commit,
- version 1194694efa6 commits,
- version 1094694efa1 commit,
- version 91fab89645 commits,
- version 81fab89642 commits,
- version 71fab89642 commits,
- version 61fab89641 commit,
- version 5ae722be99 commits,
- version 4ae722be99 commits,
- version 3ae722be91 commit,
- version 23d98c53d9 commits,
- version 13d98c53d1 commit,
- Side-by-side
- Inline