Draft: [strategy: block] Fix pipeline status when DAG jobs needs manual jobs
What does this MR do?
This is just a simple/ugly approach for the ~bug in #31264 (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.
- 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
- 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
- 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
orrunning
, because the manual job is actually skipped and not a blocker for regular jobs and the pipeline.
- However, the pipeline's status stays at
- 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.
p.s. This will probably need a feature flag if the proposal is accepted.
Screenshots (strongly suggested)
Example 1
Config:
test:
stage: test
when: manual
script: exit 0
deploy:
stage: deploy
script: exit 0
needs: [test]
After this MR:
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:
After this MR:
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:
After this MR:
Does this MR meet the acceptance criteria?
Conformity
-
Changelog entry -
Documentation (if required) -
Code review guidelines -
Merge request performance guidelines -
Style guides -
Database guides -
Separation of EE specific content
Availability and Testing
-
Review and add/update tests for this feature/bug. Consider all test levels. See the Test Planning Process. -
Tested in all supported browsers -
Informed Infrastructure department of a default or new setting change, if applicable per definition of done
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 Furkan Ayhan