Skip to content

OCPBUGS-104505: fix(ci): trigger envtest workflows on dependency changes - #9215

Merged
openshift-merge-bot[bot] merged 1 commit into
openshift:mainfrom
clebs:envtest-deps-skip
Aug 6, 2026
Merged

OCPBUGS-104505: fix(ci): trigger envtest workflows on dependency changes#9215
openshift-merge-bot[bot] merged 1 commit into
openshift:mainfrom
clebs:envtest-deps-skip

Conversation

@clebs

@clebs clebs commented Aug 4, 2026

Copy link
Copy Markdown
Member

What this PR does / why we need it:

Dependency updates can alter upstream CRD schemas or API types, breaking CEL/API validation rules which envtest checks.
The envtest change-detection regexes only matched api/, test/envtest/, and CRD test asset paths, so dependency changing PRs skipped envtest entirely.

Added go.mod, go.sum, and vendor/ to the grep patterns in both envtest-kube-reusable.yaml and envtest-ocp-reusable.yaml.

Which issue(s) this PR fixes:

Fixes OCPBUGS-104505

Special notes for your reviewer:

Checklist:

  • Subject and description added to both, commit and PR.
  • Relevant issues have been referenced.
  • This change includes docs.
  • This change includes unit tests.

Summary by CodeRabbit

  • Tests
    • Improved automated environment validation workflows for Kubernetes and OpenShift.
    • Validation now runs when vendored dependencies, custom resource definitions, or other relevant project files change.
    • Change detection more reliably handles unavailable or empty comparisons, preventing unnecessary validation runs.
    • Added clearer reporting of comparison references, results, matched files, and validation decisions for easier troubleshooting and more predictable checks.

@openshift-merge-bot

Copy link
Copy Markdown
Contributor

Pipeline controller notification
This repo is configured to use the pipeline controller. Second-stage tests will be triggered either automatically or after lgtm label is added, depending on the repository configuration. The pipeline controller will automatically detect which contexts are required and will utilize /test Prow commands to trigger the second stage.

For optional jobs, comment /test ? to see a list of all defined jobs. To trigger manually all jobs from second stage use /pipeline required command.

This repository is configured in: LGTM mode

@openshift-ci-robot openshift-ci-robot added jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. labels Aug 4, 2026
@openshift-ci-robot

Copy link
Copy Markdown

@clebs: This pull request references Jira Issue OCPBUGS-104505, which is invalid:

  • expected the bug to target the "5.0.0" version, but no target version was set

Comment /jira refresh to re-evaluate validity if changes to the Jira bug are made, or edit the title of this pull request to link to a different bug.

The bug has been updated to refer to the pull request using the external bug tracker.

Details

In response to this:

What this PR does / why we need it:

Dependency updates can alter upstream CRD schemas or API types, breaking CEL/API validation rules which envtest checks.
The envtest change-detection regexes only matched api/, test/envtest/, and CRD test asset paths, so dependency changing PRs skipped envtest entirely.

Added go.mod, go.sum, and vendor/ to the grep patterns in both envtest-kube-reusable.yaml and envtest-ocp-reusable.yaml.

Which issue(s) this PR fixes:

Fixes OCPBUGS-104505

Special notes for your reviewer:

Checklist:

  • Subject and description added to both, commit and PR.
  • Relevant issues have been referenced.
  • This change includes docs.
  • This change includes unit tests.

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.

@openshift-ci openshift-ci Bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Aug 4, 2026
@openshift-ci

openshift-ci Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@coderabbitai

coderabbitai Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

The Kubernetes and OpenShift Envtest workflows now log diff references, include vendor/ and the broader cmd/install/assets/crds/ path in relevant-path checks, and report matched or unmatched files. They explicitly set should_run=true when relevant files are found or diff retrieval fails. They set should_run=false when no relevant files change.

Suggested reviewers: sdminonne

🚥 Pre-merge checks | ✅ 11
✅ Passed checks (11 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the CI fix that triggers envtest workflows when dependency changes occur.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Stable And Deterministic Test Names ✅ Passed The pull request changes only two GitHub Actions YAML workflows; the diff adds no Ginkgo tests or test-title constructs such as It, Describe, Context, or When.
Test Structure And Quality ✅ Passed The PR changes only workflow diff-detection shell; the inspected files contain no Ginkgo It blocks, setup/cleanup, cluster waits, or assertions to review.
Topology-Aware Scheduling Compatibility ✅ Passed The pull request modifies only two envtest GitHub workflow change detectors; it adds no deployment manifests, operator code, controllers, or scheduling constraints.
Ipv6 And Disconnected Network Test Compatibility ✅ Passed The PR changes only two GitHub Actions workflow files and adds no Ginkgo e2e tests or network-dependent test code.
No-Weak-Crypto ✅ Passed The PR changes only envtest workflow shell logic and path regexes; the diff contains no weak algorithms, custom crypto, or secret/token comparisons.
Container-Privileges ✅ Passed The PR changes only two GitHub Actions workflow files. Neither the added lines nor the full changed files contain privileged settings, host namespace flags, SYS_ADMIN, privilege escalation, or root...
No-Sensitive-Data-In-Logs ✅ Passed The new logs print only commit refs, exit codes, and git diff --name-only paths; no passwords, tokens, API keys, PII, hostnames, or customer data are logged.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands.

@bryan-cox bryan-cox left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/approve

@openshift-ci openshift-ci Bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Aug 4, 2026
@clebs

clebs commented Aug 4, 2026

Copy link
Copy Markdown
Member Author

/area ci

@openshift-ci

openshift-ci Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

@clebs: The label(s) area/ci cannot be applied, because the repository doesn't have them.

Details

In response to this:

/area ci

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 kubernetes-sigs/prow repository.

@clebs

clebs commented Aug 4, 2026

Copy link
Copy Markdown
Member Author

/jira refresh

@openshift-ci-robot

Copy link
Copy Markdown

@clebs: This pull request references Jira Issue OCPBUGS-104505, which is invalid:

  • expected the bug to be in one of the following states: NEW, ASSIGNED, POST, but it is MODIFIED instead

Comment /jira refresh to re-evaluate validity if changes to the Jira bug are made, or edit the title of this pull request to link to a different bug.

Details

In response to this:

/jira refresh

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.

@clebs

clebs commented Aug 4, 2026

Copy link
Copy Markdown
Member Author

/jira refresh

@openshift-ci-robot openshift-ci-robot added jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. and removed jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. labels Aug 4, 2026
@openshift-ci-robot

Copy link
Copy Markdown

@clebs: This pull request references Jira Issue OCPBUGS-104505, which is valid. The bug has been moved to the POST state.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target version (5.0.0) matches configured target version for branch (5.0.0)
  • bug is in the state ASSIGNED, which is one of the valid states (NEW, ASSIGNED, POST)
Details

In response to this:

/jira refresh

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.

@clebs

clebs commented Aug 4, 2026

Copy link
Copy Markdown
Member Author

/area testing

@clebs
clebs marked this pull request as ready for review August 4, 2026 16:08
@openshift-ci openshift-ci Bot added area/testing Indicates the PR includes changes for e2e testing and removed do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. do-not-merge/needs-area labels Aug 4, 2026
@openshift-ci
openshift-ci Bot requested review from muraee and sdminonne August 4, 2026 16:13
Comment thread .github/workflows/envtest-kube-reusable.yaml Outdated
@clebs
clebs force-pushed the envtest-deps-skip branch from efb8b8e to 5e17d4d Compare August 4, 2026 18:08
@openshift-ci-robot

Copy link
Copy Markdown

@clebs: This pull request references Jira Issue OCPBUGS-104505, which is valid.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target version (5.0.0) matches configured target version for branch (5.0.0)
  • bug is in the state POST, which is one of the valid states (NEW, ASSIGNED, POST)
Details

In response to this:

What this PR does / why we need it:

Dependency updates can alter upstream CRD schemas or API types, breaking CEL/API validation rules which envtest checks.
The envtest change-detection regexes only matched api/, test/envtest/, and CRD test asset paths, so dependency changing PRs skipped envtest entirely.

Added go.mod, go.sum, and vendor/ to the grep patterns in both envtest-kube-reusable.yaml and envtest-ocp-reusable.yaml.

Which issue(s) this PR fixes:

Fixes OCPBUGS-104505

Special notes for your reviewer:

Checklist:

  • Subject and description added to both, commit and PR.
  • Relevant issues have been referenced.
  • This change includes docs.
  • This change includes unit tests.

Summary by CodeRabbit

  • Tests
  • Improved automated environment validation workflows for Kubernetes and OpenShift.
  • Validation now runs when vendored dependencies change, alongside existing relevant project files.
  • Change detection now handles unavailable or empty comparisons more reliably, reducing unnecessary validation runs.

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/workflows/envtest-kube-reusable.yaml:
- Line 41: Update the change-detection regular expressions in
.github/workflows/envtest-kube-reusable.yaml:41-41 and
.github/workflows/envtest-ocp-reusable.yaml:41-41 to match root-level go.mod and
go.sum in addition to the existing paths, ensuring dependency changes trigger
both envtest workflows.
- Around line 43-44: Replace the head -50 pipeline in the diagnostic diff output
of both .github/workflows/envtest-kube-reusable.yaml lines 43-44 and
.github/workflows/envtest-ocp-reusable.yaml lines 43-44 with a full-input
consumer such as sed -n '1,50p', preserving the existing output and ensuring the
workflow reaches should_run=false under set -euo pipefail.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Central YAML (inherited)

Review profile: CHILL

Plan: Enterprise

Run ID: 3d6a72b2-3b9b-4126-8297-13acdf193898

📥 Commits

Reviewing files that changed from the base of the PR and between efb8b8e and 5e17d4d.

📒 Files selected for processing (2)
  • .github/workflows/envtest-kube-reusable.yaml
  • .github/workflows/envtest-ocp-reusable.yaml

Comment thread .github/workflows/envtest-kube-reusable.yaml Outdated
Comment thread .github/workflows/envtest-kube-reusable.yaml Outdated
@clebs
clebs force-pushed the envtest-deps-skip branch from 5e17d4d to 6af2b26 Compare August 4, 2026 18:28
fi >> "$GITHUB_OUTPUT"
echo "Diff ref: $ref"
pattern='^(api/|test/envtest/|cmd/install/assets/crds/hypershift-operator/tests/|karpenter-operator/controllers/karpenter/assets/tests/|\.github/workflows/envtest-kube(-reusable)?\.yaml$|vendor/)'
if ! matched=$(git diff --name-only "$ref" 2>&1 | grep -E "$pattern"); then

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2>&1 mixes stderr into the grep input. A git warning mentioning a path could cause a false positive match. Consider 2>/dev/null (or 2>"$RUNNER_TEMP/git-diff-stderr") to keep stdout clean for pattern matching, and only dump stderr in the debug branch.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks Meha, good catch!

New approach: single git diff with 2>/dev/null, stderr discarded from grep input avoiding false positives.
If git diff fails, exit code is checked first and defaults to should_run=true. Safe fallback, run tests when uncertain.
Exit code + ref logged for diagnosis.

Comment thread .github/workflows/envtest-ocp-reusable.yaml Outdated
fi >> "$GITHUB_OUTPUT"
echo "Diff ref: $ref"
pattern='^(api/|test/envtest/|cmd/install/assets/crds/hypershift-operator/tests/|karpenter-operator/controllers/karpenter/assets/tests/|\.github/workflows/envtest-ocp(-reusable)?\.yaml$|vendor/)'
if ! matched=$(git diff --name-only "$ref" 2>&1 | grep -E "$pattern"); then

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as commented in .github/workflows/envtest-kube-reusable.yaml.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed as well, thanks!

@clebs
clebs force-pushed the envtest-deps-skip branch from 6af2b26 to f1b21bb Compare August 5, 2026 17:39
@coderabbitai

coderabbitai Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Note

GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer.

@clebs
clebs force-pushed the envtest-deps-skip branch from f1b21bb to c6f4804 Compare August 5, 2026 17:59
@coderabbitai

coderabbitai Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Note

GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer.

@clebs
clebs force-pushed the envtest-deps-skip branch from c6f4804 to ccaffaf Compare August 5, 2026 18:22
Dependency updates can alter upstream CRD schemas or API types,
breaking CEL validation rules. The envtest change-detection regexes
only matched api/, test/envtest/, and CRD test asset paths, so
dependency-only PRs skipped envtest entirely.

Broadened detection under assets and added hack/tools to detect changes
in envtest itself.

Add better logging to github action to see when the git diff trigger is
wrong more clearly.

Approach: single git diff with 2>/dev/null, stderr discarded from grep
input avoiding false positives.
If git diff fails, exit code is checked first and defaults to should_run=true,
safe fallback, run tests when uncertain.
Exit code + ref logged for diagnosis.

Signed-off-by: Borja Clemente <bclement@redhat.com>
@clebs
clebs force-pushed the envtest-deps-skip branch from ccaffaf to f1d7fce Compare August 6, 2026 11:02

@mehabhalodiya mehabhalodiya left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

@openshift-ci openshift-ci Bot added the lgtm Indicates that a PR is ready to be merged. label Aug 6, 2026
@openshift-merge-bot

Copy link
Copy Markdown
Contributor

Pipeline controller notification

No second-stage tests were triggered for this PR.

This can happen when:

  • The changed files don't match any pipeline_run_if_changed patterns
  • All files match pipeline_skip_if_only_changed patterns
  • No pipeline-controlled jobs are defined for the main branch

Use /test ? to see all available tests.

@openshift-ci

openshift-ci Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: bryan-cox, clebs, mehabhalodiya

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@clebs

clebs commented Aug 6, 2026

Copy link
Copy Markdown
Member Author

/verified by @clebs

Using AI, I ran a trigger test for each path and kind of file we are expecting to fire these tests. All of them behaved as expected.

@openshift-ci-robot openshift-ci-robot added the verified Signifies that the PR passed pre-merge verification criteria label Aug 6, 2026
@openshift-ci-robot

Copy link
Copy Markdown

@clebs: This PR has been marked as verified by @clebs.

Details

In response to this:

/verified by @clebs

Using AI, I ran a trigger test for each path and kind of file we are expecting to fire these tests. All of them behaved as expected.

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.

@openshift-ci

openshift-ci Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

@clebs: all tests passed!

Full PR test history. Your PR dashboard.

Details

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 kubernetes-sigs/prow repository. I understand the commands that are listed here.

@openshift-merge-bot
openshift-merge-bot Bot merged commit 78bf2df into openshift:main Aug 6, 2026
29 checks passed
@openshift-ci-robot

Copy link
Copy Markdown

@clebs: Jira Issue Verification Checks: Jira Issue OCPBUGS-104505
✔️ This pull request was pre-merge verified.
✔️ All associated pull requests have merged.
✔️ All associated, merged pull requests were pre-merge verified.

Jira Issue OCPBUGS-104505 has been moved to the MODIFIED state and will move to the VERIFIED state when the change is available in an accepted nightly payload. 🕓

Details

In response to this:

What this PR does / why we need it:

Dependency updates can alter upstream CRD schemas or API types, breaking CEL/API validation rules which envtest checks.
The envtest change-detection regexes only matched api/, test/envtest/, and CRD test asset paths, so dependency changing PRs skipped envtest entirely.

Added go.mod, go.sum, and vendor/ to the grep patterns in both envtest-kube-reusable.yaml and envtest-ocp-reusable.yaml.

Which issue(s) this PR fixes:

Fixes OCPBUGS-104505

Special notes for your reviewer:

Checklist:

  • Subject and description added to both, commit and PR.
  • Relevant issues have been referenced.
  • This change includes docs.
  • This change includes unit tests.

Summary by CodeRabbit

  • Tests
  • Improved automated environment validation workflows for Kubernetes and OpenShift.
  • Validation now runs when vendored dependencies, custom resource definitions, or other relevant project files change.
  • Change detection more reliably handles unavailable or empty comparisons, preventing unnecessary validation runs.
  • Added clearer reporting of comparison references, results, matched files, and validation decisions for easier troubleshooting and more predictable checks.

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.

@clebs
clebs deleted the envtest-deps-skip branch August 6, 2026 13:24
@openshift-merge-robot

Copy link
Copy Markdown
Contributor

Fix included in release 5.0.0-0.nightly-2026-08-07-030024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. area/testing Indicates the PR includes changes for e2e testing jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. lgtm Indicates that a PR is ready to be merged. verified Signifies that the PR passed pre-merge verification criteria

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants