Skip to content

CNTRLPLANE-2915: Add HyperShift backport skill and command for Claude Code#7870

Open
jparrill wants to merge 1 commit intoopenshift:mainfrom
jparrill:CNTRLPLANE-2915
Open

CNTRLPLANE-2915: Add HyperShift backport skill and command for Claude Code#7870
jparrill wants to merge 1 commit intoopenshift:mainfrom
jparrill:CNTRLPLANE-2915

Conversation

@jparrill
Copy link
Copy Markdown
Contributor

@jparrill jparrill commented Mar 6, 2026

Summary

  • Add a Claude Code skill (.claude/skills/hypershift-backport/) that auto-applies backport conventions (branch naming bp<ver>/<JIRA-ID>, PR title format, Jira integration, conflict resolution guidelines)
  • Add a Claude Code command (.claude/commands/hypershift-backport.md) that executes the full backport workflow: validates merged PR, posts /jira backport, waits for Prow CI, handles auto/manual cherry-picks with build+test verification
  • Add scope verification to prevent the backport from including unrelated changes:
    • Compares backport diff against original PR files before pushing
    • Explicit instructions to only resolve conflict markers without modifying surrounding code
    • Automatic detection and revert of files not present in the original PR
  • Update .claude/SKILLS.md to document both the skill and command

Jira

Test plan

  • Invoke /hypershift-backport with a merged PR and a release branch to verify the full workflow
  • Verify the skill auto-applies when discussing backport topics in conversation
  • Verify branch naming follows bp<ver>/<JIRA-ID> convention
  • Verify PR title follows OCPBUGS-XXXXX: <title> format
  • Verify backport does NOT include files that were not part of the original PR

Assisted-by: Claude (via Claude Code)

Summary by CodeRabbit

  • Documentation
    • Added HyperShift Backport skill documentation with branch naming conventions, PR title formats, and Jira integration workflows
    • Added command reference for backporting merged PRs to release branches with step-by-step instructions
    • Updated existing skill documentation to reference new backport capabilities

@openshift-ci-robot
Copy link
Copy Markdown

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
Copy link
Copy Markdown

openshift-ci-robot commented Mar 6, 2026

@jparrill: This pull request references CNTRLPLANE-2915 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 "4.22.0" version, but no target version was set.

Details

In response to this:

Summary

  • Add a Claude Code skill (.claude/skills/hypershift-backport/) that auto-applies backport conventions (branch naming bp<ver>/<JIRA-ID>, PR title format, Jira integration, conflict resolution guidelines)
  • Add a Claude Code command (.claude/commands/hypershift-backport.md) that executes the full backport workflow: validates merged PR, posts /jira backport, waits for Prow CI, handles auto/manual cherry-picks with build+test verification
  • Update .claude/SKILLS.md to document both the skill and command

Jira

Test plan

  • Invoke /hypershift-backport with a merged PR and a release branch to verify the full workflow
  • Verify the skill auto-applies when discussing backport topics in conversation
  • Verify branch naming follows bp<ver>/<JIRA-ID> convention
  • Verify PR title follows OCPBUGS-XXXXX: <title> format

Assisted-by: Claude (via Claude Code)

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

coderabbitai bot commented Mar 6, 2026

Walkthrough

Adds HyperShift Backport documentation: a new skill definition, command reference, and workflow conventions covering backport invocation, cherry-pick process, branch/PR naming, Jira integration, conflict resolution, CI/Prow interactions, and required tooling and error handling.

Changes

Cohort / File(s) Summary
Command Documentation
.claude/commands/hypershift-backport.md
New comprehensive command doc describing usage, arguments, step-by-step backport workflow, error cases, safety checks, environment/tooling prerequisites, and expected outputs.
Skill Definition & Conventions
.claude/skills/hypershift-backport/SKILL.md
New skill file detailing branch naming (bp/), PR title formats, Jira integration, cherry-pick steps, conflict resolution, automatic vs manual backports, and verification guidance.
Skills Registry & References
.claude/SKILLS.md
Registers the HyperShift Backport skill, adds command entry to Available Commands, updates Debug Cluster skill to note automatic/manual backports and the /hypershift-backport invocation.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  participant User as User
  participant CLI as gh/git CLI
  participant Repo as GitHub Repo
  participant CI as Prow/CI
  participant Jira as Jira
  participant Local as Local Workspace

  User->>CLI: invoke /hypershift-backport (PR#, target branches)
  CLI->>Repo: fetch PR, verify merged state
  Repo-->>CLI: PR metadata (commits, merge SHA)
  CLI->>Jira: extract/create OCPBUGS issues per target branch
  CLI->>Local: checkout target branch, create bp<version>/<JIRA-ID> branch
  Local->>Local: apply cherry-pick(s), detect conflicts
  alt conflicts
    User->>Local: resolve conflicts, commit, sign if required
  end
  Local->>Repo: push branch
  Repo->>CI: trigger Prow/CI jobs for backport PR
  CI-->>Repo: test/build results
  Repo->>User: create backport PR(s) and report status
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The pull request title clearly identifies the main change: adding a HyperShift backport skill and command for Claude Code, which directly matches the primary focus of the changeset.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Stable And Deterministic Test Names ✅ Passed PR contains only Markdown documentation files with no Go test code or Ginkgo test declarations.
Test Structure And Quality ✅ Passed PR contains only documentation files with no Go test code, so test quality check is not applicable and passes by default.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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

@openshift-ci openshift-ci bot requested review from bryan-cox and muraee March 6, 2026 08:40
@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 Mar 6, 2026
@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci bot commented Mar 6, 2026

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: jparrill

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 Mar 6, 2026
@openshift-ci-robot
Copy link
Copy Markdown

openshift-ci-robot commented Mar 6, 2026

@jparrill: This pull request references CNTRLPLANE-2915 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 "4.22.0" version, but no target version was set.

Details

In response to this:

Summary

  • Add a Claude Code skill (.claude/skills/hypershift-backport/) that auto-applies backport conventions (branch naming bp<ver>/<JIRA-ID>, PR title format, Jira integration, conflict resolution guidelines)
  • Add a Claude Code command (.claude/commands/hypershift-backport.md) that executes the full backport workflow: validates merged PR, posts /jira backport, waits for Prow CI, handles auto/manual cherry-picks with build+test verification
  • Update .claude/SKILLS.md to document both the skill and command

Jira

Test plan

  • Invoke /hypershift-backport with a merged PR and a release branch to verify the full workflow
  • Verify the skill auto-applies when discussing backport topics in conversation
  • Verify branch naming follows bp<ver>/<JIRA-ID> convention
  • Verify PR title follows OCPBUGS-XXXXX: <title> format

Assisted-by: Claude (via Claude Code)

Summary by CodeRabbit

Release Notes

  • Documentation
  • Added HyperShift Backport workflow documentation with step-by-step instructions for backporting merged PRs to release branches, including branch naming conventions, PR title format requirements, Jira integration guidance, and conflict resolution procedures.

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.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 4

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.claude/commands/hypershift-backport.md:
- Around line 208-212: The script's final checkout ("git checkout
\"$ORIGINAL_BRANCH\"") can be skipped on early exits; add a cleanup trap that
always restores ORIGINAL_BRANCH on EXIT and ensure the trap is installed early
(after ORIGINAL_BRANCH is set) and removed or disabled only after the flow
completes successfully; target the shell flow that defines ORIGINAL_BRANCH and
the final step (the checkout at Step 6) so the trap runs on errors, interrupts,
or exits and still allows explicit successful completion to skip/cleanup the
trap.
- Around line 153-163: Add language identifiers "bash" to the fenced code blocks
that contain shell/git commands (e.g., the block with "git add <resolved-files>"
/ "git cherry-pick --continue" and the block with 'git push -u
"$GIT_FORK_REMOTE" "bp${VERSION_SHORT}/${JIRA_ID}"' and the Assisted-by text) so
the opening ``` becomes ```bash for each affected fence to satisfy markdownlint
MD040.
- Around line 121-127: The checkout of TARGET_BRANCH assumes a local branch
exists and can fail on fresh clones; change the sequence so after fetching
GIT_UPSTREAM_REMOTE you create or reset a local branch that tracks the remote
branch (use the remote ref GIT_UPSTREAM_REMOTE/$TARGET_BRANCH) instead of a
plain git checkout "$TARGET_BRANCH", e.g. fetch the remote then create or
force-update the local TARGET_BRANCH to point at the upstream ref
(ORIGINAL_BRANCH and GIT_UPSTREAM_REMOTE remain the same) and then perform the
pull --rebase from the upstream remote.

In @.claude/skills/hypershift-backport/SKILL.md:
- Around line 14-16: The fenced code blocks containing the examples
"bp<version>/<JIRA-ID>" and "OCPBUGS-XXXXX: <original PR title>" are missing
language identifiers and trigger markdownlint MD040; update those backtick
fences from ``` to ```text so each fenced block begins with ```text to mark them
as plain text (locate the blocks shown in the diff and replace the opening ```
with ```text).

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository: openshift/coderabbit/.coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: cb24a278-7f38-4f85-94d4-f519ad3f3c75

📥 Commits

Reviewing files that changed from the base of the PR and between ffb4546 and 1dee59d.

📒 Files selected for processing (3)
  • .claude/SKILLS.md
  • .claude/commands/hypershift-backport.md
  • .claude/skills/hypershift-backport/SKILL.md

Comment on lines +121 to +127
```bash
ORIGINAL_BRANCH=$(git rev-parse --abbrev-ref HEAD)

git fetch "$GIT_UPSTREAM_REMOTE"
git checkout "$TARGET_BRANCH"
git pull --rebase "$GIT_UPSTREAM_REMOTE" "$TARGET_BRANCH"
```
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.

⚠️ Potential issue | 🟠 Major

Use a remote-tracking checkout to avoid failures on fresh clones.

git checkout "$TARGET_BRANCH" assumes the branch already exists locally. On first-time backports, this step can fail even when the remote branch exists.

Proposed fix
 ORIGINAL_BRANCH=$(git rev-parse --abbrev-ref HEAD)

 git fetch "$GIT_UPSTREAM_REMOTE"
-git checkout "$TARGET_BRANCH"
-git pull --rebase "$GIT_UPSTREAM_REMOTE" "$TARGET_BRANCH"
+git checkout -B "$TARGET_BRANCH" "$GIT_UPSTREAM_REMOTE/$TARGET_BRANCH"
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.claude/commands/hypershift-backport.md around lines 121 - 127, The checkout
of TARGET_BRANCH assumes a local branch exists and can fail on fresh clones;
change the sequence so after fetching GIT_UPSTREAM_REMOTE you create or reset a
local branch that tracks the remote branch (use the remote ref
GIT_UPSTREAM_REMOTE/$TARGET_BRANCH) instead of a plain git checkout
"$TARGET_BRANCH", e.g. fetch the remote then create or force-update the local
TARGET_BRANCH to point at the upstream ref (ORIGINAL_BRANCH and
GIT_UPSTREAM_REMOTE remain the same) and then perform the pull --rebase from the
upstream remote.

Comment thread .claude/commands/hypershift-backport.md
Comment on lines +208 to +212
### Step 6: Return to original state

```bash
git checkout "$ORIGINAL_BRANCH"
```
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.

⚠️ Potential issue | 🟠 Major

The “always returns to original branch” safety claim is not guaranteed by the shown flow.

If the process exits early (validation, cherry-pick, push/PR errors), Line 211 may never run. The safety guarantee should be implemented with cleanup trapping in the executable flow.

Proposed fix
 ORIGINAL_BRANCH=$(git rev-parse --abbrev-ref HEAD)
+cleanup() {
+  git checkout "$ORIGINAL_BRANCH" >/dev/null 2>&1 || true
+}
+trap cleanup EXIT

Also applies to: 296-302

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.claude/commands/hypershift-backport.md around lines 208 - 212, The script's
final checkout ("git checkout \"$ORIGINAL_BRANCH\"") can be skipped on early
exits; add a cleanup trap that always restores ORIGINAL_BRANCH on EXIT and
ensure the trap is installed early (after ORIGINAL_BRANCH is set) and removed or
disabled only after the flow completes successfully; target the shell flow that
defines ORIGINAL_BRANCH and the final step (the checkout at Step 6) so the trap
runs on errors, interrupts, or exits and still allows explicit successful
completion to skip/cleanup the trap.

Comment on lines +14 to +16
```
bp<version>/<JIRA-ID>
```
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.

⚠️ Potential issue | 🟡 Minor

Add language identifiers to fenced code blocks.

Both code fences are missing a language, which triggers markdownlint MD040.

Proposed fix
-```
+```text
 bp<version>/<JIRA-ID>

...

- +text
OCPBUGS-XXXXX:

Also applies to: 29-31

🧰 Tools
🪛 markdownlint-cli2 (0.21.0)

[warning] 14-14: Fenced code blocks should have a language specified

(MD040, fenced-code-language)

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.claude/skills/hypershift-backport/SKILL.md around lines 14 - 16, The fenced
code blocks containing the examples "bp<version>/<JIRA-ID>" and "OCPBUGS-XXXXX:
<original PR title>" are missing language identifiers and trigger markdownlint
MD040; update those backtick fences from ``` to ```text so each fenced block
begins with ```text to mark them as plain text (locate the blocks shown in the
diff and replace the opening ``` with ```text).

@jparrill
Copy link
Copy Markdown
Contributor Author

jparrill commented Mar 6, 2026

For reference, The plan is to use it during a backport process, refine it and then got it merged.

After that, test this skill during some time within the team in order to refine it more and more.

Finally put a PR against the ai-helpers

@jparrill
Copy link
Copy Markdown
Contributor Author

jparrill commented Mar 9, 2026

Sample of Backport: openshift/hypershift-oadp-plugin#197

Add a new Claude Code command `/hypershift-backport` that automates
backporting merged PRs to release branches.

The command handles the full workflow: Jira integration via `/jira backport`,
automatic cherry-pick detection, manual cherry-pick with conflict resolution,
build/test/verify validation, and PR creation.

Includes scope verification to ensure backports only contain changes from
the original PR, preventing unrelated modifications from being introduced
during conflict resolution.

Signed-off-by: Juan Manuel Parrilla Madrid <jparrill@redhat.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Juan Manuel Parrilla Madrid <jparrill@redhat.com>
@openshift-ci-robot
Copy link
Copy Markdown

openshift-ci-robot commented Mar 9, 2026

@jparrill: This pull request references CNTRLPLANE-2915 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 "4.22.0" version, but no target version was set.

Details

In response to this:

Summary

  • Add a Claude Code skill (.claude/skills/hypershift-backport/) that auto-applies backport conventions (branch naming bp<ver>/<JIRA-ID>, PR title format, Jira integration, conflict resolution guidelines)
  • Add a Claude Code command (.claude/commands/hypershift-backport.md) that executes the full backport workflow: validates merged PR, posts /jira backport, waits for Prow CI, handles auto/manual cherry-picks with build+test verification
  • Add scope verification to prevent the backport from including unrelated changes:
  • Compares backport diff against original PR files before pushing
  • Explicit instructions to only resolve conflict markers without modifying surrounding code
  • Automatic detection and revert of files not present in the original PR
  • Update .claude/SKILLS.md to document both the skill and command

Jira

Test plan

  • Invoke /hypershift-backport with a merged PR and a release branch to verify the full workflow
  • Verify the skill auto-applies when discussing backport topics in conversation
  • Verify branch naming follows bp<ver>/<JIRA-ID> convention
  • Verify PR title follows OCPBUGS-XXXXX: <title> format
  • Verify backport does NOT include files that were not part of the original PR

Assisted-by: Claude (via Claude Code)

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.

@jparrill
Copy link
Copy Markdown
Contributor Author

jparrill commented Mar 9, 2026

Updated behavior: Scope verification for backports

After testing, I found the backport skill could introduce changes unrelated to the original PR during conflict resolution. This update adds multiple guardrails to prevent that:

Changes

  1. Scope restriction directive (Step 5.4): Explicit instruction that the backport MUST only include changes from the original PR commits. Any modification not in the original diff is out of scope.

  2. Conflict resolution guardrails (Step 5.5):

    • Only resolve conflict markers, do not modify code outside conflict regions
    • Only stage files that were part of the original PR
    • Discard unrelated modified files with git checkout -- <file>
    • Post-resolution diff check against original PR files
  3. New scope verification step (Step 5.6): Before build/test/verify, compares the list of files changed in the backport against the original PR using gh pr view + git diff. Extra files are automatically reverted and the user is notified.

  4. Build/test fix scoping (Step 5.7): When fixing build/test failures, only fix issues directly caused by the cherry-pick, not pre-existing issues in the target branch.

Safety features

Added "Scope verification" to the documented safety features list.

@openshift-ci-robot
Copy link
Copy Markdown

openshift-ci-robot commented Mar 9, 2026

@jparrill: This pull request references CNTRLPLANE-2915 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 "4.22.0" version, but no target version was set.

Details

In response to this:

Summary

  • Add a Claude Code skill (.claude/skills/hypershift-backport/) that auto-applies backport conventions (branch naming bp<ver>/<JIRA-ID>, PR title format, Jira integration, conflict resolution guidelines)
  • Add a Claude Code command (.claude/commands/hypershift-backport.md) that executes the full backport workflow: validates merged PR, posts /jira backport, waits for Prow CI, handles auto/manual cherry-picks with build+test verification
  • Add scope verification to prevent the backport from including unrelated changes:
  • Compares backport diff against original PR files before pushing
  • Explicit instructions to only resolve conflict markers without modifying surrounding code
  • Automatic detection and revert of files not present in the original PR
  • Update .claude/SKILLS.md to document both the skill and command

Jira

Test plan

  • Invoke /hypershift-backport with a merged PR and a release branch to verify the full workflow
  • Verify the skill auto-applies when discussing backport topics in conversation
  • Verify branch naming follows bp<ver>/<JIRA-ID> convention
  • Verify PR title follows OCPBUGS-XXXXX: <title> format
  • Verify backport does NOT include files that were not part of the original PR

Assisted-by: Claude (via Claude Code)

Summary by CodeRabbit

  • Documentation
  • Added HyperShift Backport skill documentation with branch naming conventions, PR title formats, and Jira integration workflows
  • Added command reference for backporting merged PRs to release branches with step-by-step instructions
  • Updated existing skill documentation to reference new backport capabilities

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.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

♻️ Duplicate comments (2)
.claude/commands/hypershift-backport.md (2)

265-269: ⚠️ Potential issue | 🟠 Major

Branch restoration safety guarantee is not fully implemented.

Line 268 (git checkout "$ORIGINAL_BRANCH") only executes if the entire flow completes successfully. If the process exits early due to validation errors, cherry-pick failures, or push/PR errors, the user remains on the backport branch, contradicting the "Always returns to original branch" safety claim at line 361.

🛡️ Proposed fix using cleanup trap

Add this after capturing the original branch:

 ORIGINAL_BRANCH=$(git rev-parse --abbrev-ref HEAD)
+cleanup() {
+  git checkout "$ORIGINAL_BRANCH" >/dev/null 2>&1 || true
+}
+trap cleanup EXIT
 
 git fetch "$GIT_UPSTREAM_REMOTE"

This ensures the original branch is restored on any exit (error, interrupt, or success).

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.claude/commands/hypershift-backport.md around lines 265 - 269, The script's
guarantee to "Always returns to original branch" is broken because git checkout
"$ORIGINAL_BRANCH" only runs on successful completion; capture the current
branch into ORIGINAL_BRANCH early (e.g., via git rev-parse --abbrev-ref HEAD)
and install a cleanup trap that runs on EXIT to restore it (use trap to run git
checkout "$ORIGINAL_BRANCH" and any necessary cleanup on ERR/INT/EXIT), so the
original branch is checked out regardless of early exits, errors, or interrupts;
update mentions of git checkout "$ORIGINAL_BRANCH" and any existing cleanup
logic to rely on this trap.

131-136: ⚠️ Potential issue | 🟠 Major

Use remote-tracking checkout to avoid failures on fresh clones.

The command git checkout "$TARGET_BRANCH" assumes a local branch already exists. On first-time backports or fresh clones, this will fail even when the remote branch exists, causing the workflow to abort unexpectedly.

🔧 Proposed fix
 ORIGINAL_BRANCH=$(git rev-parse --abbrev-ref HEAD)
 
 git fetch "$GIT_UPSTREAM_REMOTE"
-git checkout "$TARGET_BRANCH"
-git pull --rebase "$GIT_UPSTREAM_REMOTE" "$TARGET_BRANCH"
+git checkout -B "$TARGET_BRANCH" "$GIT_UPSTREAM_REMOTE/$TARGET_BRANCH"

This creates or resets the local branch to track the remote, eliminating the need for a separate pull operation.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.claude/commands/hypershift-backport.md around lines 131 - 136, The script
assumes a local branch exists when running git checkout "$TARGET_BRANCH", which
fails on fresh clones; update the sequence that uses ORIGINAL_BRANCH,
GIT_UPSTREAM_REMOTE and TARGET_BRANCH to create or reset a local branch that
tracks the remote branch instead of a plain checkout and separate pull—use a
remote-tracking checkout (e.g., create/reset local TARGET_BRANCH from
GIT_UPSTREAM_REMOTE/TARGET_BRANCH via git checkout -B or git switch --track
equivalent) so the local branch always exists and is up-to-date without a
separate pull.
🧹 Nitpick comments (3)
.claude/commands/hypershift-backport.md (2)

62-68: Add language identifiers to error example code blocks.

The fenced code blocks containing error messages are missing language identifiers, which triggers markdownlint MD040. Use text for plain error message examples.

📝 Proposed fix
-```
+```text
 ERROR: PR `#7730` is not merged (current state: OPEN).
 Backports can only be created from merged PRs.

- +text
ERROR: Branch 'release-4.99' does not exist in remote.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.claude/commands/hypershift-backport.md around lines 62 - 68, Add the
missing Markdown language identifiers to the two fenced code blocks that show
plain error messages so markdownlint MD040 is satisfied: locate the blocks
containing the error strings "ERROR: PR `#7730` is not merged (current state:
OPEN). Backports can only be created from merged PRs." and "ERROR: Branch
'release-4.99' does not exist in remote." and change their opening fences from
``` to ```text (i.e., prefix each code fence with the language identifier
"text").

274-336: Add language identifiers to output example code blocks.

The three fenced code blocks containing expected output examples (lines 274, 297, 321) are missing language identifiers, which triggers markdownlint MD040. Use text for plain output examples.

📝 Proposed fix
 ### All auto cherry-picks succeeded:
-```
+```text
 ============================================
 BACKPORT COMPLETE
 ...

Some manual cherry-picks needed:

- +text

BACKPORT COMPLETE
...


### Failure:
-```
+```text
============================================
BACKPORT FAILED
...
</details>

<details>
<summary>🤖 Prompt for AI Agents</summary>

Verify each finding against the current code and only fix it if needed.

In @.claude/commands/hypershift-backport.md around lines 274 - 336, Update the
three fenced output example blocks in .claude/commands/hypershift-backport.md
(the blocks under the "BACKPORT COMPLETE", "Some manual cherry-picks needed",
and "BACKPORT FAILED" sections) to include a language identifier of text (change
totext) so markdownlint MD040 is satisfied; locate the fenced blocks by
the visible headings and the sample output content and add the identifier to
each opening fence.


</details>

</blockquote></details>
<details>
<summary>.claude/SKILLS.md (1)</summary><blockquote>

`184-187`: **Add language identifier to the fenced code block.**

The code fence containing usage examples is missing a language identifier, which triggers markdownlint MD040. Use `bash` since these are shell command invocations.



<details>
<summary>📝 Proposed fix</summary>

```diff
-```
+```bash
 /hypershift-backport 7730 release-4.21
 /hypershift-backport 7730 release-4.21,release-4.20
 ```
```
</details>

<details>
<summary>🤖 Prompt for AI Agents</summary>

Verify each finding against the current code and only fix it if needed.

In @.claude/SKILLS.md around lines 184 - 187, Update the fenced code block that
currently contains the two example commands "/hypershift-backport 7730
release-4.21" and "/hypershift-backport 7730 release-4.21,release-4.20" in
.claude/SKILLS.md to include the language identifier "bash" (i.e., change the
opening fence from tobash) so the snippet is recognized as shell
commands and satisfies markdownlint MD040.


</details>

</blockquote></details>

</blockquote></details>

<details>
<summary>🤖 Prompt for all review comments with AI agents</summary>

Verify each finding against the current code and only fix it if needed.

Duplicate comments:
In @.claude/commands/hypershift-backport.md:

  • Around line 265-269: The script's guarantee to "Always returns to original
    branch" is broken because git checkout "$ORIGINAL_BRANCH" only runs on
    successful completion; capture the current branch into ORIGINAL_BRANCH early
    (e.g., via git rev-parse --abbrev-ref HEAD) and install a cleanup trap that runs
    on EXIT to restore it (use trap to run git checkout "$ORIGINAL_BRANCH" and any
    necessary cleanup on ERR/INT/EXIT), so the original branch is checked out
    regardless of early exits, errors, or interrupts; update mentions of git
    checkout "$ORIGINAL_BRANCH" and any existing cleanup logic to rely on this trap.
  • Around line 131-136: The script assumes a local branch exists when running git
    checkout "$TARGET_BRANCH", which fails on fresh clones; update the sequence that
    uses ORIGINAL_BRANCH, GIT_UPSTREAM_REMOTE and TARGET_BRANCH to create or reset a
    local branch that tracks the remote branch instead of a plain checkout and
    separate pull—use a remote-tracking checkout (e.g., create/reset local
    TARGET_BRANCH from GIT_UPSTREAM_REMOTE/TARGET_BRANCH via git checkout -B or git
    switch --track equivalent) so the local branch always exists and is up-to-date
    without a separate pull.

Nitpick comments:
In @.claude/commands/hypershift-backport.md:

  • Around line 62-68: Add the missing Markdown language identifiers to the two
    fenced code blocks that show plain error messages so markdownlint MD040 is
    satisfied: locate the blocks containing the error strings "ERROR: PR #7730 is
    not merged (current state: OPEN). Backports can only be created from merged
    PRs." and "ERROR: Branch 'release-4.99' does not exist in remote." and change
    their opening fences from totext (i.e., prefix each code fence with the
    language identifier "text").
  • Around line 274-336: Update the three fenced output example blocks in
    .claude/commands/hypershift-backport.md (the blocks under the "BACKPORT
    COMPLETE", "Some manual cherry-picks needed", and "BACKPORT FAILED" sections) to
    include a language identifier of text (change totext) so markdownlint
    MD040 is satisfied; locate the fenced blocks by the visible headings and the
    sample output content and add the identifier to each opening fence.

In @.claude/SKILLS.md:

  • Around line 184-187: Update the fenced code block that currently contains the
    two example commands "/hypershift-backport 7730 release-4.21" and
    "/hypershift-backport 7730 release-4.21,release-4.20" in .claude/SKILLS.md to
    include the language identifier "bash" (i.e., change the opening fence from tobash) so the snippet is recognized as shell commands and satisfies
    markdownlint MD040.

</details>

---

<details>
<summary>ℹ️ Review info</summary>

<details>
<summary>⚙️ Run configuration</summary>

**Configuration used**: Repository: openshift/coderabbit/.coderabbit.yaml

**Review profile**: CHILL

**Plan**: Pro

**Run ID**: `cb10ffe9-1e9a-4696-adb9-9348c0f3fa9b`

</details>

<details>
<summary>📥 Commits</summary>

Reviewing files that changed from the base of the PR and between 1dee59dcfa2ac930534e200a04361f2108e297db and c9481b57340f089dabb09a70a96a20a72efb54ce.

</details>

<details>
<summary>📒 Files selected for processing (3)</summary>

* `.claude/SKILLS.md`
* `.claude/commands/hypershift-backport.md`
* `.claude/skills/hypershift-backport/SKILL.md`

</details>

</details>

<!-- This is an auto-generated comment by CodeRabbit for review status -->

@openshift-bot
Copy link
Copy Markdown

Stale PRs are closed after 21d of inactivity.

If this PR is still relevant, comment to refresh it or remove the stale label.
Mark the PR as fresh by commenting /remove-lifecycle stale.

If this PR is safe to close now please do so with /close.

/lifecycle stale

@openshift-ci openshift-ci bot added lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. labels Apr 17, 2026
@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci bot commented Apr 17, 2026

PR needs rebase.

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.

@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci bot commented Apr 17, 2026

@jparrill: The following test 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/verify-workflows c9481b5 link true /test verify-workflows

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.

@hypershift-jira-solve-ci
Copy link
Copy Markdown

hypershift-jira-solve-ci bot commented Apr 17, 2026

I now have the complete picture. Let me compile the final report.

Test Failure Analysis Complete

Job Information

Test Failure Analysis

Error

Auto-merging .claude/SKILLS.md
CONFLICT (content): Merge conflict in .claude/SKILLS.md
Automatic merge failed; fix conflicts and then commit the result.
# Error: exit status 1

Summary

The job never reached the verify-workflows test step. It failed during the git clone/merge phase because the PR branch (c9481b57, last committed 2026-03-09) has a merge conflict with the current main branch (1180bcaf5, 2026-04-17) in .claude/SKILLS.md. Multiple commits have landed on main modifying .claude/SKILLS.md since the PR was authored (including Konflux EC skill additions on 2026-03-23 and restructure-commits updates on 2026-03-11/12), making the PR's changes to that file unmergeable. GitHub confirms mergeStateStatus: "DIRTY" and mergeable: "CONFLICTING".

Root Cause

The PR branch has not been rebased or updated since 2026-03-09 (over 5 weeks ago). In that time, several PRs landed on main that modified .claude/SKILLS.md:

  1. PR OCPBUGS-79369: Add Konflux archived PipelineRun skill and update task discovery #8043 (2026-03-23) — feat(ci): add Konflux archived PipelineRun skill and update task discovery — added new skill entries to SKILLS.md
  2. Commit e7abb46 (2026-03-12) — chore(claude): map all repo directories in restructure-commits command — modified SKILLS.md
  3. Commit bb85cb0 (2026-03-11) — chore(claude): add restructure-commits plugin command — modified SKILLS.md

PR #7870 also modifies .claude/SKILLS.md (to register the new hypershift-backport skill). Both the PR and the upstream changes edit overlapping regions of this file, producing a content conflict that git merge --no-ff cannot auto-resolve.

The Prow CI job runs git merge --no-ff {pr-sha} onto the current main HEAD as its first step. When this merge fails, the job exits immediately with exit status 1 — no CI steps (verify-workflows or otherwise) are ever executed.

Recommendations
  1. Rebase the PR branch onto current main — resolve the merge conflict in .claude/SKILLS.md by incorporating the upstream changes (Konflux skill entries, restructure-commits entries) alongside the new hypershift-backport skill entry.
    git fetch origin main
    git rebase origin/main
    # Resolve conflict in .claude/SKILLS.md
    git add .claude/SKILLS.md
    git rebase --continue
    git push --force-with-lease
  2. Re-trigger CI — after the rebase, the verify-workflows job will be able to merge cleanly and actually run the workflow verification checks.
  3. Consider keeping long-lived PRs rebased — this PR has been open since March 9 without updates. Periodic rebases prevent conflict accumulation in shared files like SKILLS.md.
Evidence
Evidence Detail
Failure phase Git merge (pre-test), not a test execution failure
Conflicting file .claude/SKILLS.md
PR last commit c9481b57 on 2026-03-09T13:55:37Z
Main HEAD at test time 1180bcaf5 on 2026-04-17T10:26:59Z (38 days newer)
Upstream SKILLS.md changes 4 commits since PR was authored (2026-03-11 through 2026-03-23)
GitHub merge status mergeable: "CONFLICTING", mergeStateStatus: "DIRTY"
Build log error CONFLICT (content): Merge conflict in .claude/SKILLS.mdexit status 1
Files in PR .claude/SKILLS.md, .claude/commands/hypershift-backport.md, .claude/skills/hypershift-backport/SKILL.md

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. lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants