Skip to content

Fix multi project pipeline viz being disabled for wrong users

What does this MR do and why?

Most users were seeing the expand button on the linked pipelines graph as disabled because we were checking for users permissions instead of groups. This commit now uses the proper permissions check and update the tests accordingly.

Screenshots or screen recordings

Before After
Screen_Recording_2022-03-07_at_9.27.08_AM Screen_Recording_2022-03-07_at_9.25.59_AM

How to set up and validate locally

  1. Make sure that you have local runner setup.
  2. Create a multi-project pipeline => To do so, here is a the shortest way I know of:
  3. Create a new project and create a CI config file (.gitlab-ci.yml).
  4. 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"
  1. Create another new project
  2. Create a CI config file (.gitlab-ci.yml).
  3. 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:

  1. Login as a free user
  2. Go to CI/CD => Pipelines
  3. Click on Run pipeline
  4. Go in the pipeline page of this newly triggered pipeline
  5. Let the pipeline finish
  6. Hover on the downstream card arrow button on the right
  7. Notice the tooltip that explains that this feature is disabled

To verify that it still works for paying users

  1. Login as a paid user
  2. Go to CI/CD => Pipelines
  3. Click on Run pipeline
  4. Go in the pipeline page of this newly triggered pipeline
  5. Let the pipeline finish
  6. Hover on the downstream card arrow button on the right
  7. Click on the arrow
  8. 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.

Edited by Frédéric Caplette

Merge request reports

Loading