Disable expanding Multi-project pipelines in graph for free users
What does this MR do and why?
The ability to expand multi-project pipelines should be disabled for free tier users. It seems like this has been the case for quite a long time, but the documentation (and our expectations as a company) is that this feature is premium.
To fix this, we disable the button of the multi-project card for free users (any paid tier has access to it) and show a tooltip that explains why and what to do to get this feature. This MR also introduces a shared component for the tier badge (Free, Premium and Ultimate)
Screenshots or screen recordings
Free
Before | After |
---|---|
Screen_Recording_2022-02-16_at_9.42.22_AM | multi_project_free_after |
Premium
Before | After |
---|---|
Screen_Recording_2022-02-16_at_9.42.22_AM | multi_project_after_premium |
How to set up and validate locally
- Make sure that you have local runner setup.
- Create a multi-project pipeline => To do so, here is a the shortest way I know of:
- Create a new project and create a CI config file (
.gitlab-ci.yml
). - Inside that file, add the following:
stages:
- build
- test
- deploy
hi:
stage: "test"
script: "echo I am from the main project"
trigger_other_project:
stage: deploy
trigger:
include:
- project: "'root/my-other-project" # root is my namespace, then what's after the /, replace with your project name project
file: ".gitlab-ci.yml"
- Create another new project
- Create a CI config file (
.gitlab-ci.yml
). - Inside the file, add the following:
stages:
- build
- test
- deploy
build_job:
script: echo build
stage: build
test_job:
script: echo test
stage: test
deploy_job:
script: echo deploy
stage: deploy
Now whenever you run the pipeline of PROJECT A
, the main pipeline of project will also be triggered.
To verify as a free user:
- Login as a free user
- Go to
CI/CD => Pipelines
- Click on
Run pipeline
- Go in the pipeline page of this newly triggered pipeline
- Let the pipeline finish
- Hover on the downstream card arrow button on the right
- Notice the tooltip that explains that this feature is disabled
To verify that it still works for paying users
- Login as a paid user
- Go to
CI/CD => Pipelines
- Click on
Run pipeline
- Go in the pipeline page of this newly triggered pipeline
- Let the pipeline finish
- Hover on the downstream card arrow button on the right
- Click on the arrow
- Notice that the pipeline is expanded.
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.
Related to #348303 (closed)