diff options
Diffstat (limited to '.gitlab/ci/rules.gitlab-ci.yml')
-rw-r--r-- | .gitlab/ci/rules.gitlab-ci.yml | 346 |
1 files changed, 169 insertions, 177 deletions
diff --git a/.gitlab/ci/rules.gitlab-ci.yml b/.gitlab/ci/rules.gitlab-ci.yml index c61819d0a4c..ab5c56214be 100644 --- a/.gitlab/ci/rules.gitlab-ci.yml +++ b/.gitlab/ci/rules.gitlab-ci.yml @@ -593,7 +593,6 @@ ################## # Conditions set # ################## - .strict-ee-only-rules: rules: - <<: *if-not-ee @@ -610,15 +609,6 @@ - <<: *if-merge-request-labels-pipeline-expedite when: never -.rails:rules:predictive-default-rules: - rules: - - <<: *if-merge-request-approved - when: never - - <<: *if-automated-merge-request - when: never - - <<: *if-security-merge-request - when: never - .rails:rules:run-search-tests: rules: - !reference [".rails:rules:default-branch-schedule-nightly--code-backstage-ee-only", rules] @@ -639,6 +629,40 @@ - <<: *if-merge-request-not-approved when: never +.rails:rules:system-default-rules: + rules: + - <<: *if-merge-request-labels-run-all-rspec + - <<: *if-merge-request + changes: *core-backend-patterns + - <<: *if-merge-request + changes: *workhorse-patterns + - <<: *if-automated-merge-request + changes: *code-backstage-patterns + - <<: *if-security-merge-request + changes: *code-backstage-patterns + - <<: *if-merge-request-not-approved + when: never + +.rails:rules:previous-failed-tests-default-rules: + rules: + - <<: *if-security-merge-request + when: never + - <<: *if-merge-request-labels-run-all-rspec + - <<: *if-merge-request + changes: *code-backstage-patterns + +########################### +# Conditions set for JiHu # +########################### +.rails:rules:predictive-default-rules: + rules: + - <<: *if-merge-request-approved + when: never + - <<: *if-automated-merge-request + when: never + - <<: *if-security-merge-request + when: never + .rails:rules:as-if-foss-migration-unit-integration:predictive-default-rules: rules: - <<: *if-merge-request @@ -654,43 +678,115 @@ when: never - !reference [".rails:rules:as-if-foss-migration-unit-integration:predictive-default-rules", rules] -.rails:rules:system-default-rules: +.rails:rules:system:predictive-default-rules: rules: - <<: *if-merge-request-labels-run-all-rspec + when: never - <<: *if-merge-request changes: *core-backend-patterns + when: never - <<: *if-merge-request changes: *workhorse-patterns - - <<: *if-automated-merge-request - changes: *code-backstage-patterns - - <<: *if-security-merge-request - changes: *code-backstage-patterns - - <<: *if-merge-request-not-approved when: never + - <<: *if-merge-request + changes: *ci-patterns + when: never + - <<: *if-merge-request + changes: *code-backstage-patterns -.rails:rules:system:predictive-default-rules: +.rails:rules:ee-and-foss-migration:predictive: rules: - - <<: *if-merge-request-labels-run-all-rspec + - <<: *if-fork-merge-request + changes: *db-patterns + - !reference [".rails:rules:predictive-default-rules", rules] + - !reference [".rails:rules:unit-integration:predictive-default-rules", rules] + # When DB schema changes, many migrations spec may be affected. However, the test mapping from Crystalball does not map db change to a specific migration spec well. + # See https://gitlab.com/gitlab-org/gitlab/-/merge_requests/68840. + - <<: *if-merge-request + changes: *db-patterns when: never + +.rails:rules:ee-and-foss-background-migration:predictive: + rules: + - !reference [".rails:rules:ee-and-foss-migration:predictive", rules] - <<: *if-merge-request - changes: *core-backend-patterns + changes: *backend-patterns + +.rails:rules:ee-and-foss-unit:predictive: + rules: + - <<: *if-fork-merge-request + changes: *backend-patterns + - !reference [".rails:rules:predictive-default-rules", rules] + - !reference [".rails:rules:unit-integration:predictive-default-rules", rules] + - <<: *if-merge-request + changes: *backend-patterns + - <<: *if-merge-request + changes: *backstage-patterns + +.rails:rules:ee-and-foss-integration:predictive: + rules: + - <<: *if-fork-merge-request + changes: *backend-patterns + - !reference [".rails:rules:predictive-default-rules", rules] + - !reference [".rails:rules:unit-integration:predictive-default-rules", rules] + - <<: *if-merge-request + changes: *backend-patterns + +.rails:rules:ee-and-foss-system:predictive: + rules: + - <<: *if-fork-merge-request + changes: *code-backstage-patterns + - !reference [".rails:rules:predictive-default-rules", rules] + - !reference [".rails:rules:system:predictive-default-rules", rules] + +.rails:rules:ee-only-migration:predictive: + rules: + - <<: *if-not-ee when: never + - !reference [".rails:rules:predictive-default-rules", rules] + - !reference [".rails:rules:unit-integration:predictive-default-rules", rules] + # When DB schema changes, many migrations spec may be affected. However, the test mapping from Crystalball does not map db change to a specific migration spec well. + # See https://gitlab.com/gitlab-org/gitlab/-/merge_requests/68840. - <<: *if-merge-request - changes: *workhorse-patterns + changes: *db-patterns when: never + +.rails:rules:ee-only-background-migration:predictive: + rules: + - !reference [".rails:rules:ee-only-migration:predictive", rules] - <<: *if-merge-request - changes: *ci-patterns + changes: *backend-patterns + +.rails:rules:ee-only-unit:predictive: + rules: + - <<: *if-not-ee when: never + - <<: *if-fork-merge-request + changes: *backend-patterns + - !reference [".rails:rules:predictive-default-rules", rules] + - !reference [".rails:rules:unit-integration:predictive-default-rules", rules] - <<: *if-merge-request - changes: *code-backstage-patterns + changes: *backend-patterns -.rails:rules:previous-failed-tests-default-rules: +.rails:rules:ee-only-integration:predictive: rules: - - <<: *if-security-merge-request + - <<: *if-not-ee when: never - - <<: *if-merge-request-labels-run-all-rspec + - <<: *if-fork-merge-request + changes: *backend-patterns + - !reference [".rails:rules:predictive-default-rules", rules] + - !reference [".rails:rules:unit-integration:predictive-default-rules", rules] - <<: *if-merge-request + changes: *backend-patterns + +.rails:rules:ee-only-system:predictive: + rules: + - <<: *if-not-ee + when: never + - <<: *if-fork-merge-request changes: *code-backstage-patterns + - !reference [".rails:rules:predictive-default-rules", rules] + - !reference [".rails:rules:system:predictive-default-rules", rules] ################ # Shared rules # @@ -773,6 +869,16 @@ - <<: *if-default-refs changes: *code-qa-patterns +.build-images:rules:build-assets-image-as-if-foss: + rules: + - <<: *if-not-canonical-namespace + when: never + - <<: *if-not-ee + when: never + - <<: *if-merge-request-labels-pipeline-expedite + when: never + - !reference [".build-images:rules:build-assets-image", "rules"] + ################# # Caching rules # ################# @@ -941,6 +1047,16 @@ - <<: *if-default-refs changes: *workhorse-patterns +.frontend:rules:compile-production-assets-as-if-foss: + rules: + - <<: *if-not-canonical-namespace + when: never + - <<: *if-not-ee + when: never + - <<: *if-merge-request-labels-pipeline-expedite + when: never + - !reference [.frontend:rules:compile-production-assets, rules] + .frontend:rules:compile-test-assets: rules: - <<: *if-merge-request-labels-run-all-rspec @@ -1233,7 +1349,7 @@ when: manual allow_failure: true -.qa:rules:package-and-test: +.qa:rules:package-and-test-ee: rules: - !reference [".qa:rules:package-and-test-mrs", rules] - <<: *if-dot-com-gitlab-org-schedule @@ -1246,11 +1362,23 @@ QA_SAVE_TEST_METRICS: "true" QA_EXPORT_TEST_METRICS: "false" # on main runs, metrics are exported to separate bucket via rake task for better consistency +.qa:rules:package-and-test-ce: + rules: + - <<: *if-not-canonical-namespace + when: never + - <<: *if-not-ee + when: never + - <<: *if-merge-request-labels-pipeline-expedite + when: never + - <<: *if-dot-com-gitlab-org-and-security-merge-request + when: manual + allow_failure: true + .qa:rules:e2e:test-on-gdk: rules: - if: '$QA_RUN_TESTS_ON_GDK !~ /true|yes|1/i' when: never - - !reference [".qa:rules:package-and-test", rules] + - !reference [".qa:rules:package-and-test-ee", rules] ############### # Rails rules # @@ -1335,17 +1463,18 @@ - <<: *if-default-refs changes: *db-patterns -.rails:rules:ee-and-foss-migration:predictive: +.rails:rules:rspec-predictive: rules: - - <<: *if-fork-merge-request - changes: *db-patterns - - !reference [".rails:rules:predictive-default-rules", rules] - - !reference [".rails:rules:unit-integration:predictive-default-rules", rules] - # When DB schema changes, many migrations spec may be affected. However, the test mapping from Crystalball does not map db change to a specific migration spec well. - # See https://gitlab.com/gitlab-org/gitlab/-/merge_requests/68840. - - <<: *if-merge-request - changes: *db-patterns + - <<: *if-merge-request-approved + when: never + - <<: *if-automated-merge-request + when: never + - <<: *if-security-merge-request when: never + - <<: *if-merge-request-labels-run-all-rspec + when: never + - <<: *if-merge-request + changes: *code-backstage-patterns .rails:rules:ee-and-foss-background-migration: rules: @@ -1353,12 +1482,6 @@ - <<: *if-default-refs changes: *backend-patterns -.rails:rules:ee-and-foss-background-migration:predictive: - rules: - - !reference [".rails:rules:ee-and-foss-migration:predictive", rules] - - <<: *if-merge-request - changes: *backend-patterns - .rails:rules:ee-and-foss-mr-with-migration: rules: - <<: *if-merge-request @@ -1383,17 +1506,6 @@ - <<: *if-default-refs changes: *backstage-patterns -.rails:rules:ee-and-foss-unit:predictive: - rules: - - <<: *if-fork-merge-request - changes: *backend-patterns - - !reference [".rails:rules:predictive-default-rules", rules] - - !reference [".rails:rules:unit-integration:predictive-default-rules", rules] - - <<: *if-merge-request - changes: *backend-patterns - - <<: *if-merge-request - changes: *backstage-patterns - .rails:rules:ee-and-foss-integration: rules: - <<: *if-fork-merge-request @@ -1402,15 +1514,6 @@ - <<: *if-default-refs changes: *backend-patterns -.rails:rules:ee-and-foss-integration:predictive: - rules: - - <<: *if-fork-merge-request - changes: *backend-patterns - - !reference [".rails:rules:predictive-default-rules", rules] - - !reference [".rails:rules:unit-integration:predictive-default-rules", rules] - - <<: *if-merge-request - changes: *backend-patterns - .rails:rules:ee-and-foss-system: rules: - <<: *if-fork-merge-request @@ -1419,13 +1522,6 @@ - <<: *if-default-refs changes: *code-backstage-patterns -.rails:rules:ee-and-foss-system:predictive: - rules: - - <<: *if-fork-merge-request - changes: *code-backstage-patterns - - !reference [".rails:rules:predictive-default-rules", rules] - - !reference [".rails:rules:system:predictive-default-rules", rules] - .rails:rules:ee-and-foss-fast_spec_helper: rules: - <<: *if-merge-request-labels-run-all-rspec @@ -1460,30 +1556,12 @@ - <<: *if-default-refs changes: *db-patterns -.rails:rules:ee-only-migration:predictive: - rules: - - <<: *if-not-ee - when: never - - !reference [".rails:rules:predictive-default-rules", rules] - - !reference [".rails:rules:unit-integration:predictive-default-rules", rules] - # When DB schema changes, many migrations spec may be affected. However, the test mapping from Crystalball does not map db change to a specific migration spec well. - # See https://gitlab.com/gitlab-org/gitlab/-/merge_requests/68840. - - <<: *if-merge-request - changes: *db-patterns - when: never - .rails:rules:ee-only-background-migration: rules: - !reference [".rails:rules:ee-only-migration", rules] - <<: *if-default-refs changes: *backend-patterns -.rails:rules:ee-only-background-migration:predictive: - rules: - - !reference [".rails:rules:ee-only-migration:predictive", rules] - - <<: *if-merge-request - changes: *backend-patterns - .rails:rules:ee-only-unit: rules: - <<: *if-not-ee @@ -1494,17 +1572,6 @@ - <<: *if-default-refs changes: *backend-patterns -.rails:rules:ee-only-unit:predictive: - rules: - - <<: *if-not-ee - when: never - - <<: *if-fork-merge-request - changes: *backend-patterns - - !reference [".rails:rules:predictive-default-rules", rules] - - !reference [".rails:rules:unit-integration:predictive-default-rules", rules] - - <<: *if-merge-request - changes: *backend-patterns - .rails:rules:ee-only-integration: rules: - <<: *if-not-ee @@ -1515,17 +1582,6 @@ - <<: *if-default-refs changes: *backend-patterns -.rails:rules:ee-only-integration:predictive: - rules: - - <<: *if-not-ee - when: never - - <<: *if-fork-merge-request - changes: *backend-patterns - - !reference [".rails:rules:predictive-default-rules", rules] - - !reference [".rails:rules:unit-integration:predictive-default-rules", rules] - - <<: *if-merge-request - changes: *backend-patterns - .rails:rules:ee-only-system: rules: - <<: *if-not-ee @@ -1536,15 +1592,6 @@ - <<: *if-default-refs changes: *code-backstage-patterns -.rails:rules:ee-only-system:predictive: - rules: - - <<: *if-not-ee - when: never - - <<: *if-fork-merge-request - changes: *code-backstage-patterns - - !reference [".rails:rules:predictive-default-rules", rules] - - !reference [".rails:rules:system:predictive-default-rules", rules] - .rails:rules:as-if-foss-migration: rules: - <<: *if-not-ee @@ -1563,30 +1610,12 @@ - <<: *if-merge-request-not-approved when: never -.rails:rules:as-if-foss-migration:predictive: - rules: - - <<: *if-not-ee - when: never - - !reference [".rails:rules:predictive-default-rules", rules] - - !reference [".rails:rules:as-if-foss-migration-unit-integration:predictive-default-rules", rules] - # When DB schema changes, many migrations spec may be affected. However, the test mapping from Crystalball does not map db change to a specific migration spec well. - # See https://gitlab.com/gitlab-org/gitlab/-/merge_requests/68840. - - <<: *if-merge-request-labels-as-if-foss - changes: *db-patterns - when: never - .rails:rules:as-if-foss-background-migration: rules: - !reference [".rails:rules:as-if-foss-migration", rules] - <<: *if-merge-request-labels-as-if-foss changes: *backend-patterns -.rails:rules:as-if-foss-background-migration:predictive: - rules: - - !reference [".rails:rules:as-if-foss-migration:predictive", rules] - - <<: *if-merge-request-labels-as-if-foss - changes: *backend-patterns - .rails:rules:as-if-foss-unit: rules: - <<: *if-not-ee @@ -1597,17 +1626,6 @@ - <<: *if-merge-request-labels-as-if-foss changes: *backend-patterns -.rails:rules:as-if-foss-unit:predictive: - rules: - - <<: *if-not-ee - when: never - - <<: *if-fork-merge-request - when: never - - !reference [".rails:rules:predictive-default-rules", rules] - - !reference [".rails:rules:as-if-foss-migration-unit-integration:predictive-default-rules", rules] - - <<: *if-merge-request-labels-as-if-foss - changes: *backend-patterns - .rails:rules:as-if-foss-integration: rules: - <<: *if-not-ee @@ -1618,17 +1636,6 @@ - <<: *if-merge-request-labels-as-if-foss changes: *backend-patterns -.rails:rules:as-if-foss-integration:predictive: - rules: - - <<: *if-not-ee - when: never - - <<: *if-fork-merge-request - when: never - - !reference [".rails:rules:predictive-default-rules", rules] - - !reference [".rails:rules:as-if-foss-migration-unit-integration:predictive-default-rules", rules] - - <<: *if-merge-request-labels-as-if-foss - changes: *backend-patterns - .rails:rules:as-if-foss-system: rules: - <<: *if-not-ee @@ -1639,25 +1646,6 @@ - <<: *if-merge-request-labels-as-if-foss changes: *code-backstage-patterns -.rails:rules:as-if-foss-system:predictive: - rules: - - <<: *if-not-ee - when: never - - <<: *if-fork-merge-request - when: never - - !reference [".rails:rules:predictive-default-rules", rules] - - <<: *if-merge-request - changes: *core-backend-patterns - when: never - - <<: *if-merge-request - changes: *workhorse-patterns - when: never - - <<: *if-merge-request - changes: *ci-patterns - when: never - - <<: *if-merge-request-labels-as-if-foss - changes: *code-backstage-patterns - .rails:rules:ee-and-foss-db-library-code: rules: - <<: *if-default-refs @@ -1749,6 +1737,10 @@ when: never - <<: *if-merge-request-labels-skip-undercoverage when: never + # We cannot get the coverage data from child pipeline so we only run undercoverage on full pipelines for now + # See https://gitlab.com/gitlab-org/gitlab/-/merge_requests/113410#note_1335422806 + - <<: *if-merge-request-not-approved + when: never - <<: *if-merge-request-labels-run-all-rspec - <<: *if-merge-request changes: *backend-patterns |