Skip to content

feat(cli): resolve Jira keys in workspace references - #28619

Merged
nwparker merged 1 commit into
mainfrom
nwparker/jira-reference-keys
Oct 14, 2026
Merged

nwparker merged 1 commit into
mainfrom
nwparker/jira-reference-keys

Conversation

@nwparker

@nwparker nwparker commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 1 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​347 0 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​347
Prod 10 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​169 $\color{#cf222e}{\Huge{\mathbf{−}}}$​64 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​105

ELI5

A Jira key such as ENG-123 can now attach its ticket to an existing workspace or a new worktree. Orca finds the ticket's title and full URL on the chosen Jira site before saving the link.

What Changed

Before, reference add and worktree create --reference accepted only full URLs. Both now also accept Jira keys, including lowercase keys, and --reference-site <id> selects the site when needed. Full URLs retain their existing behavior for Jira, GitHub, GitLab and Linear.

All inputs are parsed before requests, and Jira keys are resolved and checked for the requested key, exact site/context path, canonical URL and title before any workspace write or creation. The existing Jira CLI resolver pins one execution-host site for the whole request. Links use linkedItems and the host's existing merge of added and removed references; duplicate links preserve stored metadata and selection. Existing URL and opaque-key removal remains independent of Jira availability. The unchanged repository selector for worktree creation moves into the existing project-target module to keep the handler within its file-size limit.

Why

This completes the CLI workspace-linking proposal from #11659 through Orca's current reference commands. Reusing the resolver from #28592 and the existing generic reference storage avoids a competing single-ticket field or a new legacy worktree set --jira alias. Other providers continue to require full URLs because a bare key here deliberately identifies Jira.

Linked Issue

Refs #11982 and #10905. Implements the CLI linking follow-up proposed in #11659; #10905 remains open for its Create Worktree composer requirements.

Prerequisite completed: #28592 is merged. This PR now targets main and contains only the Jira reference feature. The current main clock fix and regression coverage are already present.

Visual Proof

N/A — CLI reference input and existing storage behavior only; no renderer layout or interaction changed. A compiled-CLI demonstration used a temporary synthetic runtime socket, with no real Jira account contacted:

$ orca reference add eng-1 --worktree name:api --json
# Resolves ENG-1 on fixture-site and saves its title + browse URL.

$ orca reference add eng-1 --worktree name:api --reference-site fixture-site --json
# already_linked; no workspace mutation.

$ orca worktree create --name fixture --repo id:repo --no-parent --reference eng-1 --reference-site fixture-site --json
# Resolves the reference before worktree.create.

$ orca reference remove https://fixture.atlassian.net/browse/ENG-1 --worktree name:api --json
# Removes the stored link without any Jira request.

The demonstration also verified ambiguity, wrong-site summaries, invalid mixed inputs and old-host refusal without workspace writes.

Testing

  • I manually tested these changes locally
  • Automated tests added/updated, or explained why not below

On macOS, 200 focused tests in eight suites passed on the refreshed head with at most two test workers. Coverage includes lowercase keys, explicit and ambiguous sites, Server context paths, missing/mismatched summaries and titles, strict lookup errors, mixed-provider URLs, duplicate metadata, folder updates, paired-host routing, old hosts, creation ordering, required create flags, concurrent reference updates and failure of a later key preventing all writes. The Jira-key regression failed on the original base before implementation.

The remaining feature commit was rebased onto current main without conflicts; git range-diff confirms the feature patch is unchanged. All seven changed-code quality scans passed against main with zero new findings across ten code files. Bundled-guide verification and git diff --check passed. The original reference head passed pnpm tc:cli; the coordinator will run the exact refreshed head through the serialized compiler lane. The earlier compiled CLI fixture demonstration passed and remains applicable to the unchanged feature. Native build and full repository CI are reported separately. Live Jira, Linux, Windows and a real SSH host were not exercised; Server and remote routing use fixtures.

Review

Reworks the linking behavior proposed in #11659 by Eugenio Valeiras (@EugeValeiras), at head cdb3a34a2a79644694ea83e4f159f7eea18a1c2c. The original author is credited in the commit trailer. The source PR remains open and unchanged.

Agent skill upstream boundary

  • Not applicable, or this change copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.

Notes

Merge risk: Low, pending the exact-head CLI compiler check. This is additive CLI input handling, with an optional flag-name parameter on the existing resolver; normal orca jira --site behavior is unchanged. Existing host RPCs and attachment fields are reused, and capability checks refuse unsupported hosts before key resolution or writes. No wire fields or stream opcodes change.

Jira credentials and lookup stay on the selected execution host. Worktree and folder mutations retain their existing merge policy. There are no new shell commands, platform paths, git assumptions, mobile APIs or provider-specific review changes. Full Jira URLs continue to work without a saved connection, and other providers retain full-URL linking.

Checklist

  • This PR is small and focused
  • I explained what changed and why (ELI5, the user-facing before/after, the mechanism, and why over the alternatives)
  • Before/after screenshots or videos attached for UI changes, or N/A with reason
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, and path/shortcut impact considered (or N/A)
  • pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass (or CI will cover; local preferred) — focused tests and quality checks passed on the refreshed head; the exact-head compiler and full/native CI are reported separately.

@nwparker
nwparker force-pushed the nwparker/jira-reference-keys branch from e23b741 to 71bafb4 Compare October 14, 2026 10:01
Adapted-code-from: #11659 at cdb3a34
Co-authored-by: Eugenio Valeiras <[email protected]>
@nwparker
nwparker force-pushed the nwparker/jira-reference-keys branch from 71bafb4 to 881dc4c Compare October 14, 2026 10:17
@nwparker
nwparker changed the base branch from nwparker/jira-cli-surface to main October 14, 2026 10:17
@coderabbitai

coderabbitai Bot commented Oct 14, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 14 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 10 included reviews currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 6e86af4c-d669-4cd8-887a-514f986a5c6b
📥 Commits

Reviewing files that changed from the base of the PR and between 51173e4 and 881dc4c.

📒 Files selected for processing: 11
  • skill-guides/orca-cli.md
  • src/cli/bundled-skill-guides.ts
  • src/cli/command-scoped-flag-help.ts
  • src/cli/handlers/reference.ts
  • src/cli/handlers/worktree.ts
  • src/cli/index-reference-jira.test.ts
  • src/cli/jira-target.ts
  • src/cli/reference-input.ts
  • src/cli/specs/core.ts
  • src/cli/specs/reference.ts
  • src/cli/worktree-project-target.ts
  • Autofix · 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.

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