Commit c1ad37e7 authored by Yorick Peterse's avatar Yorick Peterse

Don't create pipelines when preparing RCs

In the days leading up to a monthly release, Release Tools will
automatically create a new release candidate every day. As part of this
process we merge the latest changes deployed to production into the
latest stable branch. Since we use merge requests for this (as our API
does not let you merge a branch directly), this will create a pipeline.
To deal with this we implemented some code to cancel pipelines before
merging these merge requests.

Sadly this proved unreliable, as sometimes pipelines are not yet
available after creating the merge request. If we then try to merge the
merge request this may fail if there are pending pipelines.

In this commit we change the CI config to not create a pipeline in the
first place for these merge requests. This is the easiest and most
reliable way of letting Release Tools merge its own merge requests,
without the need for any logic that waits for and cancels any running
pipelines.

This fixes https://gitlab.com/gitlab-org/release-tools/-/issues/423
parent ee09ef37
...@@ -25,6 +25,13 @@ workflow: ...@@ -25,6 +25,13 @@ workflow:
rules: rules:
# If `$FORCE_GITLAB_CI` is set, create a pipeline. # If `$FORCE_GITLAB_CI` is set, create a pipeline.
- if: '$FORCE_GITLAB_CI' - if: '$FORCE_GITLAB_CI'
# As part of the process of creating RCs automatically, we update stable
# branches with the changes of the most recent production deployment. The
# merge requests used for this merge a branch release-tools/X into a stable
# branch. For these merge requests we don't want to run any pipelines, as
# they serve no purpose and will run anyway when the changes are merged.
- if: '$CI_COMMIT_BRANCH =~ /^release-tools\/\d+\.\d+\.\d+-rc\d+$/ && $CI_MERGE_REQUEST_TARGET_BRANCH_NAME =~ /^[\d-]+-stable(-ee)?$/ && $CI_PROJECT_PATH == "gitlab-org/gitlab"'
when: never
# For merge requests, create a pipeline. # For merge requests, create a pipeline.
- if: '$CI_MERGE_REQUEST_IID' - if: '$CI_MERGE_REQUEST_IID'
# For `master` branch, create a pipeline (this includes on schedules, pushes, merges, etc.). # For `master` branch, create a pipeline (this includes on schedules, pushes, merges, etc.).
......
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