Skip to content

Fix pipeline status when DAG jobs needs manual jobs [RUN ALL RSPEC] [RUN AS-IF-FOSS]

Furkan Ayhan requested to merge 31264-skipped into master

What does this MR do?

This is just another approach for the ~bug in #31264 (closed).

The other approach: !48077 (closed)

I know this is not a perfect implementation and can't be a long-term solution, but it can fix the 1-year-old issue with 116 upvotes.

  1. When a normal stage job is in the next stage of a manual job with allow_failure: true, the manual job is skipped and the normal job runs.
    • Everything is okay
  2. When a normal stage job is in the next stage of a manual job with allow_failure: false, the manual job blocks the next stage.
    • Everything is okay
  3. When a DAG job needs a manual job with allow_failure: true, 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.
    • Everything is okay

This MR fixes the problem in the 3rd point. Please see the Screenshots below.

feature flag ci_fix_pipeline_status_for_dag_needs_manual => #321972 (closed)

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

Config:

stages: [build, test, review, deploy]

build:
  stage: build
  script: exit 0

test:
  stage: test
  script: exit 0

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

review:
  stage: review
  script: exit 0
  needs: [test, release_test]

staging:
  stage: deploy
  script: exit 0
  needs: [test, release_test]

production:
  stage: deploy
  script: exit 0
  needs: [review]

Before this MR:

Screen_Shot_2020-11-18_at_23.05.08

Screen_Shot_2020-11-18_at_23.05.00

After this MR:

Screen_Shot_2021-02-05_at_15.21.01

Screen_Shot_2021-02-05_at_15.21.19

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

Security

If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:

  • Label as security and @ mention @gitlab-com/gl-security/appsec
  • The MR includes necessary changes to maintain consistency between UI, API, email, or other methods
  • Security reports checked/validated by a reviewer from the AppSec team
Edited by Kamil Trzciński

Merge request reports