Skip to content

Update error message for DAG circular dependency

Kasia Misirli requested to merge 430017/Improve_error_message into master

What does this MR do and why?

This MR adds the job names that created the circular dependance to the error message.

Resolves issue.

Screenshots or screen recordings

Currently we return an error for pipeline circular dependancy which shows as below: This MR has added the e.message to the circular dependancies in the pipeline. In the interested of time, I would keep this message as is and in the followup MR I will gather thoughts of the team and either remove this additional info (eg topological sort failed: ["job_a", "job_c", "job_b"]) from this case scenario or digest the error message further to drop off so unnecessarily info and add better formatting.

Screenshot_2023-11-01_at_14.05.20

When job has a self-dependancy and the feature flag is enabled, we show the following error message:

Screenshot_2023-11-02_at_10.50.59

When job has a self-dependancy and the feature flag is not enabled, the error is not raised.

How to set up and validate locally

  1. Add below pipeline to .gitlab-ci.yml file and see that the validation fails due to error: "The pipeline has circular dependencies: self-dependency: job"
              job_0:
                stage: test
                script: build

              job:
                stage: test
                script: build
                needs: [job_0, job]
  1. Add below pipeline to .gitlab-ci.yml file and see that the validation fails due to error: "The pipeline has circular dependencies: topological sort failed: ["job_a", "job_c", "job_b"]'"
           job_a:
              stage: test
              script: build
              needs: [job_c]

            job_b:
              stage: test
              script: test
              needs: [job_a]

            job_c:
              stage: test
              script: deploy
              needs: [job_b]

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 Kasia Misirli

Merge request reports

Loading