CI configuration guides

Find a Missing Stage and Job in a GitLab Pipeline

·

The example pipeline has build and test stages. Two visible jobs share a hidden Node.js template, and the unit job waits for the compile job.

GitLab CI YAML Validator

Identify a stage that the pipeline never declares

Select Load example and Validate GitLab CI. The result shows two jobs, zero errors and zero warnings. The hidden .base template supplies the Node image and install command to both jobs.

Change the unit job's stage from test to checks. Validate again and find the unknown-stage diagnostic at /unit/stage. The file declares build and test, along with the implicit .pre and .post stages.

GitLab CI/CD YAML syntaxGitLab YAML anchors, extends and references

Correct a dependency in the unit job

Restore stage: test. Change needs: [compile] to needs: [assemble] and validate again. The missing-job diagnostic at /unit/needs/0 points to the absent runnable job. Restore compile, run the check and download gitlab-ci-validation.json for the clean result.

If you add an optional local need, GitLab can continue when it is absent. A direct need for an existing job still participates in local checks for dependency cycles and stage order.

GitLab CI/CD YAML syntax

Use the full project for includes and pipeline rules

An included job, cross-project need or !reference value can depend on other files and GitLab settings. Review the local warning, then use GitLab CI Lint in the project to check the assembled pipeline and evaluate rules.

GitLab CI LintGitLab YAML anchors, extends and references

Common questions

Can a hidden job supply a script?

Yes. A visible job can inherit a script through a local extends reference. Hidden templates do not count as runnable jobs.

Can I mix rules with only in one job?

Use one trigger model per job. The validator reports a conflict when the same job uses rules with only or except.

Sources

Put it into practice.

Related guides