Update error message for DAG circular dependency
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.
When job has a self-dependancy and the feature flag is enabled, we show the following error message:
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
- 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]
- 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.
-
I have evaluated the MR acceptance checklist for this MR.