Skip to content

fix(jira): skip PR creation in /jira:solve when --ci flag is passed - #601

Merged
openshift-merge-bot[bot] merged 1 commit into
mainfrom
fix/jira-solve-skip-pr-in-ci
Jul 6, 2026
Merged

openshift-merge-bot[bot] merged 1 commit into
mainfrom
fix/jira-solve-skip-pr-in-ci

Conversation

@enxebre

@enxebre enxebre commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Move branch push from Phase 5 (PR Creation) to Phase 4 (Commit Creation) so it always happens regardless of --ci flag
  • Gate PR creation and PR description review (Phases 5-6) behind --ci check — when --ci is set, skip PR creation entirely
  • Interactive mode (no --ci) is unchanged

Why

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:

  1. PR creation failures when the GitHub App token lacked permissions
  2. Non-zero exit codes propagated to the harness (CNTRLPLANE-3769)
  3. Harness skipping phases 2-4 (review, fix, PR creation), wasting the solve work (CNTRLPLANE-3760)

Test plan

  • Verify interactive mode (/jira:solve ISSUE origin) still creates PRs as before
  • Verify CI mode (/jira:solve ISSUE origin --ci) pushes the branch but skips PR creation
  • Run a jira-agent periodic job with the updated plugin and confirm all 4 phases complete

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Documentation
    • Updated jira:solve process flow so PR creation is conditional on the --ci flag (CI skips PR creation; non-CI creates a draft PR and specifies title/description/template expectations).
    • Adjusted PR description review behavior: CI omits review, while non-CI continues the interactive prompt loop to update the PR body.
    • Clarified that the remote repository argument ($2) is required.
  • Chores
    • Bumped Jira plugin version (and Marketplace metadata) to 0.8.2.
    • Bumped OpenShift Developer plugin version to 1.1.7 and updated its Jira dependency version to ^0.8.2 (including Marketplace metadata).

@openshift-ci
openshift-ci Bot requested review from nstielau and rhamini3 July 3, 2026 16:04
@openshift-ci openshift-ci Bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jul 3, 2026
@coderabbitai

coderabbitai Bot commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Note

Reviews paused

It 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 reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

Walkthrough

The Jira solve guide now makes PR creation and PR description review conditional on --ci, and the Jira/OpenShift Developer plugin manifests and marketplace metadata are bumped to matching versions.

Changes

Jira solve flow

Layer / File(s) Summary
CI-gated PR flow
plugins/jira/commands/solve.md
jira:solve now pushes to the required remote, skips PR creation and review in CI mode, and keeps the interactive draft PR body update flow for non-CI runs.
Required remote argument
plugins/jira/commands/solve.md
$2 is now required as the remote repository argument instead of defaulting to origin.

Plugin metadata sync

Layer / File(s) Summary
Manifest and marketplace version updates
plugins/jira/.claude-plugin/plugin.json, plugins/openshift-developer/.claude-plugin/plugin.json, .claude-plugin/marketplace.json, docs/index.html
Bumps the Jira plugin version, the OpenShift Developer bundle version, and the matching marketplace/documentation version entries; the OpenShift Developer manifest also updates its Jira dependency version.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

Suggested labels: lgtm, ok-to-test

Suggested reviewers: stbenjam, zaneb


Important

Pre-merge checks failed

Please resolve all errors before merging. Addressing warnings is optional.

❌ Failed checks (2 errors)

Check name Status Explanation Resolution
No Assumed Git Remote Names ❌ Error solve.md still hardcodes origin for PR creation and examples, violating the no-assumed-remote rule. Replace hardcoded origin with the user-supplied/discovered remote and update examples/docs to avoid assuming any remote name.
Git Push Safety Rules ❌ Error plugins/jira/commands/solve.md now instructs an automatic branch push to $2 without any user-confirmation step, which violates the no-autopush rule. Add an explicit user-approval prompt before any git push, or remove the push step from the command. Keep pushes user-initiated only; avoid main/master and force-push variants.
✅ Passed checks (8 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the main change: /jira:solve now skips PR creation when --ci is passed.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.
No Real People Names In Style References ✅ Passed No real-person names appear as style references/examples; only product names and slash-command/issue examples were found.
No Untrusted Mcp Servers ✅ Passed Diff only bumps plugin versions and updates docs; no new MCP server deps, npx installs, or external MCP repos were added.
Ai-Helpers Overlap Detection ✅ Passed No overlap ≥60% found: the only related content, openshift-developer:create-pr, just opens a PR, while jira:solve also analyzes JIRA, implements changes, and gates PR creation.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/jira-solve-skip-pr-in-ci

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

@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: 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

📥 Commits

Reviewing files that changed from the base of the PR and between 4e91f57 and 7762a7c.

📒 Files selected for processing (1)
  • plugins/jira/commands/solve.md

Comment thread plugins/jira/commands/solve.md
Comment thread plugins/jira/commands/solve.md
@enxebre
enxebre force-pushed the fix/jira-solve-skip-pr-in-ci branch from 99f31f6 to ffe2b2f Compare July 3, 2026 16:15

@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 `@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

📥 Commits

Reviewing files that changed from the base of the PR and between 99f31f6 and ffe2b2f.

📒 Files selected for processing (4)
  • docs/index.html
  • plugins/jira/.claude-plugin/plugin.json
  • plugins/jira/commands/solve.md
  • plugins/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

Comment thread plugins/jira/commands/solve.md Outdated
@enxebre
enxebre force-pushed the fix/jira-solve-skip-pr-in-ci branch from ffe2b2f to 859838e Compare July 3, 2026 16:20
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>
@enxebre
enxebre force-pushed the fix/jira-solve-skip-pr-in-ci branch from 859838e to f1a26c0 Compare July 3, 2026 16:22

@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.

♻️ Duplicate comments (3)
plugins/jira/commands/solve.md (3)

136-139: 🎯 Functional Correctness | 🟡 Minor

Use --body-file for 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-file path.

🤖 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 | 🟡 Minor

Match the documented slash-command form.

The generated-by example still says /jira-solve; keep it on /jira:solve so 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 | 🟠 Major

Gate 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

📥 Commits

Reviewing files that changed from the base of the PR and between ffe2b2f and 859838e.

📒 Files selected for processing (5)
  • .claude-plugin/marketplace.json
  • docs/index.html
  • plugins/jira/.claude-plugin/plugin.json
  • plugins/jira/commands/solve.md
  • plugins/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

@jparrill jparrill 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.

/lgtm

@openshift-ci openshift-ci Bot added the lgtm Indicates that a PR is ready to be merged. label Jul 6, 2026
@openshift-ci

openshift-ci Bot commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

[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

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-merge-bot
openshift-merge-bot Bot merged commit 6a1da75 into main Jul 6, 2026
10 checks passed
@enxebre
enxebre deleted the fix/jira-solve-skip-pr-in-ci branch July 6, 2026 15:28
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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants