Skip to content

CI template error: need job is not defined in prior stages

Summary

在同一个 yaml 内的一个 stage 中有两个 job,可以 needs。SaaS 应该开启了 ci_same_stage_job_needs。

而 need job of include template,会报错。

Steps to reproduce

  1. 编写两个 yaml,比如 .gitlab-ci.yml need a job in the same stage of .gitlab-ci.two.yml
  2. git push to run CI
  3. CI lint web

Example Project

https://jihulab.com/ultimate-plan/scenarios/java-8-maven-docker-proxy/-/blob/a769145c3fc6f0ea26a67ad6c52e7307c6a06cbb/.gitlab-ci.magic-version.yml

https://jihulab.com/ultimate-plan/scenarios/java-8-maven-docker-proxy/-/blob/a769145c3fc6f0ea26a67ad6c52e7307c6a06cbb/.gitlab-ci.yml

What is the current bug behavior?

CI parse yaml failed: need job is not defined in prior stages

but CI lint success

What is the expected correct behavior?

CI run success

Relevant logs and/or screenshots

image

image