Do not silently skip jobs without predecessor in DAG
Problem to solve
The initial behavior of the DAG MVC was to silently skip any jobs that are needed
by a subsequent job. The thinking was that, if you set up only/except
rules on the initial job, you likely wanted the same to be inherited in all of the following. In the conversation thread starting at https://gitlab.com/gitlab-org/gitlab-ce/issues/47063#note_200859999, though, the good point was raised that - especially initially - explicit behavior is better than magic.
Intended users
DAG users
Further details
Proposal
For the MVC, we will change the default behavior such that if a needs:
rule exists, we will treat it as the job being needed. If the job that needs another should also have the same only/except
rules, then they should be encoded there as well. In pseudo-code:
- If:
- The
only/except
rules on a job with 'needs' indicate that it should be started, - AND
required
on theneeds
is set to true (which is the default setting, and only option until https://gitlab.com/gitlab-org/gitlab-ce/issues/65610), - AND any of the job(s) it needs are not instantiated:
- The
- Then:
- Fail the job with a message that a
needed
job did not exist (instead of silently skipping)
- Fail the job with a message that a
This doesn't preclude us from adding an option later to reduce the boilerplate/duplication, but for now the better initial behavior is to be explicit and not silently help by skipping the jobs, which may cause confusion in certain use cases.
Permissions and Security
No separate security concerns