Skip to content

ci: Remove duplicate RSpec jobs

Rémy Coutable requested to merge remove-duplicate-jobs into master

What does this MR do and why?

We have some duplicated jobs. Following is the explanation:

rspec-ee unit pg12:
  extends:
    - .rspec-ee-base-pg12
    - .rails:rules:ee-only-unit
    - .rspec-ee-unit-parallel

# which is equivalent to the following after replacing `.rspec-ee-base-pg12` by its definition

rspec-ee unit pg12:
  extends:
    - .rspec-base
    - .use-pg12-es7-ee
    - .rails:rules:ee-only-unit
    - .rspec-ee-unit-parallel

Then if we do the same thing for rspec-ee unit pg12 es7:

rspec-ee unit pg12 es7:
  extends:
    - .rspec-ee-base-pg12-es7
    - .rspec-ee-unit-parallel
    - .rails:rules:default-branch-schedule-nightly--code-backstage-ee-only

# which is equivalent to the following after replacing `.rspec-ee-base-pg12` by its definition

rspec-ee unit pg12 es7:
  extends:
    - .rspec-base
    - .use-pg12-es7-ee
    - .rails:rules:run-search-tests
    - .rspec-ee-unit-parallel
    - .rails:rules:default-branch-schedule-nightly--code-backstage-ee-only

# .rails:rules:run-search-tests is never used since it's overridden by .rails:rules:default-branch-schedule-nightly--code-backstage-ee-only, so we have:

rspec-ee unit pg12 es7:
  extends:
    - .rspec-base
    - .use-pg12-es7-ee
    - .rspec-ee-unit-parallel
    - .rails:rules:default-branch-schedule-nightly--code-backstage-ee-only

# which is quite similar to 

rspec-ee unit pg12:
  extends:
    - .rspec-base
    - .use-pg12-es7-ee
    - .rails:rules:ee-only-unit
    - .rspec-ee-unit-parallel

Since .rails:rules:default-branch-schedule-nightly--code-backstage-ee-only is:

.rails:rules:default-branch-schedule-nightly--code-backstage-ee-only:
  rules:
    - <<: *if-not-ee
      when: never
    - !reference [".rails:rules:default-branch-schedule-nightly--code-backstage-default-rules", rules]

# which is equivalent to the following after replacing `!reference [".rails:rules:default-branch-schedule-nightly--code-backstage-default-rules", rules]` by its definition

.rails:rules:default-branch-schedule-nightly--code-backstage-ee-only:
  rules:
    - <<: *if-not-ee
      when: never
    - <<: *if-default-branch-schedule-nightly
    - <<: *if-merge-request
      changes: [".gitlab/ci/rails.gitlab-ci.yml"]

Here we can ignore

    - <<: *if-merge-request
      changes: [".gitlab/ci/rails.gitlab-ci.yml"]

since it's covered by .rails:rules:ee-only-unit already, which leave us with <<: *if-default-branch-schedule-nightly, which is also covered by .rails:rules:ee-only-unit with the following rule:

    - <<: *if-default-refs
      changes: *backend-patterns

since changes is always evaluated to true for scheduled pipelines, and if-default-refs includes scheduled pipelines (since it runs for master).

The same logic applies for rspec-ee integration pg12 es7, and rspec-ee system pg12 es7.

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Rémy Coutable

Merge request reports

Loading