Skip to content

CNTRLPLANE-3352: fix GHA reusable workflow for fork PRs - #8818

Merged
openshift-merge-bot[bot] merged 1 commit into
openshift:mainfrom
bryan-cox:fix-gha-plugin-install
Jun 23, 2026
Merged

CNTRLPLANE-3352: fix GHA reusable workflow for fork PRs#8818
openshift-merge-bot[bot] merged 1 commit into
openshift:mainfrom
bryan-cox:fix-gha-plugin-install

Conversation

@bryan-cox

@bryan-cox bryan-cox commented Jun 23, 2026

Copy link
Copy Markdown
Member

What this PR does / why we need it:

Fixes three issues in the reusable Claude GHA workflow that prevented it
from working on community fork PRs:

  1. SSH clone failure: Plugin dependencies with external source repos
    are cloned via SSH, which fails on GHA runners without SSH keys
    (Host key verification failed). Adds GIT_CONFIG env vars to
    redirect git@github.com: to https://github.com/.

  2. Fork PR resolution failure: For PRs from community forks
    (hypershift-community/hypershift), the checkout sets origin to the
    fork. The gh CLI then resolves PR numbers against the fork instead
    of openshift/hypershift, causing Could not resolve to a PullRequest
    errors. Adds GH_REPO: ${{ github.repository }} so gh always
    targets the upstream repo.

  3. Fork token can't write to upstream: GH_TOKEN was set to the
    fork app token for community PRs, but gh pr comment needs write
    access to openshift/hypershift. Changed GH_TOKEN to
    github.token which has pull-requests: write on the upstream repo.
    Git push still works because actions/checkout persists the app token
    via persist-credentials: true.

Evidence:

Which issue(s) this PR fixes:

Fixes CNTRLPLANE-3352

Special notes for your reviewer:

Depends on openshift-eng/ai-helpers#565 (already merged).

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

  • Chores
    • Updated the CI/CD “Run Claude” step to improve pull request review reliability by adjusting repository URL handling for git operations and simplifying how the token is sourced during the workflow run.

@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 Jun 23, 2026
@openshift-ci-robot

openshift-ci-robot commented Jun 23, 2026

Copy link
Copy Markdown

@bryan-cox: This pull request references CNTRLPLANE-3352 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:

Fixes two issues in the reusable Claude GHA workflow:

  1. SSH clone failure: Plugin dependencies with external source repos
    are cloned via SSH, which fails on GHA runners without SSH keys
    (Host key verification failed). Adds GIT_CONFIG env vars to
    redirect git@github.com: to https://github.com/.

  2. Fork PR resolution failure: For PRs from community forks
    (hypershift-community/hypershift), the checkout sets origin to the
    fork. The gh CLI then resolves PR numbers against the fork instead
    of openshift/hypershift, causing Could not resolve to a PullRequest
    errors. Adds GH_REPO: ${{ github.repository }} so gh always
    targets the upstream repo.

Evidence:

Which issue(s) this PR fixes:

Fixes CNTRLPLANE-3352

Special notes for your reviewer:

Depends on openshift-eng/ai-helpers#565 (already merged).

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.

@coderabbitai

coderabbitai Bot commented Jun 23, 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: 43dd0096-beb6-4dde-933d-ccea52f91571

📥 Commits

Reviewing files that changed from the base of the PR and between 7dfd3b3 and fe41296.

📒 Files selected for processing (1)
  • .github/workflows/reusable-claude-on-pr.yaml
🚧 Files skipped from review as they are similar to previous changes (1)
  • .github/workflows/reusable-claude-on-pr.yaml

📝 Walkthrough

Walkthrough

The reusable-claude-on-pr.yaml workflow's "Run Claude" step receives updated environment configuration. The GH_TOKEN is changed from a conditional expression favoring the App-generated PR-repo token (steps.app-token.outputs.token || github.token) to the direct ${{ github.token }}. The GH_REPO variable is added to expose the repository reference to the Claude process. Three GIT_CONFIG_* variables are introduced (GIT_CONFIG_COUNT=1, GIT_CONFIG_KEY_0=url.https://github.com/.insteadOf, GIT_CONFIG_VALUE_0=git@github.com:) to configure git to rewrite HTTPS GitHub URLs to SSH equivalents during any git operations executed in the run.

Possibly related PRs

  • openshift/hypershift#8778: Modifies the same "Run Claude" step in the same workflow file, changing the Claude invocation arguments to use --output-format stream-json.
  • openshift/hypershift#8815: Adds the same GIT_CONFIG_* git URL rewrite environment variables to the same workflow's Run Claude step.

Suggested reviewers

  • csrwng
  • Nirshal
🚥 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 and specifically identifies the main change: fixing a GitHub Actions reusable workflow for fork PRs, which directly aligns with the primary objectives of addressing SSH clone failures and fork PR resolution issues.
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 PR only modifies .github/workflows/reusable-claude-on-pr.yaml, a GitHub Actions workflow config file with no Ginkgo tests or test names. This check is not applicable.
Test Structure And Quality ✅ Passed The custom check about Ginkgo test quality is not applicable to this PR. The PR only modifies a GitHub Actions workflow file (.github/workflows/reusable-claude-on-pr.yaml), not test code.
Topology-Aware Scheduling Compatibility ✅ Passed This PR modifies only a GitHub Actions workflow file (.github/workflows/reusable-claude-on-pr.yaml). The topology-aware scheduling check applies to deployment manifests, operator code, and controll...
Ipv6 And Disconnected Network Test Compatibility ✅ Passed PR modifies only a GitHub Actions workflow YAML file, not Go test code. No Ginkgo e2e tests are added, so the check is not applicable.
No-Weak-Crypto ✅ Passed PR modifies only a GitHub Actions workflow YAML file with environment variable assignments and configuration settings. No cryptographic code, weak cipher usage, custom crypto implementations, or no...
Container-Privileges ✅ Passed The custom check is designed to flag privileged container/K8s manifest configurations. This PR only modifies a GitHub Actions workflow file (.github/workflows/reusable-claude-on-pr.yaml) with envir...
No-Sensitive-Data-In-Logs ✅ Passed No unprotected sensitive data exposed in logs. GH_TOKEN uses github.token which GitHub Actions automatically masks. GIT_CONFIG variables contain no credentials, only HTTPS URL configuration.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

@openshift-ci

openshift-ci Bot commented Jun 23, 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 Jun 23, 2026
@openshift-ci
openshift-ci Bot requested review from cblecker and jparrill June 23, 2026 16:29
The openshift-developer bundle's transitive dependencies (gopls-lsp,
prodsec-skills) are now bundled in the ai-helpers marketplace, so the
extra marketplace add commands are no longer needed. Additionally, the
plugin install step attempts SSH clones for source repos which fails
on GHA runners that lack SSH keys. Add GIT_CONFIG env vars to force
HTTPS clones instead.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@bryan-cox
bryan-cox force-pushed the fix-gha-plugin-install branch from 7dfd3b3 to fe41296 Compare June 23, 2026 16:48
@bryan-cox bryan-cox changed the title CNTRLPLANE-3352: fix GHA reusable workflow for fork PRs and SSH clones CNTRLPLANE-3352: fix GHA reusable workflow for fork PRs Jun 23, 2026
@bryan-cox

Copy link
Copy Markdown
Member Author

/area ai
/area ci-tooling

@openshift-ci openshift-ci Bot added area/ai Indicates the PR includes changes related to AI - Claude agents, Cursor rules, etc. area/ci-tooling Indicates the PR includes changes for CI or tooling and removed do-not-merge/needs-area labels Jun 23, 2026
@csrwng

csrwng commented Jun 23, 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 Jun 23, 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 Jun 23, 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 Jun 23, 2026

Copy link
Copy Markdown
Contributor

@bryan-cox: 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 9a16fd2 into openshift:main Jun 23, 2026
18 checks passed
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/ci-tooling Indicates the PR includes changes for CI or tooling 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