Use .frontend-predictive-patterns for jest predictive jobs
Context
Implementation of gitlab-org/quality/engineering-productivity/team#470 (closed).
We would like to run jest predictive
and rspec-all frontend_fixture
jobs less often when the MR isn't approved.
What does this MR do and why?
Add .frontend-predictive-patterns
file pattern, and use it for running jest predictive
and rspec-all frontend_fixture
jobs.
Understanding the changes in this MR
To run jest predictive
jobs on a different pattern is fairly easy because no jobs depend on jest predictive
jobs: we can pretty much just change the pattern.
To run rspec-all frontend_fixture
jobs on a different pattern is not trivial, because they are needed by other jobs.
Rationale: For all jobs depending on rspec-all frontend_fixture
, we need to think about when an MR isn't approved, where would the rspec-all frontend_fixture
not being present be a problem...
rspec-all frontend_fixture
Jobs depending on -
upload-frontend-fixtures
- Dependencies: Not needed by other CI jobs.
-
Problem: This rule would be an issue if the MR isn't approved, as we wouldn't run
rspec-all frontend_fixture
. -
Fix: Added a
when: never
forif-merge-request-not-approved
-
jest
-
Dependencies: Needed by other CI jobs.
-
jest vue3
- No conflicts: not running on MRs
-
jest predictive
- No conflicts: they don't run if the MR isn't approved by design
-
Problem: Those rules would be an issue if the MR isn't approved, as we wouldn't run
rspec-all frontend_fixture
in most cases. -
Fix: Ensure we run the
rspec-all frontend_fixture
jobs on those conditions.
-
-
Dependencies: Needed by other CI jobs.
-
jest-integration
- Dependencies: Not needed by other CI jobs.
-
Problem: Uses
.frontend:rules:default-frontend-jobs
, which I don't want to change in this MR, because it is used in too many places. -
Fix: Added a new rule based on
.frontend:rules:default-frontend-jobs
(similar technique used forjest
jobs and other frontend jobs)
-
jest-snapshot-vue3
- Dependencies: Not needed by other CI jobs.
-
Problem: Those rules would be an issue if the MR isn't approved, as we wouldn't run
rspec-all frontend_fixture
in most cases. -
Fix: Ensure we run the
rspec-all frontend_fixture
jobs on those conditions.
-
compile-storybook
-
Dependencies: Needed by other CI jobs.
-
pages
- No conflicts: not running on MRs
-
-
Problem: Uses
.frontend:rules:default-frontend-jobs
, which I don't want to change in this MR, because it is used in too many places. -
Fix: Added a new rule based on
.frontend:rules:default-frontend-jobs
(similar technique used forjest
jobs and other frontend jobs)
-
Dependencies: Needed by other CI jobs.
-
update-tests-metadata
-
Dependencies: Needed by other CI jobs.
-
pages
- No conflicts: not running on MRs
-
Problem: This rules would be an issue if the MR isn't approved, as we wouldn't run
rspec-all frontend_fixture
in most cases. -
Fix: Added a
when: never
forif-merge-request-not-approved
-
-
Dependencies: Needed by other CI jobs.
Proof of work
See pipelines for the test MR:
-
✅ The changes should NOT trigger predictive tests (pipeline) -
✅ The changes SHOULD trigger predictive tests (pipeline)
MR acceptance checklist
Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.