CI: change default rule from when:always to when:on_success
Description
Currently the CI will run all pipeline jobs, even if their prerequisite jobs have failed. For example, if lal:deb
fails, then lalframe:deb
will still run even though lalframe:deb
(presumably) needs the upstream package built by lal:deb
.
To illustrate, for this pipeline I added an exit 1
statement to .gitlab-ci.yml
to make all build jobs fail. Even though the tarballs
jobs fail, the rest of the pipeline jobs still run (and fail).
The behaviour should be that a job is not run if its prerequisite jobs fail, as that job will inevitably fail as well. The current behaviour makes it harder to find which job is buggy, if there are a lot of failed jobs due to failed prerequisites. I imagine this also puts more strain on the GitLab runners, which end up running failed jobs unnecessarily.
The solution is to change when
in the default rule (always-rule
) from when: always
to when: on_success
. After making that change to the above pipeline (but keeping the exit 1
statement) this pipeline shows that, when the tarballs
jobs fail, the lal*
jobs are not run. However, the jobs that don't require tarballs
-- the top-level build, coverage, lint, documentation -- are still run as expected.
API Changes and Justification
Backwards Compatible Changes
-
This change does not modify any class/function/struct/type definitions in a public C header file or any Python class/function definitions -
This change adds new classes/functions/structs/types to a public C header file or Python module
Backwards Incompatible Changes
-
This change modifies an existing class/function/struct/type definition in a public C header file or Python module -
This change removes an existing class/function/struct/type from a public C header file or Python module