Discussion: Is "needs" different than "stage"
Summary
I'd like to discuss what's our long-term goal of needs
vs stage
approaches. I remember that we talked about it before but I couldn't find a written decision on it.
We have #219371 about unifying the pipeline processing but it is about the technical challenge we are having in backend.
Case 1
In the discussion of adding start:manual / block:true
(&6788 (comment 1246046669)), it is mentioned that DAG and STAGE should behave differently because users specifically write "needs". However, there is also another idea that DAG should be just a different method of writing STAGE.
Example, let's say we have this syntax and config;
build1:
stage: build
script: echo
start: manual
block: false
test1:
stage: test
script: echo
test2:
stage: test
script: echo
needs: [build1]
-
build1
is not a blocker. -
test1
will run becausebuild1
is not a blocker. - Question: Should
test2
also run?
Case 2
In #32598, some users expect that a job should not run if its "needs" job fails with allow_failure
. So the ideas are the same; one thinks that needs
is different and one thinks that there is no difference between needs
and stage
.
Example, let's say we have this config;
build1:
stage: build
script: exit 1
allow_failure: true
test1:
stage: test
script: echo
test2:
stage: test
script: echo
needs: [build1]
-
build1
fails but it is "allowed to be failed". -
test1
will run because the overallbuild1
status is "success". - Question: Should
test2
also run?
Case 3
From #388866 (comment 1255688251);
build_job:
stage: build
script: exit 1
test_job:
stage: test
script: exit 0
rollback_job1:
stage: deploy
script: exit 0
when: on_failure
rollback_job2:
stage: deploy
script: exit 0
when: on_failure
needs: [build_job, test_job]
Current behavior:
-
build_job
fails. -
test_job
is skipped because. -
rollback_job1
runs because it runs "on failure" - Question: Should
rollback_job2
also run? (given thattest_job
is skipped)
Goal
- What do you think?
- Do you remember our last decision about it?
- Should "DAG" and "STAGE" behave differently? Or, "DAG" is just another way for defining "STAGE"s?