Commit 75c13f96 authored by Albert Salim's avatar Albert Salim

Run minimal jobs before MR approval

parent 2b8b1f2a
...@@ -34,6 +34,12 @@ ...@@ -34,6 +34,12 @@
.if-merge-request: &if-merge-request .if-merge-request: &if-merge-request
if: '$CI_MERGE_REQUEST_IID' if: '$CI_MERGE_REQUEST_IID'
.if-merge-request-approved: &if-merge-request-approved
if: '$CI_MERGE_REQUEST_APPROVED'
.if-merge-request-not-approved: &if-merge-request-not-approved
if: '$CI_MERGE_REQUEST_APPROVED != "true"'
.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/'
...@@ -70,9 +76,6 @@ ...@@ -70,9 +76,6 @@
.if-cache-credentials-schedule: &if-cache-credentials-schedule .if-cache-credentials-schedule: &if-cache-credentials-schedule
if: '$CI_REPO_CACHE_CREDENTIALS && $CI_PIPELINE_SOURCE == "schedule"' if: '$CI_REPO_CACHE_CREDENTIALS && $CI_PIPELINE_SOURCE == "schedule"'
.if-merge-request-rspec-minimal-disabled: &if-merge-request-rspec-minimal-disabled
if: '$CI_MERGE_REQUEST_IID && $RSPEC_MINIMAL_ENABLED != "true"'
.if-rspec-fail-fast-disabled: &if-rspec-fail-fast-disabled .if-rspec-fail-fast-disabled: &if-rspec-fail-fast-disabled
if: '$RSPEC_FAIL_FAST_ENABLED != "true"' if: '$RSPEC_FAIL_FAST_ENABLED != "true"'
...@@ -612,12 +615,14 @@ ...@@ -612,12 +615,14 @@
############### ###############
.rails:rules:ee-and-foss-migration: .rails:rules:ee-and-foss-migration:
rules: rules:
- changes: *db-patterns
- <<: *if-merge-request-title-run-all-rspec - <<: *if-merge-request-title-run-all-rspec
- <<: *if-merge-request-not-approved
when: never
- changes: *db-patterns
.rails:rules:ee-and-foss-migration:minimal: .rails:rules:ee-and-foss-migration:minimal:
rules: rules:
- <<: *if-merge-request-rspec-minimal-disabled - <<: *if-merge-request-approved
when: never when: never
- <<: *if-merge-request-title-run-all-rspec - <<: *if-merge-request-title-run-all-rspec
when: never when: never
...@@ -643,12 +648,14 @@ ...@@ -643,12 +648,14 @@
.rails:rules:ee-and-foss-unit: .rails:rules:ee-and-foss-unit:
rules: rules:
- changes: *backend-patterns
- <<: *if-merge-request-title-run-all-rspec - <<: *if-merge-request-title-run-all-rspec
- <<: *if-merge-request-not-approved
when: never
- changes: *backend-patterns
.rails:rules:ee-and-foss-unit:minimal: .rails:rules:ee-and-foss-unit:minimal:
rules: rules:
- <<: *if-merge-request-rspec-minimal-disabled - <<: *if-merge-request-approved
when: never when: never
- <<: *if-merge-request-title-run-all-rspec - <<: *if-merge-request-title-run-all-rspec
when: never when: never
...@@ -660,12 +667,14 @@ ...@@ -660,12 +667,14 @@
.rails:rules:ee-and-foss-integration: .rails:rules:ee-and-foss-integration:
rules: rules:
- changes: *backend-patterns
- <<: *if-merge-request-title-run-all-rspec - <<: *if-merge-request-title-run-all-rspec
- <<: *if-merge-request-not-approved
when: never
- changes: *backend-patterns
.rails:rules:ee-and-foss-integration:minimal: .rails:rules:ee-and-foss-integration:minimal:
rules: rules:
- <<: *if-merge-request-rspec-minimal-disabled - <<: *if-merge-request-approved
when: never when: never
- <<: *if-merge-request-title-run-all-rspec - <<: *if-merge-request-title-run-all-rspec
when: never when: never
...@@ -677,12 +686,14 @@ ...@@ -677,12 +686,14 @@
.rails:rules:ee-and-foss-system: .rails:rules:ee-and-foss-system:
rules: rules:
- changes: *code-backstage-patterns
- <<: *if-merge-request-title-run-all-rspec - <<: *if-merge-request-title-run-all-rspec
- <<: *if-merge-request-not-approved
when: never
- changes: *code-backstage-patterns
.rails:rules:ee-and-foss-system:minimal: .rails:rules:ee-and-foss-system:minimal:
rules: rules:
- <<: *if-merge-request-rspec-minimal-disabled - <<: *if-merge-request-approved
when: never when: never
- <<: *if-merge-request-title-run-all-rspec - <<: *if-merge-request-title-run-all-rspec
when: never when: never
...@@ -694,12 +705,14 @@ ...@@ -694,12 +705,14 @@
.rails:rules:ee-and-foss-fast_spec_helper: .rails:rules:ee-and-foss-fast_spec_helper:
rules: rules:
- changes: ["config/**/*"]
- <<: *if-merge-request-title-run-all-rspec - <<: *if-merge-request-title-run-all-rspec
- <<: *if-merge-request-not-approved
when: never
- changes: ["config/**/*"]
.rails:rules:ee-and-foss-fast_spec_helper:minimal: .rails:rules:ee-and-foss-fast_spec_helper:minimal:
rules: rules:
- <<: *if-merge-request-rspec-minimal-disabled - <<: *if-merge-request-approved
when: never when: never
- <<: *if-merge-request-title-run-all-rspec - <<: *if-merge-request-title-run-all-rspec
when: never when: never
...@@ -718,14 +731,16 @@ ...@@ -718,14 +731,16 @@
rules: rules:
- <<: *if-not-ee - <<: *if-not-ee
when: never when: never
- changes: *db-patterns
- <<: *if-merge-request-title-run-all-rspec - <<: *if-merge-request-title-run-all-rspec
- <<: *if-merge-request-not-approved
when: never
- changes: *db-patterns
.rails:rules:ee-only-migration:minimal: .rails:rules:ee-only-migration:minimal:
rules: rules:
- <<: *if-not-ee - <<: *if-not-ee
when: never when: never
- <<: *if-merge-request-rspec-minimal-disabled - <<: *if-merge-request-approved
when: never when: never
- <<: *if-merge-request-title-run-all-rspec - <<: *if-merge-request-title-run-all-rspec
when: never when: never
...@@ -739,14 +754,16 @@ ...@@ -739,14 +754,16 @@
rules: rules:
- <<: *if-not-ee - <<: *if-not-ee
when: never when: never
- changes: *backend-patterns
- <<: *if-merge-request-title-run-all-rspec - <<: *if-merge-request-title-run-all-rspec
- <<: *if-merge-request-not-approved
when: never
- changes: *backend-patterns
.rails:rules:ee-only-unit:minimal: .rails:rules:ee-only-unit:minimal:
rules: rules:
- <<: *if-not-ee - <<: *if-not-ee
when: never when: never
- <<: *if-merge-request-rspec-minimal-disabled - <<: *if-merge-request-approved
when: never when: never
- <<: *if-merge-request-title-run-all-rspec - <<: *if-merge-request-title-run-all-rspec
when: never when: never
...@@ -760,14 +777,16 @@ ...@@ -760,14 +777,16 @@
rules: rules:
- <<: *if-not-ee - <<: *if-not-ee
when: never when: never
- changes: *backend-patterns
- <<: *if-merge-request-title-run-all-rspec - <<: *if-merge-request-title-run-all-rspec
- <<: *if-merge-request-not-approved
when: never
- changes: *backend-patterns
.rails:rules:ee-only-integration:minimal: .rails:rules:ee-only-integration:minimal:
rules: rules:
- <<: *if-not-ee - <<: *if-not-ee
when: never when: never
- <<: *if-merge-request-rspec-minimal-disabled - <<: *if-merge-request-approved
when: never when: never
- <<: *if-merge-request-title-run-all-rspec - <<: *if-merge-request-title-run-all-rspec
when: never when: never
...@@ -781,14 +800,16 @@ ...@@ -781,14 +800,16 @@
rules: rules:
- <<: *if-not-ee - <<: *if-not-ee
when: never when: never
- changes: *code-backstage-patterns
- <<: *if-merge-request-title-run-all-rspec - <<: *if-merge-request-title-run-all-rspec
- <<: *if-merge-request-not-approved
when: never
- changes: *code-backstage-patterns
.rails:rules:ee-only-system:minimal: .rails:rules:ee-only-system:minimal:
rules: rules:
- <<: *if-not-ee - <<: *if-not-ee
when: never when: never
- <<: *if-merge-request-rspec-minimal-disabled - <<: *if-merge-request-approved
when: never when: never
- <<: *if-merge-request-title-run-all-rspec - <<: *if-merge-request-title-run-all-rspec
when: never when: never
...@@ -802,11 +823,13 @@ ...@@ -802,11 +823,13 @@
rules: rules:
- <<: *if-not-ee - <<: *if-not-ee
when: never when: never
- <<: *if-merge-request-title-run-all-rspec
- <<: *if-merge-request-not-approved
when: never
- <<: *if-security-merge-request - <<: *if-security-merge-request
changes: *db-patterns changes: *db-patterns
- <<: *if-merge-request-title-as-if-foss - <<: *if-merge-request-title-as-if-foss
changes: *db-patterns changes: *db-patterns
- <<: *if-merge-request-title-run-all-rspec
- <<: *if-merge-request - <<: *if-merge-request
changes: *ci-patterns changes: *ci-patterns
...@@ -814,7 +837,7 @@ ...@@ -814,7 +837,7 @@
rules: rules:
- <<: *if-not-ee - <<: *if-not-ee
when: never when: never
- <<: *if-merge-request-rspec-minimal-disabled - <<: *if-merge-request-approved
when: never when: never
- <<: *if-merge-request - <<: *if-merge-request
changes: *ci-patterns changes: *ci-patterns
...@@ -823,17 +846,18 @@ ...@@ -823,17 +846,18 @@
changes: *db-patterns changes: *db-patterns
- <<: *if-merge-request-title-as-if-foss - <<: *if-merge-request-title-as-if-foss
changes: *db-patterns changes: *db-patterns
- <<: *if-merge-request-title-run-all-rspec
.rails:rules:as-if-foss-unit: .rails:rules:as-if-foss-unit:
rules: rules:
- <<: *if-not-ee - <<: *if-not-ee
when: never when: never
- <<: *if-merge-request-title-run-all-rspec
- <<: *if-merge-request-not-approved
when: never
- <<: *if-security-merge-request - <<: *if-security-merge-request
changes: *backend-patterns changes: *backend-patterns
- <<: *if-merge-request-title-as-if-foss - <<: *if-merge-request-title-as-if-foss
changes: *backend-patterns changes: *backend-patterns
- <<: *if-merge-request-title-run-all-rspec
- <<: *if-merge-request - <<: *if-merge-request
changes: *ci-patterns changes: *ci-patterns
...@@ -841,7 +865,7 @@ ...@@ -841,7 +865,7 @@
rules: rules:
- <<: *if-not-ee - <<: *if-not-ee
when: never when: never
- <<: *if-merge-request-rspec-minimal-disabled - <<: *if-merge-request-approved
when: never when: never
- <<: *if-merge-request - <<: *if-merge-request
changes: *ci-patterns changes: *ci-patterns
...@@ -850,17 +874,18 @@ ...@@ -850,17 +874,18 @@
changes: *backend-patterns changes: *backend-patterns
- <<: *if-merge-request-title-as-if-foss - <<: *if-merge-request-title-as-if-foss
changes: *backend-patterns changes: *backend-patterns
- <<: *if-merge-request-title-run-all-rspec
.rails:rules:as-if-foss-integration: .rails:rules:as-if-foss-integration:
rules: rules:
- <<: *if-not-ee - <<: *if-not-ee
when: never when: never
- <<: *if-merge-request-title-run-all-rspec
- <<: *if-merge-request-not-approved
when: never
- <<: *if-security-merge-request - <<: *if-security-merge-request
changes: *backend-patterns changes: *backend-patterns
- <<: *if-merge-request-title-as-if-foss - <<: *if-merge-request-title-as-if-foss
changes: *backend-patterns changes: *backend-patterns
- <<: *if-merge-request-title-run-all-rspec
- <<: *if-merge-request - <<: *if-merge-request
changes: *ci-patterns changes: *ci-patterns
...@@ -868,7 +893,7 @@ ...@@ -868,7 +893,7 @@
rules: rules:
- <<: *if-not-ee - <<: *if-not-ee
when: never when: never
- <<: *if-merge-request-rspec-minimal-disabled - <<: *if-merge-request-approved
when: never when: never
- <<: *if-merge-request - <<: *if-merge-request
changes: *ci-patterns changes: *ci-patterns
...@@ -877,17 +902,18 @@ ...@@ -877,17 +902,18 @@
changes: *backend-patterns changes: *backend-patterns
- <<: *if-merge-request-title-as-if-foss - <<: *if-merge-request-title-as-if-foss
changes: *backend-patterns changes: *backend-patterns
- <<: *if-merge-request-title-run-all-rspec
.rails:rules:as-if-foss-system: .rails:rules:as-if-foss-system:
rules: rules:
- <<: *if-not-ee - <<: *if-not-ee
when: never when: never
- <<: *if-merge-request-title-run-all-rspec
- <<: *if-merge-request-not-approved
when: never
- <<: *if-security-merge-request - <<: *if-security-merge-request
changes: *code-backstage-patterns changes: *code-backstage-patterns
- <<: *if-merge-request-title-as-if-foss - <<: *if-merge-request-title-as-if-foss
changes: *code-backstage-patterns changes: *code-backstage-patterns
- <<: *if-merge-request-title-run-all-rspec
- <<: *if-merge-request - <<: *if-merge-request
changes: *ci-patterns changes: *ci-patterns
...@@ -895,7 +921,7 @@ ...@@ -895,7 +921,7 @@
rules: rules:
- <<: *if-not-ee - <<: *if-not-ee
when: never when: never
- <<: *if-merge-request-rspec-minimal-disabled - <<: *if-merge-request-approved
when: never when: never
- <<: *if-merge-request - <<: *if-merge-request
changes: *ci-patterns changes: *ci-patterns
...@@ -904,7 +930,6 @@ ...@@ -904,7 +930,6 @@
changes: *code-backstage-patterns changes: *code-backstage-patterns
- <<: *if-merge-request-title-as-if-foss - <<: *if-merge-request-title-as-if-foss
changes: *code-backstage-patterns changes: *code-backstage-patterns
- <<: *if-merge-request-title-run-all-rspec
.rails:rules:ee-and-foss-db-library-code: .rails:rules:ee-and-foss-db-library-code:
rules: rules:
......
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