OCPBUGS-104505: fix(ci): trigger envtest workflows on dependency changes - #9215
Conversation
|
Pipeline controller notification For optional jobs, comment This repository is configured in: LGTM mode |
|
@clebs: This pull request references Jira Issue OCPBUGS-104505, which is invalid:
Comment The bug has been updated to refer to the pull request using the external bug tracker. 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. |
|
Skipping CI for Draft Pull Request. |
|
Note Reviews pausedIt 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 Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughThe Kubernetes and OpenShift Envtest workflows now log diff references, include Suggested reviewers: 🚥 Pre-merge checks | ✅ 11✅ Passed checks (11 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
/area ci |
|
@clebs: The label(s) 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 kubernetes-sigs/prow repository. |
|
/jira refresh |
|
@clebs: This pull request references Jira Issue OCPBUGS-104505, which is invalid:
Comment 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. |
|
/jira refresh |
|
@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
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. |
|
/area testing |
efb8b8e to
5e17d4d
Compare
|
@clebs: This pull request references Jira Issue OCPBUGS-104505, which is valid. 3 validation(s) were run on this bug
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. |
There was a problem hiding this comment.
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
📒 Files selected for processing (2)
.github/workflows/envtest-kube-reusable.yaml.github/workflows/envtest-ocp-reusable.yaml
5e17d4d to
6af2b26
Compare
| 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 |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
| 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 |
There was a problem hiding this comment.
Same as commented in .github/workflows/envtest-kube-reusable.yaml.
6af2b26 to
f1b21bb
Compare
|
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. |
f1b21bb to
c6f4804
Compare
|
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. |
c6f4804 to
ccaffaf
Compare
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>
ccaffaf to
f1d7fce
Compare
|
Pipeline controller notification No second-stage tests were triggered for this PR. This can happen when:
Use |
|
[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 DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
/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. |
|
@clebs: This PR has been marked as verified by 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. |
|
@clebs: 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. |
|
@clebs: Jira Issue Verification Checks: Jira Issue OCPBUGS-104505 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. 🕓 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. |
|
Fix included in release 5.0.0-0.nightly-2026-08-07-030024 |
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/, andCRDtest asset paths, so dependency changing PRs skipped envtest entirely.Added
go.mod,go.sum, andvendor/to the grep patterns in bothenvtest-kube-reusable.yamlandenvtest-ocp-reusable.yaml.Which issue(s) this PR fixes:
Fixes OCPBUGS-104505
Special notes for your reviewer:
Checklist:
Summary by CodeRabbit