Commit 093874f4 authored by Albert Salim's avatar Albert Salim

Run full rspec jobs on automated MRs

To ensure the full rspec job is run on automated MRs,
there is a new rule `if-automated-merge-reqeust`
added in the rspec job rules prior to
the rule `if-merge-request-not-approved`.

The order of these two rules are important to ensure the job
is created in the pipeline, instead of `when: never` taking effect.

To ensure the minimal job is not run on automated MRs,
a reverse rule is added to the minimal job rules
using `if-automated-merge-request` with `when: never`.
parent bcc82c3a
...@@ -40,6 +40,9 @@ ...@@ -40,6 +40,9 @@
.if-merge-request-not-approved: &if-merge-request-not-approved .if-merge-request-not-approved: &if-merge-request-not-approved
if: '$CI_MERGE_REQUEST_IID && $CI_MERGE_REQUEST_APPROVED != "true"' if: '$CI_MERGE_REQUEST_IID && $CI_MERGE_REQUEST_APPROVED != "true"'
.if-automated-merge-request: &if-automated-merge-request
if: '$CI_MERGE_REQUEST_SOURCE_BRANCH_NAME == "release-tools/update-gitaly" || $CI_MERGE_REQUEST_TARGET_BRANCH_NAME =~ /stable-ee$/'
.if-merge-request-title-as-if-foss: &if-merge-request-title-as-if-foss .if-merge-request-title-as-if-foss: &if-merge-request-title-as-if-foss
if: '$CI_MERGE_REQUEST_TITLE =~ /RUN AS-IF-FOSS/' if: '$CI_MERGE_REQUEST_TITLE =~ /RUN AS-IF-FOSS/'
...@@ -616,6 +619,8 @@ ...@@ -616,6 +619,8 @@
.rails:rules:ee-and-foss-migration: .rails:rules:ee-and-foss-migration:
rules: rules:
- <<: *if-merge-request-title-run-all-rspec - <<: *if-merge-request-title-run-all-rspec
- <<: *if-automated-merge-request
changes: *db-patterns
- <<: *if-merge-request-not-approved - <<: *if-merge-request-not-approved
when: never when: never
- changes: *db-patterns - changes: *db-patterns
...@@ -624,6 +629,8 @@ ...@@ -624,6 +629,8 @@
rules: rules:
- <<: *if-merge-request-approved - <<: *if-merge-request-approved
when: never when: never
- <<: *if-automated-merge-request
when: never
- <<: *if-merge-request-title-run-all-rspec - <<: *if-merge-request-title-run-all-rspec
when: never when: never
- <<: *if-merge-request - <<: *if-merge-request
...@@ -649,6 +656,8 @@ ...@@ -649,6 +656,8 @@
.rails:rules:ee-and-foss-unit: .rails:rules:ee-and-foss-unit:
rules: rules:
- <<: *if-merge-request-title-run-all-rspec - <<: *if-merge-request-title-run-all-rspec
- <<: *if-automated-merge-request
changes: *backend-patterns
- <<: *if-merge-request-not-approved - <<: *if-merge-request-not-approved
when: never when: never
- changes: *backend-patterns - changes: *backend-patterns
...@@ -657,6 +666,8 @@ ...@@ -657,6 +666,8 @@
rules: rules:
- <<: *if-merge-request-approved - <<: *if-merge-request-approved
when: never when: never
- <<: *if-automated-merge-request
when: never
- <<: *if-merge-request-title-run-all-rspec - <<: *if-merge-request-title-run-all-rspec
when: never when: never
- <<: *if-merge-request - <<: *if-merge-request
...@@ -668,6 +679,8 @@ ...@@ -668,6 +679,8 @@
.rails:rules:ee-and-foss-integration: .rails:rules:ee-and-foss-integration:
rules: rules:
- <<: *if-merge-request-title-run-all-rspec - <<: *if-merge-request-title-run-all-rspec
- <<: *if-automated-merge-request
changes: *backend-patterns
- <<: *if-merge-request-not-approved - <<: *if-merge-request-not-approved
when: never when: never
- changes: *backend-patterns - changes: *backend-patterns
...@@ -676,6 +689,8 @@ ...@@ -676,6 +689,8 @@
rules: rules:
- <<: *if-merge-request-approved - <<: *if-merge-request-approved
when: never when: never
- <<: *if-automated-merge-request
when: never
- <<: *if-merge-request-title-run-all-rspec - <<: *if-merge-request-title-run-all-rspec
when: never when: never
- <<: *if-merge-request - <<: *if-merge-request
...@@ -687,6 +702,8 @@ ...@@ -687,6 +702,8 @@
.rails:rules:ee-and-foss-system: .rails:rules:ee-and-foss-system:
rules: rules:
- <<: *if-merge-request-title-run-all-rspec - <<: *if-merge-request-title-run-all-rspec
- <<: *if-automated-merge-request
changes: *code-backstage-patterns
- <<: *if-merge-request-not-approved - <<: *if-merge-request-not-approved
when: never when: never
- changes: *code-backstage-patterns - changes: *code-backstage-patterns
...@@ -695,6 +712,8 @@ ...@@ -695,6 +712,8 @@
rules: rules:
- <<: *if-merge-request-approved - <<: *if-merge-request-approved
when: never when: never
- <<: *if-automated-merge-request
when: never
- <<: *if-merge-request-title-run-all-rspec - <<: *if-merge-request-title-run-all-rspec
when: never when: never
- <<: *if-merge-request - <<: *if-merge-request
...@@ -706,6 +725,8 @@ ...@@ -706,6 +725,8 @@
.rails:rules:ee-and-foss-fast_spec_helper: .rails:rules:ee-and-foss-fast_spec_helper:
rules: rules:
- <<: *if-merge-request-title-run-all-rspec - <<: *if-merge-request-title-run-all-rspec
- <<: *if-automated-merge-request
changes: ["config/**/*"]
- <<: *if-merge-request-not-approved - <<: *if-merge-request-not-approved
when: never when: never
- changes: ["config/**/*"] - changes: ["config/**/*"]
...@@ -714,6 +735,8 @@ ...@@ -714,6 +735,8 @@
rules: rules:
- <<: *if-merge-request-approved - <<: *if-merge-request-approved
when: never when: never
- <<: *if-automated-merge-request
when: never
- <<: *if-merge-request-title-run-all-rspec - <<: *if-merge-request-title-run-all-rspec
when: never when: never
- <<: *if-merge-request - <<: *if-merge-request
...@@ -732,6 +755,8 @@ ...@@ -732,6 +755,8 @@
- <<: *if-not-ee - <<: *if-not-ee
when: never when: never
- <<: *if-merge-request-title-run-all-rspec - <<: *if-merge-request-title-run-all-rspec
- <<: *if-automated-merge-request
changes: *db-patterns
- <<: *if-merge-request-not-approved - <<: *if-merge-request-not-approved
when: never when: never
- changes: *db-patterns - changes: *db-patterns
...@@ -742,6 +767,8 @@ ...@@ -742,6 +767,8 @@
when: never when: never
- <<: *if-merge-request-approved - <<: *if-merge-request-approved
when: never when: never
- <<: *if-automated-merge-request
when: never
- <<: *if-merge-request-title-run-all-rspec - <<: *if-merge-request-title-run-all-rspec
when: never when: never
- <<: *if-merge-request - <<: *if-merge-request
...@@ -755,6 +782,8 @@ ...@@ -755,6 +782,8 @@
- <<: *if-not-ee - <<: *if-not-ee
when: never when: never
- <<: *if-merge-request-title-run-all-rspec - <<: *if-merge-request-title-run-all-rspec
- <<: *if-automated-merge-request
changes: *backend-patterns
- <<: *if-merge-request-not-approved - <<: *if-merge-request-not-approved
when: never when: never
- changes: *backend-patterns - changes: *backend-patterns
...@@ -765,6 +794,8 @@ ...@@ -765,6 +794,8 @@
when: never when: never
- <<: *if-merge-request-approved - <<: *if-merge-request-approved
when: never when: never
- <<: *if-automated-merge-request
when: never
- <<: *if-merge-request-title-run-all-rspec - <<: *if-merge-request-title-run-all-rspec
when: never when: never
- <<: *if-merge-request - <<: *if-merge-request
...@@ -778,6 +809,8 @@ ...@@ -778,6 +809,8 @@
- <<: *if-not-ee - <<: *if-not-ee
when: never when: never
- <<: *if-merge-request-title-run-all-rspec - <<: *if-merge-request-title-run-all-rspec
- <<: *if-automated-merge-request
changes: *backend-patterns
- <<: *if-merge-request-not-approved - <<: *if-merge-request-not-approved
when: never when: never
- changes: *backend-patterns - changes: *backend-patterns
...@@ -788,6 +821,8 @@ ...@@ -788,6 +821,8 @@
when: never when: never
- <<: *if-merge-request-approved - <<: *if-merge-request-approved
when: never when: never
- <<: *if-automated-merge-request
when: never
- <<: *if-merge-request-title-run-all-rspec - <<: *if-merge-request-title-run-all-rspec
when: never when: never
- <<: *if-merge-request - <<: *if-merge-request
...@@ -801,6 +836,8 @@ ...@@ -801,6 +836,8 @@
- <<: *if-not-ee - <<: *if-not-ee
when: never when: never
- <<: *if-merge-request-title-run-all-rspec - <<: *if-merge-request-title-run-all-rspec
- <<: *if-automated-merge-request
changes: *code-backstage-patterns
- <<: *if-merge-request-not-approved - <<: *if-merge-request-not-approved
when: never when: never
- changes: *code-backstage-patterns - changes: *code-backstage-patterns
...@@ -811,6 +848,8 @@ ...@@ -811,6 +848,8 @@
when: never when: never
- <<: *if-merge-request-approved - <<: *if-merge-request-approved
when: never when: never
- <<: *if-automated-merge-request
when: never
- <<: *if-merge-request-title-run-all-rspec - <<: *if-merge-request-title-run-all-rspec
when: never when: never
- <<: *if-merge-request - <<: *if-merge-request
...@@ -824,6 +863,8 @@ ...@@ -824,6 +863,8 @@
- <<: *if-not-ee - <<: *if-not-ee
when: never when: never
- <<: *if-merge-request-title-run-all-rspec - <<: *if-merge-request-title-run-all-rspec
- <<: *if-automated-merge-request
changes: *db-patterns
- <<: *if-merge-request-not-approved - <<: *if-merge-request-not-approved
when: never when: never
- <<: *if-security-merge-request - <<: *if-security-merge-request
...@@ -839,6 +880,8 @@ ...@@ -839,6 +880,8 @@
when: never when: never
- <<: *if-merge-request-approved - <<: *if-merge-request-approved
when: never when: never
- <<: *if-automated-merge-request
when: never
- <<: *if-merge-request - <<: *if-merge-request
changes: *ci-patterns changes: *ci-patterns
when: never when: never
...@@ -852,6 +895,8 @@ ...@@ -852,6 +895,8 @@
- <<: *if-not-ee - <<: *if-not-ee
when: never when: never
- <<: *if-merge-request-title-run-all-rspec - <<: *if-merge-request-title-run-all-rspec
- <<: *if-automated-merge-request
changes: *backend-patterns
- <<: *if-merge-request-not-approved - <<: *if-merge-request-not-approved
when: never when: never
- <<: *if-security-merge-request - <<: *if-security-merge-request
...@@ -867,6 +912,8 @@ ...@@ -867,6 +912,8 @@
when: never when: never
- <<: *if-merge-request-approved - <<: *if-merge-request-approved
when: never when: never
- <<: *if-automated-merge-request
when: never
- <<: *if-merge-request - <<: *if-merge-request
changes: *ci-patterns changes: *ci-patterns
when: never when: never
...@@ -880,6 +927,8 @@ ...@@ -880,6 +927,8 @@
- <<: *if-not-ee - <<: *if-not-ee
when: never when: never
- <<: *if-merge-request-title-run-all-rspec - <<: *if-merge-request-title-run-all-rspec
- <<: *if-automated-merge-request
changes: *backend-patterns
- <<: *if-merge-request-not-approved - <<: *if-merge-request-not-approved
when: never when: never
- <<: *if-security-merge-request - <<: *if-security-merge-request
...@@ -895,6 +944,8 @@ ...@@ -895,6 +944,8 @@
when: never when: never
- <<: *if-merge-request-approved - <<: *if-merge-request-approved
when: never when: never
- <<: *if-automated-merge-request
when: never
- <<: *if-merge-request - <<: *if-merge-request
changes: *ci-patterns changes: *ci-patterns
when: never when: never
...@@ -908,6 +959,8 @@ ...@@ -908,6 +959,8 @@
- <<: *if-not-ee - <<: *if-not-ee
when: never when: never
- <<: *if-merge-request-title-run-all-rspec - <<: *if-merge-request-title-run-all-rspec
- <<: *if-automated-merge-request
changes: *code-backstage-patterns
- <<: *if-merge-request-not-approved - <<: *if-merge-request-not-approved
when: never when: never
- <<: *if-security-merge-request - <<: *if-security-merge-request
...@@ -923,6 +976,8 @@ ...@@ -923,6 +976,8 @@
when: never when: never
- <<: *if-merge-request-approved - <<: *if-merge-request-approved
when: never when: never
- <<: *if-automated-merge-request
when: never
- <<: *if-merge-request - <<: *if-merge-request
changes: *ci-patterns changes: *ci-patterns
when: never when: never
......
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