Skip to content

Fix misleading error for invalid job dependencies

Make error message more generic when the job dependencies are invalid, since it can be caused by many different conditions.

Related to #287772 (closed)

Steps to test

With dependency list

  1. In gitlab_ci.yaml add jobs with dependencies:
build linux:
  stage: build
  script: echo 'hello'

test linux:
  stage: test
  script: echo 'hello'
  dependencies:
    - build linux
  1. Run the pipeline
  2. Navigate to the build linux page and use the trash can icon to delete the job referenced in dependencies(build linux)
  3. Retry the dependent job(test linux)

Without dependency list

  1. In gitlab_ci.yaml add jobs with dependencies:
build_job:
  stage: build
  script:
    - ls -lhR
  needs:
    - project: namespace/group/project-name
      job: build-1
      ref: main
      artifacts: true
  1. Run the pipeline

Screenshots

With dependency list

screenshot description screenshot
CI file Screen_Shot_2022-04-22_at_3.56.31_PM
Error Screen_Shot_2022-04-22_at_3.48.38_PM

Without dependency list

screenshot
CI File Screen_Shot_2022-04-22_at_4.08.17_PM
Error Screen_Shot_2022-04-22_at_4.02.03_PM
Edited by Allison Browne

Merge request reports

Loading