Skip to content

feat(cli): read Jira issues using existing Orca connections - #26055

Closed
kokbee wants to merge 1 commit into
stablyai:mainfrom
kokbee:feat/jira-read-cli
Closed

kokbee wants to merge 1 commit into
stablyai:mainfrom
kokbee:feat/jira-read-cli

Conversation

@kokbee

@kokbee kokbee commented Oct 7, 2026

Copy link
Copy Markdown
Contributor

ELI5

A Jira site can be connected in Orca settings while an agent still cannot read a ticket from the command line. This adds read-only Jira commands that use that existing connection, without requiring a separate Atlassian MCP login.

What Changed

  • orca jira status lists the selected runtime's saved Jira sites.
  • orca jira issue <key-or-url> [--site <site-id>] reads an issue.
  • orca jira comments <key-or-url> [--site <site-id>] reads comments.

The commands call existing Jira RPC methods through the normal runtime client, support --json, and appear in root help and agent command discovery. URLs must match a connected site's origin and path. A bare key requires --site when multiple sites are connected, preventing an unintended cross-site lookup.

A missing issue exits with an error. Existing runtimes also return an empty comment array on some read failures, so the comments command reports jira_comments_unverified with exit code 1 for empty results instead of claiming that no comments exist. This includes genuinely comment-free issues; the command help documents the limitation.

Why

Orca already owns the Jira credentials and read operations. Reusing those methods avoids a second credential store or OAuth flow and preserves the selected runtime's routing. This PR adds the missing CLI entry points; it does not change MCP authentication or the Jira settings connection.

Linked Issue

Implements the read-only issue-access portion of #11982. The broader issue remains open: search, writes, transitions, and a dedicated Jira skill guide are outside this PR.

Visual Proof

N/A — CLI-only changes; no rendered UI changes.

Before: orca --help exposes Linear commands but no Jira command group.
After: jira status, jira issue, and jira comments are registered and discoverable.

Testing

  • I manually tested these changes locally
  • Automated tests added/updated

On macOS, built the CLI and read an issue using an existing Jira connection on Orca 1.4.222. No credentials or private ticket content are included in this PR.

Scoped oxlint, pnpm tc:cli, and pnpm run build:cli passed. Five related suites passed 71 tests before the final empty-comment regression; the final Jira suite passed all 8 tests. Coverage includes URL/site mismatch, ambiguous keys, remote-runtime forwarding, unavailable issues, unrelated site credential errors, and unverified empty comments.

The pnpm test wrapper could not start because Bun is unavailable locally. Tests ran with ORCA_BACKGROUND_LAUNCH=1 pnpm exec vitest run --config config/vitest.config.ts instead. Full application checks are left to CI. The build's optional global orca-dev symlink installation warned about permissions; CLI compilation succeeded.

AI Disclosure

Implemented with OpenAI Codex (GPT-6), with separate code review and QA passes.

Review

Independent review identified the ambiguous empty-comment response. The final change reports it as unverified and adds a regression test; follow-up review accepted this compatibility limitation.

Agent skill upstream boundary

  • Not applicable; no upstream skill-installer material is copied or translated.

Notes

No new runtime methods, wire fields, credential storage, or UI changes. Live validation was on macOS; Windows, Linux, and live SSH were not exercised. Remote runtime selection is covered by an automated test.

Checklist

  • This PR is small and focused
  • I explained what changed and why
  • N/A visual proof explained
  • Self-reviewed for correctness, security, and performance
  • Cross-platform and remote routing considered
  • Full pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass; scoped checks passed locally, full checks remain for CI

@coderabbitai

coderabbitai Bot commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

📝 Walkthrough

Walkthrough

The CLI adds jira status, jira issue, and jira comments commands. Issue and comment requests accept an issue key or browse URL and select a connected site, with --site available to narrow selection. The handlers report connection status, issue details, or comments, and return errors for invalid targets, unavailable issues, and unverified empty comment results. Tests cover site selection, runtime calls, and these error cases.

Priority: ⬇️ Low

Merge Risk: 🔵 Low · up to 27dc9

The commands are mergeable with a bounded test-confidence concern: isolate exit-code state so each Jira failure test proves its own result.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 2 functions across 7 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: adding Jira issue-reading commands that use existing Orca connections.
Description check ✅ Passed The description covers the required sections, explains the user-facing change and rationale, links the issue, provides CLI-specific visual-proof context, and reports testing and limitations. It also i…
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.
  • Fix all pre-merge checks with AI
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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.

🧹 Nitpick comments (1)
src/cli/index-jira.test.ts (1)

86-135: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

Isolate process.exitCode between tests.

main sets process.exitCode when it catches a CLI error, but the shared test hooks do not reset it. A later assertion can therefore pass using the value left by an earlier test, without proving that its own path set the exit code. Clear it before each test and restore the original value afterward.

Suggested fix
-import { describe, expect, it, vi } from 'vitest'
+import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'
...
 describe('Jira CLI', () => {
+  const originalExitCode = process.exitCode
+  beforeEach(() => {
+    process.exitCode = undefined
+  })
+  afterEach(() => {
+    process.exitCode = originalExitCode
+  })
+
   useWorktreeAwarenessEnvironment({
🔇 Additional comments (3)
src/cli/handler-group-manifest.ts (1)

15-19: LGTM!

src/cli/handlers/jira.ts (2)

12-32: LGTM!


49-54: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

⚠️ Unverified finding
Verification ran but could not confirm this finding. It is shown for review, not as a verified issue.

Remove the dead null branch in the issue formatter.

The handler throws on a falsy response.result at Line 49. The formatter at Line 56 therefore never receives null, and its issue ? ... : '' branch is unreachable. Remove the ternary for clearer code. This is low-value and optional.


ℹ️ Review info
⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 537784be-25b1-42e4-9fa6-ae290656b5a9
📥 Commits

Reviewing files that changed from the base of the PR and between 70c6876 and 27dc9b9.

📒 Files selected for processing (7)
  • src/cli/args.ts
  • src/cli/handler-group-manifest.ts
  • src/cli/handlers/jira.ts
  • src/cli/index-jira.test.ts
  • src/cli/root-help-text-primary.ts
  • src/cli/specs/index.ts
  • src/cli/specs/jira.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

nwparker added a commit that referenced this pull request Oct 14, 2026
Expose host-owned verified Jira reads and single-attempt writes through the CLI. Preserve site ambiguity checks, old-host capability refusal, atomic label changes, and uncertainty after failed writes.

Refs #11986 and #26055.

Co-authored-by: Dan Cieslak <[email protected]>
Co-authored-by: kokbee <[email protected]>
@kokbee

kokbee commented Oct 15, 2026

Copy link
Copy Markdown
Contributor Author

Closing this PR as superseded by #28592, which incorporates the Jira site selection and saved-connection reporting from this work. Thanks for preserving the co-author credit!

@kokbee kokbee closed this Oct 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant