Skip to content

Conversation

@wangke19
Copy link
Contributor

@wangke19 wangke19 commented Nov 27, 2025

Summary

This PR adds a new /git:fix-cherrypick-robot-pr command to the git plugin that automates the process of fixing cherrypick-robot PRs that need manual intervention.

Problem

The cherrypick-robot creates automated PRs but cannot:

  • Fix verification failures (validation errors, generated file mismatches)
  • Resolve merge conflicts
  • Add context-specific fixes
  • Handle edge cases requiring human judgment
  • Apply repository-specific cleanup

Previously, developers had to manually perform all these steps, which is time-consuming and error-prone.

Solution

The new /git:fix-cherrypick-robot-pr command automates the entire workflow:

  1. Extracts PR metadata - Gets base branch, bug ID, commits from robot PR
  2. Analyzes errors - Parses error messages (user-provided or auto-detected)
  3. Creates clean branch - Following naming convention cherry-pick-<issue>-to-<release>
  4. Cherry-picks commits - All commits from the robot PR
  5. Applies fixes - Guides through repository-specific fixes based on error analysis
  6. Creates replacement PR - With proper formatting and references
  7. Closes old PR - With explanatory comment

Usage

/git:fix-cherrypick-robot-pr https://github.com/org/repo/pull/12345

Error messages:
[paste CI error output here]

Key Features

  • Repo-agnostic: Works with cherrypick-robot PRs across different repositories
  • Flexible error input: Accepts pasted errors, log files, CI URLs, or auto-detects from PR
  • Smart remote discovery: Automatically identifies fork vs upstream remotes
  • Guided fixes: Analyzes errors and guides through appropriate fixes for each repository

Changes

  • New command file: plugins/git/commands/fix-cherrypick-robot-pr.md
  • Updated documentation (PLUGINS.md, docs/data.json)
  • Command is repo-agnostic and works beyond OpenShift projects

Design Decisions

Based on PR feedback:

  • Specific naming: Renamed from fix-robot-pr to fix-cherrypick-robot-pr to clearly distinguish from other robot types (dependabot, konflux, CI backport, etc.)
  • Repo-agnostic: Removed OpenShift-specific error patterns and examples
  • Flexible guidance: Provides fix strategies rather than specific commands, with notes to consult repository documentation

Testing

  • ✅ Command file follows man-page format required by plugin system
  • ✅ Proper frontmatter with description and argument hints
  • ✅ All required sections included (Name, Synopsis, Description, Implementation, Examples, Arguments)
  • ✅ Linter passes with 0 errors, 0 warnings
  • ✅ Command appears in auto-generated PLUGINS.md
  • ✅ Command indexed in docs/data.json

Summary by CodeRabbit

  • New Features
    • Added /git:fix-cherrypick-robot-pr command for the Git plugin, enabling users to manually fix cherry-pick robot PRs that encounter errors. The command automates error analysis, cherry-picks commits, applies necessary fixes, creates a replacement PR, and closes the original with a reference. Supports multiple error detection methods.

✏️ Tip: You can customize this high-level summary in your review settings.

This command helps fix cherrypick-robot PRs that need manual intervention.
When the robot creates a PR but fails due to verification errors, merge
conflicts, or other issues it cannot handle, this command automates the
process of creating a replacement PR with all necessary fixes.

Features:
- Extracts PR metadata (base branch, bug ID, commits) from robot PR
- Analyzes error messages (user-provided or auto-detected from CI)
- Creates a clean branch and cherry-picks all commits
- Applies fixes for common issues:
  - JSON validation errors
  - Missing test annotations
  - Merge conflicts
  - Verification script failures
- Creates replacement PR with proper formatting
- Closes old robot PR with explanatory comment

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
@openshift-ci openshift-ci bot requested review from bentito and dgoodwin November 27, 2025 06:12
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 27, 2025

Walkthrough

This PR adds a new Git plugin command for fixing cherry-pick robot PRs that require manual intervention. The changes include command registration in metadata files and comprehensive documentation describing the command's workflow, arguments, and usage examples.

Changes

Cohort / File(s) Summary
Command registration
PLUGINS.md, docs/data.json
Added new git plugin command entry /git:fix-cherrypick-robot-pr with arguments <pr-url> [error-messages] and description for fixing cherry-pick robot PRs needing manual intervention.
Command documentation
plugins/git/README.md, plugins/git/commands/fix-cherrypick-robot-pr.md
Added comprehensive documentation for the new command, including workflow steps, argument specifications, usage examples (error-message-based, log-file-based, CI-link-based, no-error scenarios), and common issues.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

  • plugins/git/commands/fix-cherrypick-robot-pr.md: Review the detailed multi-step workflow (PR context extraction, error analysis, remote discovery, cherry-picking, fix application, PR creation, original PR closure) for accuracy and completeness.
  • Metadata consistency: Verify that command signatures and descriptions are consistent across PLUGINS.md and docs/data.json.
  • Documentation accuracy: Confirm that the documented workflow aligns with intended plugin behavior and gh command usage patterns.

Pre-merge checks and finishing touches

❌ Failed checks (1 error, 1 inconclusive)
Check name Status Explanation Resolution
No Real People Names In Style References ❌ Error The PR commit message contains 'Co-Authored-By: Claude [email protected]', which names a real entity in repository metadata. Remove the 'Co-Authored-By: Claude' line or replace it with a generic description like 'Co-Authored-By: AI Assistant'.
Git Push Safety Rules ❓ Inconclusive Repository access unavailable to verify explicit user confirmation before git push operations and absence of force push flags in fix-cherrypick-robot-pr.md implementation. Access the plugins/git/commands/fix-cherrypick-robot-pr.md file to verify user confirmation prompts, absence of force push flags, and that pushes target only feature branches on fork remotes.
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately and concisely describes the main change: adding a new git plugin command for fixing cherrypick-robot PRs, which matches the core objective of the pull request.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
No Assumed Git Remote Names ✅ Passed PR implements proper remote discovery using dynamically discovered variables ($UPSTREAM_REMOTE, $FORK_REMOTE) with fallbacks, avoiding hardcoded remote names.
No Untrusted Mcp Servers ✅ Passed This PR adds documentation for a git plugin command without introducing any MCP server installations, npm packages, or untrusted dependencies.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 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
Copy link

openshift-ci bot commented Nov 27, 2025

Hi @wangke19. Thanks for your PR.

I'm waiting for a github.com member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

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 openshift-ci bot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Nov 27, 2025
@wangke19
Copy link
Contributor Author

Here is test results in local:

> /git:fix-robot-pr is running… https://github.com/openshift/origin/pull/30524 "INFO[2025-11-27T05:28:52Z] Running `gofmt -s -l` on 806 file(s).
go vet  ./...
ln -s /go/src/github.com/openshift/origin/vendor "/tmp/tmp.Q8OsXFOhoa/src"
export GO111MODULE=off && export GOPATH=/tmp/tmp.Q8OsXFOhoa && export GOBIN=/tmp/tmp.Q8OsXFOhoa/bin && go install "./vendor/github.com/go-bindata/go-bindata/..."
/tmp/tmp.Q8OsXFOhoa/bin/go-bindata -nocompress -nometadata -prefix "testextended" -pkg "testdata" -o "/tmp/tmp.nP7Y4UgcKG/test/extended/testdata/bindata.go" -ignore "OWNERS" -ignore ".*\.(go|md)$" examples/db-templates examples/image-streams 
examples/sample-app examples/quickstarts/... examples/hello-openshift examples/jenkins/... examples/quickstarts/cakephp-mysql.json test/extended/testdata/... e2echart && gofmt -s -w "/tmp/tmp.nP7Y4UgcKG/test/extended/testdata/bindata.go" && diff -Naup 
{.,/tmp/tmp.nP7Y4UgcKG}/test/extended/testdata/bindata.go
hack/verify-jsonformat.sh
hack/verify-generated.sh
Running hack/verify-generated.sh:13: executing '/go/src/github.com/openshift/origin/hack/update-generated.sh' expecting success...
SUCCESS after 28.537s: hack/verify-generated.sh:13: executing '/go/src/github.com/openshift/origin/hack/update-generated.sh' expecting success
Running hack/verify-generated.sh:14: executing 'git diff --exit-code /go/src/github.com/openshift/origin/test/extended/util/annotate/generated/' expecting success...
FAILURE after 1.085s: hack/verify-generated.sh:14: executing 'git diff --exit-code /go/src/github.com/openshift/origin/test/extended/util/annotate/generated/' expecting success: the command returned the wrong error code
Standard output from the command:
diff --git a/test/extended/util/annotate/generated/zz_generated.annotations.go b/test/extended/util/annotate/generated/zz_generated.annotations.go
index bef677d33e..cbe9b4ad1b 100644
--- a/test/extended/util/annotate/generated/zz_generated.annotations.go
+++ b/test/extended/util/annotate/generated/zz_generated.annotations.go
@@ -95,6 +95,8 @@ var Annotations = map[string]string{
 
     "[sig-api-machinery][Feature:APIServer] TestTLSDefaults": " [Suite:openshift/conformance/parallel]",
 
+    "[sig-api-machinery][Feature:APIServer] TestTLSMinimumVersions": " [Suite:openshift/conformance/parallel]",
+
     "[sig-api-machinery][Feature:APIServer] anonymous browsers should get a 403 from /": " [Suite:openshift/conformance/parallel]",
 
     "[sig-api-machinery][Feature:APIServer] authenticated browser should get a 200 from /": " [Suite:openshift/conformance/parallel]",
There was no error output from the command.
[ERROR] hack/lib/cmd.sh:10: `return "${return_code}"` exited with status 1.
[ERROR] hack/verify-generated.sh exited with code 1 after 00h 00m 30s
make: *** [Makefile:50: verify-origin] Error 1
make: Target 'verify' not remade because of errors." 

● I'll help you fix this cherrypick-robot PR. Let me start by extracting information from the PR and analyzing the error.

● Bash(gh pr view https://github.com/openshift/origin/pull/30524 --json baseRefName,title,commits,number,headRefName)
  ⎿  {                               
       "baseRefName": "release-4.19",
       "commits": [
     … +35 lines (ctrl+o to expand)

● Perfect! Now I have the PR information. Let me analyze the error:

  Error Analysis:
  - Base branch: release-4.19
  - Bug ID: OCPBUGS-65945
  - Commits to cherry-pick:
    - 10d08fc6685aeb547d0d57efa7d897e7a13f7218 (TLS version tests for core services)
    - 45c39828c882d9f3e32a4bbb28fb8522c63e0106 (Accept suggestions)
  - Error: Missing test annotations - the test [sig-api-machinery][Feature:APIServer] TestTLSMinimumVersions needs to be added to the generated annotations file

  The fix is straightforward: we need to run hack/update-generated.sh to regenerate the annotations after cherry-picking.

● Bash(git fetch upstream release-4.19 && git checkout -b cherry-pick-65945-to-release-4.19 upstream/release-4.19)
  ⎿  Running…

  Todos
  ☒ Extract PR information (base branch, commits, bug ID)
  ☒ Analyze error messages to identify required fixes
  ☐ Create new clean branch from base
  ☐ Cherry-pick commits from robot PR
  ☐ Apply fix for missing test annotations
  ☐ Push branch and create replacement PR
  ☐ Close old robot PR with explanation

- Replace hardcoded 'origin' and 'upstream' with dynamic discovery
- Use 'git remote -v' and 'git config user.name' to identify remotes
- Add fallback to common names if auto-discovery fails
- Update Implementation section 3 and 6 with remote discovery logic
- Update Notes section to document the remote discovery approach

This addresses the code review feedback to avoid assuming git remote names.
Copy link
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: 0

🧹 Nitpick comments (1)
plugins/git/commands/fix-robot-pr.md (1)

10-12: Add language specifications to all fenced code blocks for proper syntax highlighting.

Per markdownlint (MD040), all fenced code blocks should declare a language. This ensures consistent rendering and syntax highlighting in documentation viewers.

Apply this diff to add language specifications:

## Synopsis
-```
+```bash
 /git:fix-robot-pr <pr-url> [error-messages]
-```
+```

...

### 1. Extract Information from the Robot PR

-Example:
-```bash
+Example:
+```bash
 gh pr view https://github.com/openshift/origin/pull/30524 --json baseRefName,title,commits,number,statusCheckRollup
-```
+```

...

### 3. Discover Git Remotes and Create Branch

-```bash
+```bash
 # Discover the upstream remote (the main repository)
...
 git checkout -b cherry-pick-<issue-number>-to-<base-branch> $UPSTREAM_REMOTE/<base-branch>
-```
+```

...

### 4. Cherry-Pick Commits

-```bash
+```bash
 # For each commit hash extracted from the robot PR
...
 /git:cherry-pick-by-patch <commit-hash>
-```
+```

...

### 5. Apply Necessary Fixes Based on Errors

-**For JSON validation errors:**
-```bash
+**For JSON validation errors:**
+```bash
 # Add files to exclusion list in hack/verify-jsonformat.sh
 # Edit the excluded_files array to include the problematic JSON file
-```
+```

-**For missing test annotations:**
-```bash
+**For missing test annotations:**
+```bash
 # Regenerate annotations
...
 git commit -m "Update generated test annotations"
-```
+```

### 6. Push and Create Replacement PR

-```bash
+```bash
 # Use the discovered fork remote (from step 3)
...
 )"
-```
+```

### Example 1: With Error Messages Pasted Directly

-```
+```text
 /git:fix-robot-pr https://github.com/openshift/origin/pull/30524
...
 +    "[sig-api-machinery][Feature:APIServer] TestTLSMinimumVersions": " [Suite:openshift/conformance/parallel]",
-```
+```

### Example 2: With Error Log File Reference

-```
+```text
 /git:fix-robot-pr https://github.com/openshift/origin/pull/30524
...
 Error log file: /path/to/ci-errors.log
-```
+```

### Example 3: With CI Failure Page Link

-```
+```text
 /git:fix-robot-pr https://github.com/openshift/origin/pull/30524
...
 CI failure: https://prow.ci.openshift.org/view/gs/test-platform-results/pr-logs/pull/30524/...
-```
+```

### Example 4: No Error Messages (Auto-detect)

-```
+```text
 /git:fix-robot-pr https://github.com/openshift/origin/pull/30524
-```
+```

Also applies to: 39-41, 65-81, 89-95, 102-105, 108-113, 128-162, 187-199, 222-226, 232-237, 242-244

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Cache: Disabled due to data retention organization setting

Knowledge base: Disabled due to data retention organization setting

📥 Commits

Reviewing files that changed from the base of the PR and between 3600d99 and 392a0de.

📒 Files selected for processing (1)
  • plugins/git/commands/fix-robot-pr.md (1 hunks)
🧰 Additional context used
🪛 markdownlint-cli2 (0.18.1)
plugins/git/commands/fix-robot-pr.md

10-10: Fenced code blocks should have a language specified

(MD040, fenced-code-language)


187-187: Fenced code blocks should have a language specified

(MD040, fenced-code-language)


222-222: Fenced code blocks should have a language specified

(MD040, fenced-code-language)


232-232: Fenced code blocks should have a language specified

(MD040, fenced-code-language)


242-242: Fenced code blocks should have a language specified

(MD040, fenced-code-language)

🔇 Additional comments (2)
plugins/git/commands/fix-robot-pr.md (2)

157-160: Verify co-authorship attribution is appropriate for the project.

The PR body template embeds "Claude Code" and "Co-Authored-By: Claude" attribution. Confirm whether this aligns with project conventions for auto-generated content. Some OSS projects may prefer different attribution or removal of tooling references.

If this attribution should be removed or modified, apply this diff:

 ## References
 - Original PR: #<robot-pr-number>
 - JIRA: <bug-id>
 
-🤖 Generated with [Claude Code](https://claude.com/claude-code)
-
-Co-Authored-By: Claude <[email protected]>
+Co-Authored-By: <your-github-username>

1-281: Comprehensive documentation for a well-structured manual workflow.

The documentation is thorough and well-organized. The implementation steps are clear and actionable, the examples cover multiple input scenarios (direct errors, file paths, CI URLs, auto-detection), and error-handling guidance is sound. The frontmatter and structure follow the required format for plugin command documentation.

@wangke19
Copy link
Contributor Author

✅ Verification: No Hardcoded Git Remote Names

All git operations in plugins/git/commands/fix-robot-pr.md use dynamically discovered remote variables.

Git Commands Using Remotes (3 total):

  1. Line 77: git fetch $UPSTREAM_REMOTE <base-branch>
  2. Line 80: git checkout -b ... $UPSTREAM_REMOTE/<base-branch>
  3. Line 135: git push -u $FORK_REMOTE cherry-pick-...

Remote Discovery Implementation:

Section 3 (Lines 66-74): Initial discovery

UPSTREAM_REMOTE=$(git remote -v | grep "openshift.*fetch" | grep -v "$(git config user.name)" | awk '{print $1}' | head -1)
FORK_REMOTE=$(git remote -v | grep "$(git config user.name).*push" | awk '{print $1}' | head -1)
UPSTREAM_REMOTE=${UPSTREAM_REMOTE:-upstream}  # Fallback only
FORK_REMOTE=${FORK_REMOTE:-origin}            # Fallback only

Section 6 (Lines 131-132): Rediscovery for standalone execution

FORK_REMOTE=$(git remote -v | grep "$(git config user.name).*push" | awk '{print $1}' | head -1)
FORK_REMOTE=${FORK_REMOTE:-origin}            # Fallback only

Verification:

  • Zero git commands use hardcoded 'origin' or 'upstream'
  • ✅ All remote references use $UPSTREAM_REMOTE or $FORK_REMOTE variables
  • ✅ Variables populated via git remote -v dynamic discovery
  • ✅ Fallback values only used if discovery fails
  • ✅ Documentation (Notes section) explains the approach

Result: All git operations correctly use discovered remotes. Pre-merge check should pass.

@wangke19
Copy link
Contributor Author

/test lint

@openshift-ci
Copy link

openshift-ci bot commented Nov 27, 2025

@wangke19: Cannot trigger testing until a trusted user reviews the PR and leaves an /ok-to-test message.

Details

In response to this:

/test lint

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.

@wangke19
Copy link
Contributor Author

/cc: @dgoodwin

@rvanderp3
Copy link

/assign

@rvanderp3
Copy link

/ok-to-test

@openshift-ci openshift-ci bot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Nov 28, 2025
@wangke19
Copy link
Contributor Author

wangke19 commented Dec 3, 2025

@bryan-cox @theobarberbany Could you help to review this PR?

@wangke19
Copy link
Contributor Author

wangke19 commented Dec 3, 2025

/uncc @dgoodwin

@openshift-ci openshift-ci bot removed the request for review from dgoodwin December 3, 2025 11:32
docs/data.json Outdated
{
"argument_hint": "<pr-url> [error-messages]",
"description": "Fix a cherrypick-robot PR that needs manual intervention",
"name": "fix-robot-pr",
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we rename this to be more specific on what this command is doing? There are many robot type PRs - dependabot, konflux, CI backport, etc.

Copy link
Contributor Author

@wangke19 wangke19 Dec 3, 2025

Choose a reason for hiding this comment

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

Good suggestion!
Updated.

3. CI failure URL if provided
4. Automatically fetch from PR status checks

Common error patterns:
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not sure this section is helpful 🤔

For example, in HyperShift, many of these shell scripts are actually Makefile commands. I assume this sort of thing could vary wildly within OpenShift.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed specific.

**For missing test annotations:**
```bash
# Regenerate annotations
hack/update-generated.sh
Copy link
Contributor

Choose a reason for hiding this comment

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

This seems repo specific.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed specific.

@wangke19 wangke19 changed the title Add /git:fix-robot-pr command for fixing robot PRs Add /git:fix-cherrypick-robot-pr command for fixing cherrypick-robot PRs Dec 3, 2025
- Rename command to be more specific about cherrypick-robot PRs
  (vs other robot types like dependabot, konflux, CI backport)
- Remove repo-specific error patterns section that assumed OpenShift/origin
  structure (hack/verify-*.sh scripts)
- Generalize fix implementation to work across different repositories
- Update examples to use generic repo URLs instead of openshift/origin
- Add guidance to consult repository documentation for specific commands
- Update PLUGINS.md and docs/data.json with new command name

Addresses feedback from PR review about command specificity and
repository assumptions.
Copy link
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: 1

🧹 Nitpick comments (1)
plugins/git/commands/fix-cherrypick-robot-pr.md (1)

137-161: Customize PR body template for your use case.

The example PR body (lines 137-161) includes hardcoded references to "Claude Code" and "Claude" co-author attribution. While useful as a template example, users should customize these lines to match their team's conventions and attribution practices before using the generated PR body in production.

Consider adding a note after the PR body template example clarifying that users should customize the footer lines to remove or adjust the Claude references as appropriate for their repository.

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Cache: Disabled due to data retention organization setting

Knowledge base: Disabled due to data retention organization setting

📥 Commits

Reviewing files that changed from the base of the PR and between 392a0de and 2f2a6d2.

📒 Files selected for processing (3)
  • PLUGINS.md (1 hunks)
  • docs/data.json (1 hunks)
  • plugins/git/commands/fix-cherrypick-robot-pr.md (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
  • PLUGINS.md
  • docs/data.json
🧰 Additional context used
🪛 markdownlint-cli2 (0.18.1)
plugins/git/commands/fix-cherrypick-robot-pr.md

10-10: Fenced code blocks should have a language specified

(MD040, fenced-code-language)


186-186: Fenced code blocks should have a language specified

(MD040, fenced-code-language)


203-203: Fenced code blocks should have a language specified

(MD040, fenced-code-language)


213-213: Fenced code blocks should have a language specified

(MD040, fenced-code-language)


223-223: Fenced code blocks should have a language specified

(MD040, fenced-code-language)

🔇 Additional comments (1)
plugins/git/commands/fix-cherrypick-robot-pr.md (1)

1-265: Comprehensive and well-structured documentation for the cherry-pick robot PR fix command.

The documentation effectively guides users through a 7-step workflow to replace failed cherrypick-robot PRs with manually crafted alternatives. The design choices align well with PR objectives: repo-agnostic operation, dynamic remote discovery with fallbacks, strategy-based guidance over hardcoded fixes, and flexible error input handling (pasted errors, log files, CI URLs, or auto-detection). The Examples section effectively demonstrates each input scenario, and the Notes section clearly explains fallback behavior and limitations.

git:fix-cherrypick-robot-pr

## Synopsis
```
Copy link
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 specifiers to fenced code blocks for proper rendering.

The following code blocks are missing language specifiers (lines 10, 186, 203, 213, 223), which triggers markdown linting warnings (MD040). Add appropriate language tags (e.g., bash, shell, or text) to improve rendering and pass linting.

Apply this diff to fix the code block language specifiers:

 ## Synopsis

+bash
/git:fix-cherrypick-robot-pr [error-messages]

Then apply the same fix pattern to lines 186, 203, 213, and 223 by replacing the opening ``` with ```bash or another appropriate language identifier.

Also applies to: 186-186, 203-203, 213-213, 223-223

🧰 Tools
🪛 markdownlint-cli2 (0.18.1)

10-10: Fenced code blocks should have a language specified

(MD040, fenced-code-language)

🤖 Prompt for AI Agents
In plugins/git/commands/fix-cherrypick-robot-pr.md around lines 10, 186, 203,
213, and 223, several fenced code blocks are missing language specifiers causing
MD040 lint warnings; update each opening triple-backtick to include an
appropriate language tag (e.g., replace ``` with ```bash or ```shell or ```text
as fits the block) so the markdown code fences render correctly and satisfy the
linter.

@bryan-cox
Copy link
Contributor

/approve

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Dec 3, 2025
@wangke19
Copy link
Contributor Author

wangke19 commented Dec 3, 2025

Test it in local:
```> /git:fix-cherrypick-robot-pr is running… openshift/origin#30524 "INFO[2025-11-27T05:28:52Z] Running gofmt -s -l on 806 file(s).
go vet ./...
ln -s /go/src/github.com/openshift/origin/vendor "/tmp/tmp.Q8OsXFOhoa/src"
export GO111MODULE=off && export GOPATH=/tmp/tmp.Q8OsXFOhoa && export GOBIN=/tmp/tmp.Q8OsXFOhoa/bin && go install "./vendor/github.com/go-bindata/go-bindata/..."
/tmp/tmp.Q8OsXFOhoa/bin/go-bindata -nocompress -nometadata -prefix "testextended" -pkg "testdata" -o "/tmp/tmp.nP7Y4UgcKG/test/extended/testdata/bindata.go" -ignore "OWNERS" -ignore ".*.(go|md)$" examples/db-templates
examples/image-streams
examples/sample-app examples/quickstarts/... examples/hello-openshift examples/jenkins/... examples/quickstarts/cakephp-mysql.json test/extended/testdata/... e2echart && gofmt -s -w
"/tmp/tmp.nP7Y4UgcKG/test/extended/testdata/bindata.go" && diff -Naup
{.,/tmp/tmp.nP7Y4UgcKG}/test/extended/testdata/bindata.go
hack/verify-jsonformat.sh
hack/verify-generated.sh
Running hack/verify-generated.sh:13: executing '/go/src/github.com/openshift/origin/hack/update-generated.sh' expecting success...
SUCCESS after 28.537s: hack/verify-generated.sh:13: executing '/go/src/github.com/openshift/origin/hack/update-generated.sh' expecting success
Running hack/verify-generated.sh:14: executing 'git diff --exit-code /go/src/github.com/openshift/origin/test/extended/util/annotate/generated/' expecting success...
FAILURE after 1.085s: hack/verify-generated.sh:14: executing 'git diff --exit-code /go/src/github.com/openshift/origin/test/extended/util/annotate/generated/' expecting success: the command returned the wrong error code
Standard output from the command:
diff --git a/test/extended/util/annotate/generated/zz_generated.annotations.go b/test/extended/util/annotate/generated/zz_generated.annotations.go
index bef677d33e..cbe9b4ad1b 100644
--- a/test/extended/util/annotate/generated/zz_generated.annotations.go
+++ b/test/extended/util/annotate/generated/zz_generated.annotations.go
@@ -95,6 +95,8 @@ var Annotations = map[string]string{

 "[sig-api-machinery][Feature:APIServer] TestTLSDefaults": " [Suite:openshift/conformance/parallel]",
  • "[sig-api-machinery][Feature:APIServer] TestTLSMinimumVersions": " [Suite:openshift/conformance/parallel]",

  • "[sig-api-machinery][Feature:APIServer] anonymous browsers should get a 403 from /": " [Suite:openshift/conformance/parallel]",

    "[sig-api-machinery][Feature:APIServer] authenticated browser should get a 200 from /": " [Suite:openshift/conformance/parallel]",
    There was no error output from the command.
    [ERROR] hack/lib/cmd.sh:10: return "${return_code}" exited with status 1.
    [ERROR] hack/verify-generated.sh exited with code 1 after 00h 00m 30s
    make: *** [Makefile:50: verify-origin] Error 1
    make: Target 'verify' not remade because of errors."

● I'll help you fix this cherrypick-robot PR. Let me start by extracting information from the PR and analyzing the error.

● Bash(gh pr view openshift/origin#30524 --json baseRefName,title,commits,number,statusCheckRollup)
⎿  Running…

Todos
☐ Extract PR information (base branch, commits, bug ID)
☐ Analyze error messages to identify fixes needed
☐ Discover git remotes and create new branch
☐ Cherry-pick commits from robot PR
☐ Apply fixes for generated file mismatch
☐ Push branch and create replacement PR
☐ Close old robot PR with explanation

──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
Bash command

gh pr view openshift/origin#30524 --json baseRefName,title,commits,number,statusCheckRollup
Extract PR information from robot PR

Do you want to proceed?
❯ 1. Yes
2. Yes, and don't ask again for gh pr view commands in /home/kewang/go/src/github.com/openshift/ai-helpers
3. Type here to tell Claude what to do differently

@wangke19
Copy link
Contributor Author

wangke19 commented Dec 4, 2025

@rvanderp3 can I get a lgtm from you ?

@gangwgr
Copy link
Contributor

gangwgr commented Dec 9, 2025

/lgtm

@openshift-ci
Copy link

openshift-ci bot commented Dec 9, 2025

@gangwgr: changing LGTM is restricted to collaborators

Details

In response to this:

/lgtm

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.

@rvanderp3
Copy link

/lgtm

@openshift-ci
Copy link

openshift-ci bot commented Dec 9, 2025

@rvanderp3: changing LGTM is restricted to collaborators

Details

In response to this:

/lgtm

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.

@xingxingxia
Copy link
Contributor

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Dec 11, 2025
@wangke19
Copy link
Contributor Author

/test lint

@openshift-ci
Copy link

openshift-ci bot commented Dec 11, 2025

@wangke19: The specified target(s) for /test were not found.
The following commands are available to trigger required jobs:

/test images

Use /test all to run all jobs.

Details

In response to this:

/test lint

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.

@wangke19
Copy link
Contributor Author

/test all

@LiangquanLi930
Copy link
Contributor

/lgtm

@openshift-ci
Copy link

openshift-ci bot commented Dec 22, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: bryan-cox, gangwgr, LiangquanLi930, rvanderp3, wangke19, xingxingxia

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:
  • OWNERS [LiangquanLi930,bryan-cox,rvanderp3]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@wangke19
Copy link
Contributor Author

/assign @bentito

@openshift-merge-bot openshift-merge-bot bot merged commit 41fc572 into openshift-eng:main Dec 25, 2025
4 checks passed
@wangke19 wangke19 deleted the add-git-fix-robot-pr branch December 25, 2025 14:06
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. lgtm Indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants