CNTRLPLANE-3771: fix /rebase GHA workflow for fork PRs - #8934
Conversation
|
Pipeline controller notification For optional jobs, comment This repository is configured in: LGTM mode |
|
@bryan-cox: This pull request references CNTRLPLANE-3771 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. |
316226c to
c08d508
Compare
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: bryan-cox 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 |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository YAML (base), Central YAML (inherited) Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (4)
🚧 Files skipped from review as they are similar to previous changes (4)
📝 WalkthroughWalkthroughThis PR updates four GitHub Actions workflows. 🚥 Pre-merge checks | ✅ 11✅ Passed checks (11 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 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/reusable-claude-on-pr.yaml:
- Around line 83-92: The “Add upstream remote” step in the reusable-claude-on-pr
workflow force-updates the local main branch in a way that fails when main is
currently checked out. Replace the `git branch -f main upstream/main` operation
in that step with a ref update using `git update-ref` so the local main ref can
be moved safely even when the checked-out branch is main, while keeping the
existing upstream fetch logic and branch setup intact.
🪄 Autofix (Beta)
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: 428060f1-16fb-4fe0-b4af-81231883eb37
📒 Files selected for processing (4)
.github/workflows/address-review-comments.yaml.github/workflows/rebase.yaml.github/workflows/restructure-commits.yaml.github/workflows/reusable-claude-on-pr.yaml
The /rebase command silently failed on fork PRs because actions/checkout sets origin to the fork, so git fetch origin main fetched the fork's stale main instead of openshift/hypershift main. Add an upstream remote setup step in the reusable workflow for fork PRs, and update all three caller prompts with push-failure error handling for forks that don't allow maintainer edits. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
c08d508 to
a981279
Compare
|
Now I have all the evidence needed for a complete analysis. The build log is very clear about the root cause. Let me produce the final report. Test Failure Analysis CompleteJob Information
Test Failure AnalysisErrorSummaryThe Root CauseThe root cause is a transient network/infrastructure failure on Key observations:
Recommendations
Evidence
|
|
/retest |
|
/lgtm |
|
Pipeline controller notification No second-stage tests were triggered for this PR. This can happen when:
Use |
|
/verified later @bryan-cox |
|
@bryan-cox: This PR has been marked to be verified later 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. |
|
@bryan-cox: The following tests failed, say
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. |
What this PR does / why we need it:
The
/rebaseGitHub Actions command silently failed on fork PRs. When triggered on PR #8802 (fromstevekuznetsov/hypershift), the workflow reported success but the PR was not actually rebased.Root cause:
actions/checkoutsetsoriginto the fork repo. The rebase prompt told Claude togit fetch origin main/git rebase origin/main, which fetched the fork's stalemain— making the rebase a no-op.Fix (two layers):
Infrastructure (
reusable-claude-on-pr.yaml): Added "Add upstream remote" step after checkout. For fork PRs, addsupstream→openshift/hypershift, fetches main, and creates a localmainbranch pointing atupstream/main(needed by/restructure-commitswhich uses baregit merge-base main HEAD).Prompts (
rebase.yaml,restructure-commits.yaml,address-review-comments.yaml): Updated to use the pre-configuredupstreamremote, and added push-failure error handling — if push to a user fork fails because "Allow edits from maintainers" is disabled, Claude posts an informative PR comment instead of silently failing.Which issue(s) this PR fixes:
Fixes CNTRLPLANE-3771
Special notes for your reviewer:
Traced through all three PR scenarios to verify no regressions:
hypershift-community/hypershift): upstream remote added, app token used for push — worksstevekuznetsov/hypershift): upstream remote added, push may fail without "Allow edits from maintainers" — now reports error clearlyopenshift/hypershift): upstream step skipped entirely — no behavior changeChecklist:
Summary by CodeRabbit