Skip to content

Allow `needs: []` to specify a job that can always be started immediately, regardless of stage

Problem to solve

For the MVC of the directed acyclic graph, we're lacking support for defining an empty needs: array to specify that something has no predecessor. If we supported this, users could mark a job in a second or beyond stage as eligible to start immediately.

Intended users

Individual contributor automation engineers

Further details

Consider the following yaml which has a build, setup_test_env, and test job:

build:
  stage: build
  script: echo Hello World

setup_test_env:
  stage: test

test:
  stage: test
  needs: [build, setup_test_env]

With this new keyword, we could allow setup_test_env as follows to allow it to run as soon as the pipeline starts, but still appear in the test stage where it makes more logical sense:

setup_test_env:
  stage: test
  needs: []

Proposal

Allow for needs: [] which will indicate to GitLab that a job, regardless of what stage it's in, can always start immediately.

Permissions and Security

N/A

Documentation

Testing

What does success look like, and how can we measure that?

Links / references

Edited by Furkan Ayhan