Skip to content

CNTRLPLANE-3771: fix /rebase GHA workflow for fork PRs - #8934

Merged
openshift-merge-bot[bot] merged 1 commit into
openshift:mainfrom
bryan-cox:fix-rebase-fork-prs
Jul 6, 2026
Merged

CNTRLPLANE-3771: fix /rebase GHA workflow for fork PRs#8934
openshift-merge-bot[bot] merged 1 commit into
openshift:mainfrom
bryan-cox:fix-rebase-fork-prs

Conversation

@bryan-cox

@bryan-cox bryan-cox commented Jul 6, 2026

Copy link
Copy Markdown
Member

What this PR does / why we need it:

The /rebase GitHub Actions command silently failed on fork PRs. When triggered on PR #8802 (from stevekuznetsov/hypershift), the workflow reported success but the PR was not actually rebased.

Root cause: actions/checkout sets origin to the fork repo. The rebase prompt told Claude to git fetch origin main / git rebase origin/main, which fetched the fork's stale main — making the rebase a no-op.

Fix (two layers):

  1. Infrastructure (reusable-claude-on-pr.yaml): Added "Add upstream remote" step after checkout. For fork PRs, adds upstreamopenshift/hypershift, fetches main, and creates a local main branch pointing at upstream/main (needed by /restructure-commits which uses bare git merge-base main HEAD).

  2. Prompts (rebase.yaml, restructure-commits.yaml, address-review-comments.yaml): Updated to use the pre-configured upstream remote, 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:

  • Community fork (hypershift-community/hypershift): upstream remote added, app token used for push — works
  • User fork (e.g., stevekuznetsov/hypershift): upstream remote added, push may fail without "Allow edits from maintainers" — now reports error clearly
  • Same-repo (openshift/hypershift): upstream step skipped entirely — no behavior change

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

  • Bug Fixes
    • Improved handling when automated PR updates can’t be published due to permission/authentication limits, including clearer PR guidance on enabling maintainer edits.
    • Enhanced rebase and commit-restructure automation with safer, more explicit push behavior (only reporting success after a successful push) and clearer failure messaging.
  • New Features
    • Added conditional remote setup for PR builds to ensure the correct upstream branch is used when the PR originates from a different repository.

@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 the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Jul 6, 2026
@openshift-ci-robot

openshift-ci-robot commented Jul 6, 2026

Copy link
Copy Markdown

@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.

Details

In response to this:

What this PR does / why we need it:

The /rebase GitHub Actions command silently failed on fork PRs. When triggered on PR #8802 (from stevekuznetsov/hypershift), the workflow reported success but the PR was not actually rebased.

Root cause: actions/checkout sets origin to the fork repo. The rebase prompt told Claude to git fetch origin main / git rebase origin/main, which fetched the fork's stale main — making the rebase a no-op.

Fix (two layers):

  1. Infrastructure (reusable-claude-on-pr.yaml): Added "Add upstream remote" step after checkout. For fork PRs, adds upstreamopenshift/hypershift, fetches main, and creates a local main branch pointing at upstream/main (needed by /restructure-commits which uses bare git merge-base main HEAD).

  2. Prompts (rebase.yaml, restructure-commits.yaml, address-review-comments.yaml): Updated to use the pre-configured upstream remote, 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:

  • Community fork (hypershift-community/hypershift): upstream remote added, app token used for push — works
  • User fork (e.g., stevekuznetsov/hypershift): upstream remote added, push may fail without "Allow edits from maintainers" — now reports error clearly
  • Same-repo (openshift/hypershift): upstream step skipped entirely — no behavior change

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 do-not-merge/needs-area needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. labels Jul 6, 2026
@bryan-cox
bryan-cox force-pushed the fix-rebase-fork-prs branch from 316226c to c08d508 Compare July 6, 2026 12:37
@openshift-ci
openshift-ci Bot requested review from muraee and sdminonne July 6, 2026 12:38
@openshift-ci openshift-ci Bot added area/ai Indicates the PR includes changes related to AI - Claude agents, Cursor rules, etc. area/api Indicates the PR includes changes for the API area/ci-tooling Indicates the PR includes changes for CI or tooling area/cli Indicates the PR includes changes for CLI area/control-plane-operator Indicates the PR includes changes for the control plane operator - in an OCP release area/documentation Indicates the PR includes changes for documentation area/hypershift-operator Indicates the PR includes changes for the hypershift operator and API - outside an OCP release area/platform/aws PR/issue for AWS (AWSPlatform) platform area/platform/azure PR/issue for Azure (AzurePlatform) platform area/platform/gcp PR/issue for GCP (GCPPlatform) platform area/platform/ibmcloud PR/issue for IBMCloud (IBMCloudPlatform) platform area/platform/kubevirt PR/issue for KubeVirt (KubevirtPlatform) platform area/platform/none PR/issue for None (NonePlatform) platform - user-supplied infrastructure area/platform/openstack PR/issue for OpenStack (OpenStackPlatform) platform area/platform/powervs PR/issue for PowerVS (PowerVSPlatform) platform area/testing Indicates the PR includes changes for e2e testing and removed do-not-merge/needs-area needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. labels Jul 6, 2026
@openshift-ci

openshift-ci Bot commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

[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

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

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

coderabbitai Bot commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

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

Review profile: CHILL

Plan: Enterprise

Run ID: 2a0b4221-38e5-4b23-ba5b-e8c7f98a80a0

📥 Commits

Reviewing files that changed from the base of the PR and between c08d508 and a981279.

📒 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
🚧 Files skipped from review as they are similar to previous changes (4)
  • .github/workflows/restructure-commits.yaml
  • .github/workflows/address-review-comments.yaml
  • .github/workflows/rebase.yaml
  • .github/workflows/reusable-claude-on-pr.yaml

📝 Walkthrough

Walkthrough

This PR updates four GitHub Actions workflows. reusable-claude-on-pr.yaml adds conditional upstream remote setup for PRs from other repositories and syncs main before later steps run. rebase.yaml, address-review-comments.yaml, and restructure-commits.yaml expand claude-prompt into multi-line instructions that define git remote selection, fetch/rebase or force-push behavior, and PR comment handling when pushes fail because of permission or authentication issues.

🚥 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 identifies the main change: fixing the /rebase GitHub Actions workflow for fork PRs, which matches the core of the changeset.
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 PR changes only workflow YAML files; no Ginkgo test titles or test files were added or modified.
Test Structure And Quality ✅ Passed The PR only changes GitHub workflow YAML; no Ginkgo test files or test code were modified, so the test-quality check is not applicable.
Topology-Aware Scheduling Compatibility ✅ Passed Only GitHub Actions workflow prompts and an upstream-remote setup step changed; no manifests, controllers, node selectors, affinity, taints, or PDBs were introduced.
Ipv6 And Disconnected Network Test Compatibility ✅ Passed PR only changes GitHub workflow YAML and adds no Ginkgo e2e tests, so the IPv6/disconnected-network check is not applicable.
No-Weak-Crypto ✅ Passed Touched workflows only adjust prompts and remote setup; no MD5/SHA1/DES/RC4/3DES/Blowfish/ECB or custom crypto, and no secret/token comparisons.
Container-Privileges ✅ Passed The PR only updates GitHub workflow prompts and remote setup; no touched file introduces privileged/container security settings.
No-Sensitive-Data-In-Logs ✅ Passed PASS: The only new outputs are PR-number/repo lookups and maintainer-edit comments; no code logs passwords, tokens, PII, or internal hosts.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

@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: 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

📥 Commits

Reviewing files that changed from the base of the PR and between c5b595d and c08d508.

📒 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

Comment thread .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>
@bryan-cox
bryan-cox force-pushed the fix-rebase-fork-prs branch from c08d508 to a981279 Compare July 6, 2026 13:34
@hypershift-jira-solve-ci

hypershift-jira-solve-ci Bot commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

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 Complete

Job Information

Test Failure Analysis

Error

k8s.io/api@v0.35.1: read "https://proxy.golang.org/k8s.io/api/@v/v0.35.1.zip": stream error: stream ID 1; INTERNAL_ERROR; received from peer

Summary

The verify-deps job failed during the go mod tidy step because the Go module proxy (proxy.golang.org) returned HTTP/2 stream errors (INTERNAL_ERROR) when downloading the k8s.io/api@v0.35.1 module zip. This is a transient infrastructure failure on the Go module proxy side — not a code or dependency issue. The error affected every single import of k8s.io/api subpackages (over 50 occurrences), all failing with the identical stream error on the same zip file. The PR itself only modifies a GitHub Actions workflow file and does not touch Go code or dependencies.

Root Cause

The root cause is a transient network/infrastructure failure on proxy.golang.org (the Go module proxy). During the go mod tidy execution within the verify-deps-go-verify-deps CI step, the proxy returned HTTP/2 stream-level INTERNAL_ERROR responses when the CI pod attempted to download k8s.io/api@v0.35.1.zip.

Key observations:

  1. Single module affected: Every error references the exact same artifact — k8s.io/api/@v/v0.35.1.zip. The download started successfully (hundreds of other modules downloaded without issue) but this specific large module zip repeatedly failed.
  2. HTTP/2 stream error: The error stream error: stream ID 1; INTERNAL_ERROR; received from peer indicates the Go module proxy's HTTP/2 server terminated the stream mid-transfer. This is characteristic of a transient server-side issue (overload, timeout, backend error) on proxy.golang.org.
  3. Not a code change issue: PR CNTRLPLANE-3771: fix /rebase GHA workflow for fork PRs #8934 modifies a GitHub Actions workflow file (.github/workflows/rebase.yml). It does not modify go.mod, go.sum, vendor/, or any Go source files. The dependency set is identical to the main branch.
  4. Not reproducible on retry: These Go proxy errors are well-known transient failures in CI environments. A simple re-run of the job would almost certainly succeed.
Recommendations
  1. Retest the job — Run /retest or /test verify-deps on the PR. This is a transient Go module proxy failure and will almost certainly pass on retry.
  2. No code changes needed — The PR does not touch any Go code or dependencies; the failure is entirely infrastructure-related.
  3. Consider GOPROXY fallback — If this pattern recurs frequently, the CI step could be configured with GOPROXY=https://proxy.golang.org,direct (adding direct as fallback) so that if the proxy fails, Go falls back to fetching directly from the source. However, this is a CI infrastructure concern, not something for this PR to address.
Evidence
Evidence Detail
Failed Step verify-deps-go-verify-deps (test phase)
Failed Command go mod tidy (within vendor dependency verification)
Error Type HTTP/2 stream error from Go module proxy
Error Message k8s.io/api@v0.35.1: read "https://proxy.golang.org/k8s.io/api/@v/v0.35.1.zip": stream error: stream ID 1; INTERNAL_ERROR; received from peer
Affected Module k8s.io/api@v0.35.1 (single module, 50+ import paths affected)
Other Modules Hundreds of other modules downloaded successfully before the failure
PR Changes GitHub Actions workflow file only (.github/workflows/rebase.yml) — no Go code or dependency changes
Step Duration 37 seconds before failure
CI Build Cluster build01

@bryan-cox

Copy link
Copy Markdown
Member Author

/retest

@csrwng

csrwng commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

/lgtm

@openshift-ci openshift-ci Bot added the lgtm Indicates that a PR is ready to be merged. label Jul 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.

@bryan-cox

Copy link
Copy Markdown
Member Author

/verified later @bryan-cox

@openshift-ci-robot openshift-ci-robot added verified-later verified Signifies that the PR passed pre-merge verification criteria labels Jul 6, 2026
@openshift-ci-robot

Copy link
Copy Markdown

@bryan-cox: This PR has been marked to be verified later by @bryan-cox.

Details

In response to this:

/verified later @bryan-cox

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 Jul 6, 2026

Copy link
Copy Markdown
Contributor

@bryan-cox: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/e2e-aws-override 316226c link true /test e2e-aws-override
ci/prow/e2e-aks-override 316226c link true /test e2e-aks-override
ci/prow/security 316226c link true /test security

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 e4d4711 into openshift:main Jul 6, 2026
18 checks passed
@bryan-cox
bryan-cox deleted the fix-rebase-fork-prs branch July 6, 2026 17:04
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/ai Indicates the PR includes changes related to AI - Claude agents, Cursor rules, etc. area/api Indicates the PR includes changes for the API area/ci-tooling Indicates the PR includes changes for CI or tooling area/cli Indicates the PR includes changes for CLI area/control-plane-operator Indicates the PR includes changes for the control plane operator - in an OCP release area/documentation Indicates the PR includes changes for documentation area/hypershift-operator Indicates the PR includes changes for the hypershift operator and API - outside an OCP release area/platform/aws PR/issue for AWS (AWSPlatform) platform area/platform/azure PR/issue for Azure (AzurePlatform) platform area/platform/gcp PR/issue for GCP (GCPPlatform) platform area/platform/ibmcloud PR/issue for IBMCloud (IBMCloudPlatform) platform area/platform/kubevirt PR/issue for KubeVirt (KubevirtPlatform) platform area/platform/none PR/issue for None (NonePlatform) platform - user-supplied infrastructure area/platform/openstack PR/issue for OpenStack (OpenStackPlatform) platform area/platform/powervs PR/issue for PowerVS (PowerVSPlatform) platform area/testing Indicates the PR includes changes for e2e testing 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 verified-later

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants