fix(jira): skip PR creation in /jira:solve when --ci flag is passed - #601
Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
WalkthroughThe Jira solve guide now makes PR creation and PR description review conditional on ChangesJira solve flow
Plugin metadata sync
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
Suggested labels: Suggested reviewers: Important Pre-merge checks failedPlease resolve all errors before merging. Addressing warnings is optional. ❌ Failed checks (2 errors)
✅ Passed checks (8 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 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 `@plugins/jira/commands/solve.md`:
- Around line 118-129: The push/PR flow in solve.md still assumes an automatic
push and hard-codes the PR remote as origin, which should be corrected. Update
the instructions around the branch push and PR creation steps so the command
asks for explicit user confirmation before pushing, then determines the
appropriate remote dynamically (for example by inspecting git remote -v or git
branch -vv) instead of naming origin directly. Keep the PR creation guidance in
sync with the resolved remote and ensure the documented flow uses the existing
solve command behavior without assuming a fixed remote name.
- Around line 136-139: The PR description update flow in solve.md currently uses
gh pr edit with --body, which can break on multiline Markdown or embedded
quotes. Update the instructions for the PR edit step to use a temp file or
heredoc-backed --body-file approach instead of passing the description inline.
Keep the guidance aligned with the existing review loop around the PR edit
command so the user-facing behavior stays the same.
🪄 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: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: 63650253-26de-42a2-b1f0-49da79656d4a
📒 Files selected for processing (1)
plugins/jira/commands/solve.md
99f31f6 to
ffe2b2f
Compare
There was a problem hiding this comment.
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 `@plugins/jira/commands/solve.md`:
- Line 126: The example text under the generated-by sentence is using the wrong
slash-command form and should match the documented synopsis. Update the wording
in solve.md near the `/jira-solve` example to use the same command style as the
rest of the document, specifically the `/jira:solve` form, and keep the
reference to the triggering issue/user in the example sentence.
🪄 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: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: 5ff33225-9271-48ae-893f-b0630e023ee5
📒 Files selected for processing (4)
docs/index.htmlplugins/jira/.claude-plugin/plugin.jsonplugins/jira/commands/solve.mdplugins/openshift-developer/.claude-plugin/plugin.json
✅ Files skipped from review due to trivial changes (3)
- plugins/jira/.claude-plugin/plugin.json
- plugins/openshift-developer/.claude-plugin/plugin.json
- docs/index.html
ffe2b2f to
859838e
Compare
The jira-agent CI pipeline handles PR creation in a separate phase (Phase 4 via /openshift-developer:create-pr), but /jira:solve was always attempting to create a PR in its own Phase 5. This caused failures when the GitHub App token lacked permissions, which could propagate as a non-zero exit code and prevent subsequent pipeline phases from running. Move branch push to Phase 4 (Commit Creation) so it always happens, and gate PR creation/review (Phases 5-6) behind the --ci flag. Interactive mode is unchanged. Ref: CNTRLPLANE-3769, CNTRLPLANE-3760 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
859838e to
f1a26c0
Compare
There was a problem hiding this comment.
♻️ Duplicate comments (3)
plugins/jira/commands/solve.md (3)
136-139: 🎯 Functional Correctness | 🟡 MinorUse
--body-filefor PR description edits.Inline
--body "{new_description}"will break on multiline Markdown or embedded quotes; switch this loop to a temp file-backed update.Based on previous review feedback, this PR edit flow needs a
--body-filepath.🤖 Prompt for 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. In `@plugins/jira/commands/solve.md` around lines 136 - 139, The PR description update flow in solve.md still uses inline gh pr edit --body, which can break on multiline Markdown or quotes. Update the review loop instructions to write the new description to a temp file and use gh pr edit with --body-file instead, keeping the existing “If the user says yes or requests changes” flow intact.
126-126: 🎯 Functional Correctness | 🟡 MinorMatch the documented slash-command form.
The generated-by example still says
/jira-solve; keep it on/jira:solveso the docs stay consistent.Based on previous review feedback, this example should match the documented synopsis.
🤖 Prompt for 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. In `@plugins/jira/commands/solve.md` at line 126, Update the generated-by example in the `solve` command docs so it matches the documented slash-command synopsis: replace the `/jira-solve` reference with the `jira:solve` form used by the `solve.md` command text, and keep the example showing the triggering command in the same sentence.
118-129: 🎯 Functional Correctness | 🟠 MajorGate the push and keep the PR remote aligned.
This still pushes automatically, so it needs explicit user confirmation before any push. It also leaves PR creation hard-coded to
origin, so the push remote and PR target can diverge.As per coding guidelines, commands must never push without explicit user permission and must not assume a fixed remote name.
🤖 Prompt for 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. In `@plugins/jira/commands/solve.md` around lines 118 - 129, The push and PR creation logic in solve.md currently assumes an automatic push and a fixed PR remote, which conflicts with the requested behavior. Update the /jira-solve flow so the push step only runs after explicit user confirmation, and make the PR target use the same remote provided via $2 rather than hard-coding origin in the PR creation instructions. Keep the branch push and PR creation steps aligned in the command flow, referencing the existing “Push the branch” and “PR Creation” sections.Source: Coding guidelines
🤖 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.
Duplicate comments:
In `@plugins/jira/commands/solve.md`:
- Around line 136-139: The PR description update flow in solve.md still uses
inline gh pr edit --body, which can break on multiline Markdown or quotes.
Update the review loop instructions to write the new description to a temp file
and use gh pr edit with --body-file instead, keeping the existing “If the user
says yes or requests changes” flow intact.
- Line 126: Update the generated-by example in the `solve` command docs so it
matches the documented slash-command synopsis: replace the `/jira-solve`
reference with the `jira:solve` form used by the `solve.md` command text, and
keep the example showing the triggering command in the same sentence.
- Around line 118-129: The push and PR creation logic in solve.md currently
assumes an automatic push and a fixed PR remote, which conflicts with the
requested behavior. Update the /jira-solve flow so the push step only runs after
explicit user confirmation, and make the PR target use the same remote provided
via $2 rather than hard-coding origin in the PR creation instructions. Keep the
branch push and PR creation steps aligned in the command flow, referencing the
existing “Push the branch” and “PR Creation” sections.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: 48d0ebd9-2f17-4436-b7c4-016c07096442
📒 Files selected for processing (5)
.claude-plugin/marketplace.jsondocs/index.htmlplugins/jira/.claude-plugin/plugin.jsonplugins/jira/commands/solve.mdplugins/openshift-developer/.claude-plugin/plugin.json
✅ Files skipped from review due to trivial changes (3)
- .claude-plugin/marketplace.json
- plugins/jira/.claude-plugin/plugin.json
- docs/index.html
🚧 Files skipped from review as they are similar to previous changes (1)
- plugins/openshift-developer/.claude-plugin/plugin.json
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: enxebre, jparrill The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Summary
--ciflag--cicheck — when--ciis set, skip PR creation entirely--ci) is unchangedWhy
The jira-agent CI pipeline handles PR creation in a separate phase (Phase 4 via
/openshift-developer:create-pr), but/jira:solvewas always attempting to create a PR in its own Phase 5. This caused:Test plan
/jira:solve ISSUE origin) still creates PRs as before/jira:solve ISSUE origin --ci) pushes the branch but skips PR creation🤖 Generated with Claude Code
Summary by CodeRabbit
jira:solveprocess flow so PR creation is conditional on the--ciflag (CI skips PR creation; non-CI creates a draft PR and specifies title/description/template expectations).$2) is required.0.8.2.1.1.7and updated its Jira dependency version to^0.8.2(including Marketplace metadata).