Skip to content
GitLab
Next
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • GitLab GitLab
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 44,758
    • Issues 44,758
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
    • Requirements
  • Merge requests 1,331
    • Merge requests 1,331
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Container Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Metrics
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • GitLab.orgGitLab.org
  • GitLabGitLab
  • Issues
  • #30631
Closed
Open
Issue created Aug 02, 2019 by Jason Yavorska@jyavorskaContributor1 of 1 checklist item completed1/1 checklist item

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

  • We may need to remove: It is impossible for now to have needs: [] (empty needs), the job always needs to depend on something, unless this is the job in the first stage. However, support for an empty needs array is planned.

Testing

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

Links / references

Edited Feb 15, 2020 by Furkan Ayhan
Assignee
Assign to
Time tracking