Commit 76f98068 authored by Ben Avison's avatar Ben Avison
Browse files

Enable all jobs in detached pipelines

When working on an unrelated issue, it became clear that the reason why
previously only the `merge_log` and `merge_whitesp` jobs appeared in
detached pipelines (the ones that relate to an open MR) was really because
they include a `rules` section. It is as though in the absence of a `rules`
section, a default one applies, which adds the job to the pipeline only if
that pipeline was due to an update of a branch or tag ref. When `rules` was
present for a job, it overrides the default, and is evaluated irrespective
of the the pipeline trigger.

Now, it's useful to have all the jobs present in detached pipelines. The
latest detached pipeline state, and its associated artifactes, are displayed
at the top of the "Overview" tab of each MR page, and a new one can be
easily triggered from the "Run pipeline" button at the top of the MR page's
"Pipelines" tab, without having to navigate to the contributor's fork project
(which may not even be public). It's also a problem that the `cleanup` job
wasn't being run for detached pipelines, since over time that risks filling
up the disc space on the runner machine.

It turns out all of this can be implemented simply by adding a `workflow`
section which defines a new default set of rules, which adds jobs to
detached pipelines as well as ones for branches and tags.
parent 5a28fd8a
Pipeline #3560 passed with stage
in 4 seconds
......@@ -111,6 +111,14 @@ function do_superproject_class(build_class) {
out = "CI/IOMDHAL.yml"
else
out = "CI/" builds[build_class][b] ".yml"
print "workflow:" >> out
print " rules:" >> out
print " - if: $CI_MERGE_REQUEST_IID" >> out
print " - if: $CI_COMMIT_TAG" >> out
print " - if: $CI_COMMIT_BRANCH" >> out
print "" >> out
# When we get to a point where we're doing a release (i.e. pushing commits
# to the superproject that contain a meaningful combination of submodule
# commit hashes) then it would give developers faster feedback if the
......@@ -316,6 +324,13 @@ BEGIN {
for (project in projects) {
out = "CI/" project ".yml"
print "workflow:" >> out
print " rules:" >> out
print " - if: $CI_MERGE_REQUEST_IID" >> out
print " - if: $CI_COMMIT_TAG" >> out
print " - if: $CI_COMMIT_BRANCH" >> out
print "" >> out
# Define appropriate stages for this project
print "stages:" >> out
print " - static_analysis" >> out
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment