Skip to content

Update circular dependencies message

What does this MR do and why?

Update the error message when a cycle is found in the pipeline dependencies. The original error message was a raw output from TSort's Cyclic exception message, this MR updates the error message to increase better show what the dependency cycle is (especially for less experienced users). This change also affects self-dependencies which raise the same exception.

Screenshots or screen recordings

I have collected screenshots for the updated text in all places I believe the text to be shown

Circular dependencies

Old:

image

New:

image

image

image

Self dependency

Old:

image

New:

image

image

image

How to set up and validate locally

Circular Dependency

  1. Create a new repository
  2. Create a gitlab pipeline using the following script
image: maven:latest

stages:
    - build
    - test

job_A:
  stage: test
  tags:
    - docker 

  script: 
    - "echo jobA"
  dependencies:
    - job_C
  needs:
    - job: job_C
      artifacts: false

job_B:
  stage: test
  tags:
    - docker 

  script: 
    - "echo jobB"
  dependencies:
    - job_A
  needs:
    - job: job_A
      artifacts: false

job_C:
  stage: test
  tags:
    - docker 

  script: 
    - "echo jobC"
  dependencies:
    - job_B
  needs:
    - job: job_B
      artifacts: false
  1. Go to pipeline editor and check on the pipeline
  2. The error should be displayed

Self dependency

  1. Replace the .gitlab-ci.yml with the following YML
image: maven:latest

stages:
    - test

job_A:
  stage: test
  tags:
    - docker 

  script:
    - "echo jobA"
  dependencies:
    - job_A
  needs:
    - job: job_A
      artifacts: false
  1. Wait for the pipeline to be validated, the new error message should be shown

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 Joshua Hunt

Merge request reports