OSAC-1378: add skip_if_only_changed to reduce unnecessary CI runs#80513
OSAC-1378: add skip_if_only_changed to reduce unnecessary CI runs#80513amej wants to merge 3 commits into
Conversation
Add skip_if_only_changed filters to three fulfillment-service presubmit jobs to reduce unnecessary CI resource usage when only documentation, charts, or integration test infrastructure changes. Changes: - Unit test: Skip when only docs, LICENSE, charts, integration tests, or GitHub workflows change Pattern: ^.*(md|adoc)$|^LICENSE$|^charts/|^it/|^\.github/workflows/ - Images job: Skip when only docs, LICENSE, GitHub workflows, or integration test charts change Pattern: ^.*(md|adoc)$|^LICENSE$|^\.github/workflows/|^it/charts/ - E2E VMaaS test: Skip only for pure documentation changes (most permissive) Pattern: ^.*(md|adoc)$|^LICENSE$|^\.github/workflows/ All jobs now have always_run: false (set automatically by prowgen) and will only run when relevant files change. This follows OpenShift CI best practices using skip_if_only_changed for simpler, more maintainable patterns. Assisted-by: Claude Code <noreply@anthropic.com> rh-pre-commit.version: 2.4.0 rh-pre-commit.check-secrets: ENABLED
Fix the skip_if_only_changed patterns to correctly match only files with .md or .adoc extensions, not files with 'md' or 'adoc' anywhere in their path. Changed: ^.*(md|adoc)$ to ^.*\.(md|adoc)$ Without escaping the dot before the extension, the pattern would incorrectly match files like cmd/server.go (contains 'md' substring). Assisted-by: Claude Code <noreply@anthropic.com> rh-pre-commit.version: 2.4.0 rh-pre-commit.check-secrets: ENABLED
|
Skipping CI for Draft Pull Request. |
|
@amej: This pull request references [OSAC-1378](https://redhat.atlassian.net/browse/OS[AC-1](https://redhat.atlassian.net/browse/AC-1)378) which is a valid jira issue. Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the task to target the "5.0.0" version, but no target version was set. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
|
@amej: This pull request references [OSAC-1378](https://redhat.atlassian.net/browse/OS[AC-1](https://redhat.atlassian.net/browse/AC-1)378) which is a valid jira issue. Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the task to target the "5.0.0" version, but no target version was set. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: amej The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
WalkthroughThe CI pipeline configuration for ChangesTest Skip Configuration
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes Possibly related PRs
Suggested reviewers
🚥 Pre-merge checks | ✅ 15✅ Passed checks (15 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
@amej: This pull request references [OSAC-1378](https://redhat.atlassian.net/browse/OS[AC-1](https://redhat.atlassian.net/browse/AC-1)378) which is a valid jira issue. Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the task to target the "5.0.0" version, but no target version was set. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
|
/pj-rehearse auto-ack |
|
@amej: now processing your pj-rehearse request. Please allow up to 10 minutes for jobs to trigger or cancel. |
|
/test all |
Per user feedback, images should always build for safety. Only unit and e2e-vmaas tests will have conditional filtering. rh-pre-commit.version: 2.4.0 rh-pre-commit.check-secrets: ENABLED
|
@amej: This pull request references OSAC-1378 which is a valid jira issue. Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the task to target the "5.0.0" version, but no target version was set. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
Revision AppliedPer user feedback, removed the Change: Images will now always build on every PR (safer approach). Rationale:
Updated behavior:
Latest commit: 1990117 |
|
[REHEARSALNOTIFIER]
Interacting with pj-rehearseComment: Once you are satisfied with the results of the rehearsals, comment: |
|
@amej: all tests passed! Full PR test history. Your PR dashboard. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
OSAC-1378: add skip_if_only_changed to reduce unnecessary CI runs
Jira: https://redhat.atlassian.net/browse/OS[AC-1](https://redhat.atlassian.net/browse/AC-1)378
Story type: [DEV]
Summary
This PR optimizes CI resource usage for the fulfillment-service repository by adding
skip_if_only_changedfilters to two presubmit test jobs (unit and e2e-vmaas). Previously, all jobs ran on every PR regardless of changed files. Now, test jobs intelligently skip when only documentation or unrelated files change, while images always build for safety.Changes
CI Operator Config (
ci-operator/config/osac-project/fulfillment-service/osac-project-fulfillment-service-main.yaml):skip_if_only_changed: ^.*\.(md|adoc)$|^LICENSE$|^charts/|^it/|^\.github/workflows/to unit testskip_if_only_changed: ^.*\.(md|adoc)$|^LICENSE$|^\.github/workflows/to e2e-vmaas testProw Jobs (
ci-operator/jobs/osac-project/fulfillment-service/osac-project-fulfillment-service-main-presubmits.yaml):make updatealways_run: falsewith skip patternsalways_run: true(no filtering, builds on every PR)Testing
Validation performed:
Post-merge testing plan:
Create test PRs in fulfillment-service repository to verify runtime behavior:
Key Implementation Detail
During validation, discovered and fixed a critical regex bug where
^.*(md|adoc)$would incorrectly match files likecmd/server.go(contains 'md' substring). Fixed to^.*\.(md|adoc)$(escaped dot) to only match file extensions.Acceptance Criteria
Summary by CodeRabbit
This PR optimizes CI resource usage for the fulfillment-service repository by adding conditional skip patterns to three presubmit jobs in the OpenShift CI infrastructure. Jobs will now skip execution when only documentation, license files, configuration, and integration test infrastructure are modified.
Changes Made
CI Operator Configuration (
ci-operator/config/osac-project/fulfillment-service/osac-project-fulfillment-service-main.yaml):skip_if_only_changedpatterns to the images build definitionskip_if_only_changedpatterns to the unit test jobskip_if_only_changedpatterns to the e2e-vmaas test jobThe patterns are tailored by job purpose:
.md/.adocfiles,LICENSE,charts/,it/, and.github/workflows/.md/.adocfiles,LICENSE,.github/workflows/, andit/charts/.md/.adocfiles,LICENSE, and.github/workflows/only (most permissive since integration testing requires broader artifact availability)Prow Jobs Configuration (
ci-operator/jobs/osac-project/fulfillment-service/osac-project-fulfillment-service-main-presubmits.yaml):skip_if_only_changedpatterns on all three presubmit jobsalways_run: falseto enable the skip logicImplementation Details
A critical bug fix was applied during development: the original regex pattern
^.*(md|adoc)$was corrected to^.*\.(md|adoc)$. The original pattern would incorrectly match any file containing 'md' or 'adoc' as substrings (e.g.,cmd/server.go). The corrected pattern with an escaped dot properly matches only files with.mdor.adocextensions.