From 83d856d4bc8e66dab57d87cd572ae9bcdb5a2ab9 Mon Sep 17 00:00:00 2001 From: Eric Engestrom Date: Fri, 15 Sep 2023 12:09:43 +0100 Subject: [PATCH] ci/farm-rules: re-add "run every container and build job when a farm gets re-enabled" Turns out I was right the first time, I was just missing that this should only be done in MRs, which @daniels added in 16527f6ffd0129f2f6e1. Without this, a "farm re-enable" pipeline will run all the jobs for that farm, but will have none of the container & build jobs to support these tests. This reverts commit 1c3097225a4af294720e111eab3f58d590b85c8c. Fixes: 1c3097225a4af294720e ("ci: don't run everything just because a farm gets re-enabled") Part-of: --- .gitlab-ci.yml | 4 ++-- .gitlab-ci/farm-rules.yml | 12 +++++++++++- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index e3731186247..06ecbe8f384 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -156,7 +156,7 @@ include: # When to automatically run the CI for build jobs .build-rules: rules: - # Don't run when disabling a farm + # Run when re-enabling a disabled farm, but not when disabling it - !reference [.disable-farm-mr-rules, rules] # If any files affecting the pipeline are changed, build/test jobs run # automatically once all dependency jobs have passed @@ -200,7 +200,7 @@ include: .container-rules: rules: - # Don't run when disabling a farm + # Run when re-enabling a disabled farm, but not when disabling it - !reference [.disable-farm-mr-rules, rules] # Run pipeline by default in the main project if any CI pipeline # configuration files were changed, to ensure docker images are up to date diff --git a/.gitlab-ci/farm-rules.yml b/.gitlab-ci/farm-rules.yml index 0b0562273c0..6087bd73f74 100644 --- a/.gitlab-ci/farm-rules.yml +++ b/.gitlab-ci/farm-rules.yml @@ -238,13 +238,18 @@ - !reference [.freedreno-farm-rules, rules] -# Skip container & build jobs when disabling any farm +# Skip container & build jobs when disabling any farm, and run them if any +# farm gets re-enabled. # Only apply these rules in MR context, because otherwise we get a false # positive on files being 'created' when pushing to a new branch, and break # our pipeline .disable-farm-mr-rules: rules: # changes(disabled) + exists(disabled) = disabling the farm + # Note: this cannot be simplified into a single `.ci-farms-disabled/*` rule + # because if there are more than one disabled farm and we only re-enable + # one, the exits(.ci-farms-disabled/*) would match and what should be + # a farm re-enable pipeline will be detected as a farm disable pipeline. - if: '$CI_PIPELINE_SOURCE == "merge_request_event"' changes: [ .ci-farms-disabled/microsoft ] exists: [ .ci-farms-disabled/microsoft ] @@ -281,3 +286,8 @@ changes: [ .ci-farms-disabled/freedreno ] exists: [ .ci-farms-disabled/freedreno ] when: never + # Any other change to ci-farms/* means some farm is getting re-enabled. + # Run jobs in Marge pipelines (and let it fallback to manual otherwise) + - if: '$CI_PIPELINE_SOURCE == "merge_request_event" && $GITLAB_USER_LOGIN == "marge-bot"' + changes: [ .ci-farms/* ] + when: on_success