Skip to content

CNTRLPLANE-3641: fix restructure-commits GHA to force push without confirmation - #8771

Merged
openshift-merge-bot[bot] merged 1 commit into
openshift:mainfrom
bryan-cox:add-new-gha-jobs
Jun 18, 2026
Merged

CNTRLPLANE-3641: fix restructure-commits GHA to force push without confirmation#8771
openshift-merge-bot[bot] merged 1 commit into
openshift:mainfrom
bryan-cox:add-new-gha-jobs

Conversation

@bryan-cox

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

Copy link
Copy Markdown
Member

What this PR does / why we need it:

Updates the restructure-commits GHA workflow to instruct Claude to force push without asking for confirmation. In CI there is no interactive user to respond, so Claude was stopping after restructuring commits with "Shall I run git push --force-with-lease?" and the job ended without pushing.

Which issue(s) this PR fixes:

Fixes CNTRLPLANE-3641

Special notes for your reviewer:

The original PR #8770 merged before this fix was included. This is a one-line change to the Claude prompt adding CI-specific instructions.

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

Release Notes

  • Chores
    • Updated CI workflow prompts for “Restructure commits” and “Rebase onto main.”
    • CI now force-pushes using --force-with-lease automatically after commit restructuring/rebasing, without confirmation prompts.

This release contains no user-facing changes; updates are limited to internal development workflow behavior.

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

openshift-ci-robot commented Jun 18, 2026

Copy link
Copy Markdown

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

Updates the restructure-commits GHA workflow to instruct Claude to force push without asking for confirmation. In CI there is no interactive user to respond, so Claude was stopping after restructuring commits with "Shall I run git push --force-with-lease?" and the job ended without pushing.

Which issue(s) this PR fixes:

Fixes CNTRLPLANE-3641

Special notes for your reviewer:

The original PR #8770 merged before this fix was included. This is a one-line change to the Claude prompt adding CI-specific instructions.

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 18, 2026

Copy link
Copy Markdown
Contributor
📝 Walkthrough

Walkthrough

This PR updates the Claude Code prompts in two GitHub Actions workflows to add explicit CI-specific instructions. The "Rebase onto main" step in rebase.yaml and the "Restructure commits" step in restructure-commits.yaml both receive expanded -p prompt arguments that instruct Claude to force push using --force-with-lease after completing their respective operations, without requesting confirmation. The underlying workflow step sequences and model configuration remain unchanged.

Possibly related PRs

  • openshift/hypershift#8770: Introduced the same restructure-commits.yaml workflow and its Claude-driven /restructure-commits operation that this PR directly modifies.

Suggested reviewers

  • cblecker
  • jparrill
🚥 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 accurately describes the main change: updating the restructure-commits GHA workflow to force push without confirmation in CI environments.
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 only modifies GitHub Actions workflow YAML files (.github/workflows/rebase.yaml and restructure-commits.yaml), not test files. No Ginkgo tests present to evaluate for dynamic test names.
Test Structure And Quality ✅ Passed This PR modifies GitHub Actions workflow YAML files only (restructure-commits.yaml and rebase.yaml), not Ginkgo test code. The custom check for Ginkgo test quality is not applicable.
Topology-Aware Scheduling Compatibility ✅ Passed PR modifies only GitHub Actions workflow files with Claude AI prompts for git operations; does not introduce deployment manifests, operator code, controllers, or scheduling constraints that would t...
Ipv6 And Disconnected Network Test Compatibility ✅ Passed No new Ginkgo e2e tests were added in this PR. The changes only update GitHub Actions workflow files (.github/workflows/restructure-commits.yaml and .github/workflows/rebase.yaml) to add CI-specifi...
No-Weak-Crypto ✅ Passed Pull request contains only GitHub Actions workflow prompt updates. No weak crypto (MD5, SHA1, DES, RC4, 3DES, Blowfish, ECB), custom crypto implementations, or timing attacks detected.
Container-Privileges ✅ Passed The PR modifies GitHub Actions workflow configuration files (.github/workflows/restructure-commits.yaml and rebase.yaml), not container/K8s manifests. These workflow files contain no privileged con...
No-Sensitive-Data-In-Logs ✅ Passed No sensitive data logging detected. Tokens and secrets are properly managed as environment variables and secrets, never echoed or logged. Only non-sensitive values (branch name, repo name, boolean...

✏️ 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 and usage tips.

@openshift-ci
openshift-ci Bot requested review from Nirshal and clebs June 18, 2026 12:07
@openshift-ci

openshift-ci Bot commented Jun 18, 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 18, 2026

@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/restructure-commits.yaml:
- Line 95: The claude command with the model claude-opus-4-6 parameter is
vulnerable to prompt injection from untrusted sources like PR text, commit
messages, and repository content while allowing autonomous force-push actions.
Add explicit hardening instructions to the prompt that instruct Claude to ignore
any instructions from PR/issue titles, PR/issue bodies, commit messages, file
contents, or other repository data unless they are explicitly part of the
trusted /restructure-commits command contract. Make clear that only the
restructure-commits directive and its documented parameters should be followed,
and any suspicious or conflicting instructions from external sources should be
reported and rejected.
🪄 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: 2afc69e2-cb43-47ae-a082-2979a2469106

📥 Commits

Reviewing files that changed from the base of the PR and between 7f7d696 and 8a55c19.

📒 Files selected for processing (1)
  • .github/workflows/restructure-commits.yaml

Comment thread .github/workflows/restructure-commits.yaml
Add two new GitHub Actions workflows triggered by PR comments:
- /restructure-commits: invokes the repo's restructure-commits
  command via Claude to reorganize branch commits by component
- /rebase: uses Claude to rebase the PR onto latest main, resolve
  any conflicts, and force push

Both follow the same pattern as the address-review-comments workflow
with concurrency grouping, fork token handling, and GCP WIF auth.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

@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/rebase.yaml:
- Line 95: The claude command in the rebase workflow lacks protection against
prompt injection through PR/issue text. Add explicit hardening instructions to
the prompt that instruct Claude to treat all repository content, PR titles, PR
bodies, and issue text as untrusted and to strictly follow only the prescribed
git workflow steps without executing any alternative instructions that might be
embedded in those sources. Include a clear directive that Claude must ignore any
repository-based instructions and only perform the four specified git
operations: fetch, rebase, conflict resolution, and force-with-lease push.
🪄 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: 0f71d274-e3e2-436d-aabf-a933c674b265

📥 Commits

Reviewing files that changed from the base of the PR and between 8a55c19 and c987e1b.

📒 Files selected for processing (2)
  • .github/workflows/rebase.yaml
  • .github/workflows/restructure-commits.yaml
🚧 Files skipped from review as they are similar to previous changes (1)
  • .github/workflows/restructure-commits.yaml

Comment thread .github/workflows/rebase.yaml
@jparrill

Copy link
Copy Markdown
Contributor

/area ai

@jparrill

Copy link
Copy Markdown
Contributor

/lgtm

@openshift-ci openshift-ci Bot added area/ai Indicates the PR includes changes related to AI - Claude agents, Cursor rules, etc. and removed do-not-merge/needs-area labels Jun 18, 2026
@openshift-ci openshift-ci Bot added the lgtm Indicates that a PR is ready to be merged. label Jun 18, 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 18, 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 18, 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 18bacf8 into openshift:main Jun 18, 2026
18 checks passed
@bryan-cox
bryan-cox deleted the add-new-gha-jobs branch June 18, 2026 13:57
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. 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