Skip to content
GitLab Next
  • Menu
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,072
    • Issues 44,072
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
    • Requirements
  • Merge requests 1,381
    • Merge requests 1,381
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages & Registries
    • Packages & 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
  • #31264
Closed
Open
Created Aug 26, 2019 by Samuel Cordeiro@OrDoS🏸

Pipeline doesn't succeed when manual jobs using new DAG dependency "needs:" are waiting for other "when: manual" jobs to succeed

Summary

Pipeline doesn't succeed when jobs with "when:manual" and using new DAG dependency "needs:" are waiting for other "when: manual" jobs to succeed

Additional explanation

  1. When a non-manual stage job is in the next stage of a manual job with allow_failure: true (which is a default setting of a manual job), the manual job is skipped and the normal job runs.
  2. When a non-manual stage job is in the next stage of a manual job with explicit allow_failure: false, the manual job blocks the next stage.
  3. When a DAG job needs a manual job, the manual job blocks the DAG job to run.
    • However, the pipeline's status stays at created or running, because the manual job is actually skipped and not a blocker for regular jobs and the pipeline.
  4. When a DAG job needs a manual job with allow_failure: false, the manual job blocks the DAG job to run.

This bug describes the problem of scenario number 3

Proposal

Mark both the manual job and the DAG job that needs the manual job as skipped jobs, in case users would like to block the pipeline they can add allow_failure: false to the manual job

Screenshots (strongly suggested)

Example 1

Config:

test:
  stage: test
  when: manual
  script: exit 0

deploy:
  stage: deploy
  script: exit 0
  needs: [test]

Before this MR: Screen_Shot_2020-11-18_at_23.05.49

Screen_Shot_2020-11-18_at_23.05.56

After this MR:

Screen_Shot_2021-02-05_at_15.19.11

Screen_Shot_2021-02-05_at_15.19.27

Example 2

Config:

build:
  stage: build
  script: exit 0

test:
  stage: test
  when: manual
  script: exit 0

deploy:
  stage: deploy
  script: exit 0
  needs: [build, test]

Before this MR:

Screen_Shot_2020-11-18_at_23.06.20

Screen_Shot_2020-11-18_at_23.06.27

After this MR:

Screen_Shot_2021-02-05_at_15.20.39

Screen_Shot_2021-02-05_at_15.20.46

Example 3

Steps to reproduce

  1. Create 3 stages
  2. Add a regular job on the 1st stage
  3. Add manual jobs (with the "when: manual" keyword on .gitlab-ci.yaml) on the 2nd stage (with or without regular jobs)
  4. On the 3rd stage create either 1) an automatic job that has "allow_failure: true" and/or 2) a manual job
  5. Add a "needs: " tag on the jobs of the 3rd stage and make them depend on at least one manual job on the 2nd stage
  6. Run the flow and it will stay "running" forever while manual jobs aren't canceled.

What is the current bug behavior?

Pipeline stays in the "running" sate forever since all next stage's manual jobs that have dependencies are waiting for the previous stage's manual jobs to end, even if they are all allowed to fail.

This also affects the "Merge" button when merges are only allowed if a pipeline succeeds, since it stays disabled if a pipeline does not succeed. The screenshots below depict a scenario where we expect that the pipeline success does not depend on QA jobs to finish, while taking advantage of the new DAG feature.

What is the expected correct behavior?

One should expect to see the pipeline marked as "Passed", either green or orange, when the pipeline is left with only manual jobs or automatic jobs that allows failure.

As a note, if one setups a set of manual jobs to run on a stage without having jobs depending on them with the "needs:" keyword, the pipeline ignores them to set the pipeline's success or not (this considering the default behavior of allowing them to fail).

Relevant logs and/or screenshots

Gitlab_manual_pipeline_failure

Gitlab_manual_pipeline_failure_2

Output of checks

This bug happens on GitLab.com

Edited Feb 11, 2021 by Dov Hershkovitch
Assignee
Assign to
Time tracking