Skip to content

[CI] Change main pipeline source from push events to merge request events

Description

The idea behind this MR is twofold:

  • Change our main source of running the pipelines from push events to merge_request_events
  • Allow for faster merges when files changed that do not affect anything in CI. E.g. readme files or the CHANGELOG.
    • This is done by making a large part of the pipeline manual if only these files changed

This MR went through a few iterations as GitLab does not (yet) support a nice way to handle what we want to do here. See e.g. https://gitlab.com/gitlab-org/gitlab/-/issues/348141 and https://gitlab.com/gitlab-org/gitlab/-/issues/198688

In the end, I settled on the following:

  • Ideally we would just say don't run the job if only these files changed as this is the most robust. However, this is not possible (yet) in GitLab, so we have to do the inverse: run this job only if any of these files changed
  • Therefore, I added a rules section to the build job to ensure it only triggers automatically if any of the following files changed:
    • .dockerignore
    • .gitlab-ci.yml
    • CMakeLists.txt
    • cta.spec.in
    • project.json
    • version.hpp.in
    • '*/**/*'
  • If this rule is not matched (i.e. only other files changed), then the job will be a manual job. At this point, a merge is already possible
    • The actual logic is a bit more complicated, but this is the gist of it

Checklist

  • Documentation reflects the changes made.
  • Merge Request title is clear, concise, and suitable as a changelog entry. See this link

References

Closes #1141 (closed) Closes #1103 (closed)

Edited by Niels Alexander Buegel

Merge request reports

Loading