Repository navigation
feat(cli): expose Jira through the Orca CLI, with an orca-jira skill guide - #11986
dcieslak19973 wants to merge 3 commits into
Conversation
Greptile SummaryThis PR wires Jira into the Orca CLI via 17 new commands (
Confidence Score: 5/5Safe to merge; all write paths guard ok:false responses, the label-set regression is fixed, and the transition resolver handles ambiguity and no-match correctly. The change is additive CLI surface over an existing RPC layer with no schema or transport modifications. The label-set guard, transition disambiguation logic, and ok:false promotion are all exercised by the test suite. The one gap — no test for comment add with an ok:false response — is isolated and does not affect correctness of other commands. Files Needing Attention: No files require special attention; the comment add ok:false path in handlers/jira.ts is the only untested branch.
|
| Filename | Overview |
|---|---|
| src/cli/handlers/jira.ts | 17 Jira command handlers over existing jira.* RPC; label-set guard, ok:false promotion to errors, and ambiguous-transition handling all correct. comment add ok:false path has no dedicated test. |
| src/cli/handlers/jira.test.ts | 14 tests covering transition resolution, label-set guard, ok:false errors, and create success/failure; missing coverage for comment add ok:false and status set with neither --to nor --to-id. |
| src/cli/jira-format.ts | Formatters for all 7 result shapes; formatJiraCreate correctly accepts only the ok:true branch, matching the handler's invariant. |
| src/cli/specs/jira.ts | 17 command specs; allowedFlags, positionalArgs, and usage strings are consistent with handlers and skill guide. |
| src/cli/handler-group-manifest.ts | Jira handler group added with all 17 keys matching the exported JIRA_HANDLERS record; drift detection is CI-enforced. |
| skill-guides/orca-jira.md | Comprehensive agent-facing guide covering preconditions, untrusted-input warnings, transition semantics, completion flow, and error recovery. |
| src/cli/specs/index.ts | JIRA_COMMAND_SPECS correctly wired into the main COMMAND_SPECS array. |
Sequence Diagram
sequenceDiagram
participant Agent
participant CLI as orca jira CLI
participant Dispatch as Handler Dispatch
participant RPC as jira.* RPC
Agent->>CLI: orca jira status set ENG-1 --to "In Review"
CLI->>Dispatch: route → jira status set handler
Dispatch->>RPC: "jira.listTransitions {key, siteId}"
RPC-->>Dispatch: "[{id, name, to.name}, ...]"
Note over Dispatch: match --to against name/to.name<br/>ambiguous → error, none → error
Dispatch->>RPC: "jira.updateIssue {key, siteId, updates:{transitionId}}"
RPC-->>Dispatch: "{ok: true} | {ok: false, error}"
Note over Dispatch: ok:false → RuntimeClientError
Dispatch-->>Agent: Updated ENG-1 (exit 0)
Agent->>CLI: orca jira label set ENG-1 --label backend
CLI->>Dispatch: route → jira label set handler
Note over Dispatch: labels.length === 0 → throw before RPC
Dispatch->>RPC: "jira.updateIssue {key, siteId, updates:{labels}}"
RPC-->>Dispatch: "{ok: true}"
Dispatch-->>Agent: Updated ENG-1 (exit 0)
Reviews (4): Last reviewed commit: "refactor(cli): drop unreachable failure ..." | Re-trigger Greptile
|
Important Review skippedWe couldn't safely recover the incremental review. No full review was started, and the last reviewed checkpoint was preserved. Retry later, or explicitly request a full review by commenting You can disable this status message by setting the Use the checkbox below for a quick retry:
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:
📝 WalkthroughWalkthroughAdded Jira CLI specifications, lazy handler registration, issue and metadata operations, transition handling, mutation support, output formatting, and automated tests. Added the 🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
src/cli/handlers/jira.ts (1)
177-181: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winDrop the unnecessary type cast in the comment-add handler.
applyUpdatehandles the sameJiraMutationResultwith the sameif (!response.result.ok) throwguard and passesresponsedirectly toprintResult. This handler does the same, so remove the misleading assertion.♻️ Proposed fix to remove the cast
- printResult( - response as { result: { ok: true } } & typeof response, - ctx.json, - () => `Commented on ${key}` - ) + printResult(response, ctx.json, () => `Commented on ${key}`)
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 753b132a-7232-4c79-9b97-604991c168ea
📥 Commits
Reviewing files that changed from the base of the PR and between 16c5526 and fdd97459453d8c7cf92b009ff1a0daf02c47e7c4.
📒 Files selected for processing (13)
config/scripts/generate-bundled-skill-guides.mjsresources/skills/current-manifest.jsonresources/skills/snapshot-registry.jsonskill-guides/orca-jira.mdskill-stubs/orca-jira.mdskills/orca-jira/SKILL.mdsrc/cli/bundled-skill-guides.tssrc/cli/handler-group-manifest.tssrc/cli/handlers/jira.test.tssrc/cli/handlers/jira.tssrc/cli/jira-format.tssrc/cli/specs/index.tssrc/cli/specs/jira.ts
f66ad45 to
79872d6
Compare
9386301 to
c3a285e
Compare
fdacfd5 to
7cb08d5
Compare
7cb08d5 to
a0315a0
Compare
8c9c6bf to
36a930c
Compare
- Register 'jira' in CLI_COMMAND_NAMES so the launch redirect matches
COMMAND_SPECS (cli-command-name-parity.test.ts).
- Trim the orca-jira skill description below the angle-bracket
placeholder rule and move the detailed command examples into the
guide body (skill-description-length.test.mjs).
- Rewrite skill-guides/orca-jira.md to use the ORCA placeholder and
state the shared-resolver sentence, mirroring orca-linear.md
(generate-bundled-skill-guides.test.mjs).
- Regenerate skills/orca-jira/SKILL.md, src/cli/bundled-skill-guides.ts
(generate-bundled-skill-guides.mjs --write) and
resources/skills/{current-manifest,snapshot-registry}.json
(generate-skill-bundle-manifest.mjs --write) so the registered
gitTreeSha matches the observed skill tree
(skill-git-tree-identity.test.ts).
36a930c to
ce3ec54
Compare
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]>
What: Agents can read and write Jira from the worktree CLI — 23 existing runtime RPCs exposed as
orca jiracommands, with a skill guide.Risk: Purely additive CLI surface over existing RPCs; no transport or Jira-logic changes. Greptile: 5/5 "Safe to merge".
State: Rebased on
maintoday (0 behind, 0 conflicts); all review-bot threads resolved; CLI suite green (707 tests).Closes #11982.
Jira had 23 working runtime RPC methods and zero agent-reachable commands. A user could browse, create, and update Jira issues in the UI, but the agent in their worktree had no way to touch Jira. Every other agent-operable surface in Orca has a CLI handler —
browser-*,computer,emulator,orchestration,automations,terminal,file,worktree,skills. Task providers were the only category with one provider wired and another not.What this adds
CLI surface (
src/cli/specs/jira.ts,handlers/jira.ts,jira-format.ts) — 17 commands over the existingjira.*RPC. No new transport or capability.Skill guide (
skill-guides/orca-jira.md+ stub) so agents discover the commands. Without it the CLI exists but goes unused.Notable decisions
Calls
jira.*directly rather than adding ajira.agent*layer. Linear's CLI goes through a dedicated agent-access surface (linear.agentSearchIssues,linear.issueContext). That layer is not mandatory —automation.*,browser.*, andaccounts.*handlers all call plain methods. Linear's extra layer buys multi-workspace fan-out and warning aggregation, which this surface does not have yet. Happy to add one if maintainers prefer the Linear shape.status set --toresolves transitions client-side. Jira validates transitions against the issue's current status, so--to "In Review"lists the issue's transitions and matches on either the transition name or destination status name. When nothing matches, the error enumerates what is available.--to-idskips the lookup. This is the piece that makes Jira usable in an automated loop — valid next states are enumerable rather than guessed.ok:falsebodies become CLI errors. Jira reports some write failures inside a 200 response; those raise instead of printing a success line, so a non-zero exit means the write did not land.Vocabulary policy. Single-item read is a bare positional (
jira issue <key>), matchinglinear issueand avoiding theget→showrule. Incremental label edits are deliberately omitted —linear label removeis grandfathered in the deletion-family allowlist, so a newjira label removewould be a fresh violation. Onlylabel setships.Scope correction vs the issue
#11982 asked for
jira-tickets.mdandorca-jira.md. Onlyorca-jirais here.linear-ticketsis explicitly a legacy bundled alias fororca-linearkept for existing installs, and the alias ledger ingenerate-bundled-skill-guides.mjsis append-only — mintingjira-ticketswould permanently register a legacy name that never had one.Deliberately out of scope
Issue relations (links, subtasks, epic links) and an
issue-contextfan-out layer for rich agent prompts. Linear has both; Jira has neither. Those are a larger design conversation, likely tied to the generic task-source contract in #8376 / #8980.Verification
src/clisuitejira.test.tsverify:bundled-skill-guides/verify:skill-bundle-manifesttsc --noEmit(CLI project)oxlint+ both code-quality audits (--deny-warnings)Cloud and Server/DC endpoint branching already exists in
src/main/jira/issues.ts, so these commands should work against both without provider-specific paths. I have not exercised Server/DC.Two notes on my Windows dev box, both confirmed pre-existing on an unrelated branch:
src/main/skillshas 3 failures (symlink elevation,git write-treeCRLF), andcheck-changed-code-quality.mjsdies withspawnSync pnpm.cmd EINVALunder Node 24 — I ran the twooxlintaudits it wraps directly instead.🤖 Generated with Claude Code