Skip to content

CI: Transition to rules, instead of deprecated only/except clauses

georg requested to merge ci-rules-instead-of-only-except into master

In most cases, relying on rules instead of only/except clauses offers more possibilites.

This commit changes the CI pipeline configuration as follows:

  • Pipelines are executed with the Ruby rspec jobs for all branches, except if an associated MR exists.

  • In this case, create a so called "detached pipeline" with all, the Ruby rspec and MR-specific, jobs.

  • Pipelines aren't executed for tags at all, as the relevant commits are tested in any case.

This prevents duplicated pipelines and therefore wasted resources.

Besides this, the CHANGELOG job result gets more reliable: up until now, the result of it was timing-sensitive, as it queried the GitLab API to search for an associated MR, to get the target branch to compare against. This would fail in case a branch was pushed, the job started but a MR only created some time afterwards, as there would be no target branch, yet.

Now, as the job is run within the "detached pipeline" of a MR, and relies on the MR-specific target branch exposed via a variable, this job isn't timing-sensitive anymore.

To ensure these changes do work as expected, they were extensively tested in a forked repo.

Closes #469 (closed)

Merge request reports