Skip to content

fix(jira): negotiate user-field support with remote hosts - #17532

Merged
OrcaWin merged 1 commit into
mainfrom
OrcaWin/jira-user-fields-remote-compat
Aug 31, 2026
Merged

OrcaWin merged 1 commit into
mainfrom
OrcaWin/jira-user-fields-remote-compat

Conversation

@OrcaWin

@OrcaWin OrcaWin commented Aug 31, 2026 •

Copy link
Copy Markdown
Collaborator
Files Added Deleted Net
Test 1 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​164 $\color{#cf222e}{\Huge{\mathbf{−}}}$​2 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​162
Prod 3 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​84 $\color{#cf222e}{\Huge{\mathbf{−}}}$​45 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​39

Follow-up to #17456 (merged as df48337).

The merged Jira user-field flow adds a new jira.searchUsers RPC and sends userFieldKeys to the host. Older paired Orca hosts do not expose that RPC or shape those fields, so this follow-up makes the mixed-version behavior explicit:

  • Advertise jira.user-fields.v1 in runtime capabilities.
  • Do not call jira.searchUsers when the remote host does not advertise the capability; the picker degrades to no results.
  • Refuse remote issue creation with user fields on an older host with a clear update-required message, while preserving ordinary issue creation compatibility.
  • Keep the runtime client under the repository max-lines limit by extracting user-field calls into a focused module.
  • Add local/remote capability routing and fallback tests.

Validation: full pnpm test (7,177 files passed, 66,924 tests passed), pnpm tc:web, pnpm tc:node, changed-code quality gate, and focused runtime tests all pass.

@greptile-apps

greptile-apps Bot commented Aug 31, 2026

Copy link
Copy Markdown

Greptile Summary

The PR adds explicit capability negotiation for Jira user fields so newer clients remain compatible with older paired hosts.

  • Advertises the jira.user-fields.v1 runtime capability.
  • Suppresses remote user search when the selected host lacks support.
  • Blocks user-field issue creation on unsupported hosts while preserving ordinary issue creation.
  • Extracts Jira user-field RPC routing into a focused client module and adds local, remote, supported, and fallback tests.

Confidence Score: 5/5

The PR appears safe to merge with no actionable correctness or security issues identified.

The capability is advertised by runtimes that register the corresponding Jira methods, remote operations use consistent environment identity, unsupported hosts fail closed, and ordinary issue creation remains available.

Important Files Changed

Filename Overview
src/renderer/src/runtime/runtime-jira-user-fields-client.ts Extracts user-related Jira routing and correctly gates remote search and user-field creation on the advertised host capability.
src/renderer/src/runtime/runtime-jira-client.ts Re-exports the extracted Jira user-field functions without changing the existing public import surface.
src/shared/protocol-version.ts Adds the Jira user-fields capability and update-required message to the shared runtime protocol contract.
src/renderer/src/runtime/runtime-jira-client.test.ts Covers local routing, supported remote routing, old-host degradation, blocked user-field creation, and ordinary creation compatibility.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[Jira renderer request] --> B{Local or remote target?}
  B -->|Local| C[Use preload Jira IPC]
  B -->|Remote| D{User-field operation?}
  D -->|No| E[Call remote Jira RPC]
  D -->|User search| F{Host advertises jira.user-fields.v1?}
  D -->|Create with userFieldKeys| G{Host advertises jira.user-fields.v1?}
  F -->|Yes| H[Call jira.searchUsers]
  F -->|No| I[Return no search results]
  G -->|Yes| J[Call jira.createIssue]
  G -->|No| K[Show update-required error]
Loading

Reviews (1): Last reviewed commit: "fix(jira): negotiate user-field support ..." | Re-trigger Greptile

@coderabbitai

coderabbitai Bot commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

The change adds the jira.user-fields.v1 runtime capability and its update-required message. Jira user search and issue creation now use a dedicated client module with runtime RPC and Electron IPC routing. Remote operations validate capability support, limit oversized searches, and reject user-field issue creation when unsupported. Tests cover local and remote routing, capability absence, and successful or rejected issue creation.

Merge Risk: 🔵 Low · up to 43015

The PR adds capability-gated Jira user-field behavior and a clear update-required error for unsupported hosts; it is otherwise mergeable with owner awareness of a minor follow-up to route that message through localization.

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description explains the problem, solution, compatibility behavior, scope, and validation results. It does not follow several required template items, including an explicit linked-issue entry, the… Update the description to include the required template sections. Add an explicit linked issue such as "Fixes #17456" or explain the relationship, state "N/A" with a reason for visual proof if no UI change exists, mark or explain the testin…
Docstring Coverage ⚠️ Warning Docstring coverage is 12.50% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 8 functions across 4 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the main change: Jira user-field capability negotiation with remote hosts.
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.
Full details: Description check

Explanation

The description explains the problem, solution, compatibility behavior, scope, and validation results. It does not follow several required template items, including an explicit linked-issue entry, the required visual-proof statement for a behavior change, testing checklist status, and the remaining checklist sections.

Resolution

Update the description to include the required template sections. Add an explicit linked issue such as "Fixes #17456" or explain the relationship, state "N/A" with a reason for visual proof if no UI change exists, mark or explain the testing checklist items, and complete the relevant AI Disclosure, Review, Agent skill upstream boundary, Notes, and Checklist sections.

  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch

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.

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 638c2a32-6268-4af3-8d53-509d44c52cc8

📥 Commits

Reviewing files that changed from the base of the PR and between df48337 and 4301566.

📒 Files selected for processing (4)
  • src/renderer/src/runtime/runtime-jira-client.test.ts
  • src/renderer/src/runtime/runtime-jira-client.ts
  • src/renderer/src/runtime/runtime-jira-user-fields-client.ts
  • src/shared/protocol-version.ts

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

Comment on lines +64 to +65
export const JIRA_USER_FIELDS_UPDATE_REQUIRED_MESSAGE =
'Creating Jira issues with user fields requires a newer Orca server. Update the server and try again.'

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.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Localize the update-required message.

JIRA_USER_FIELDS_UPDATE_REQUIRED_MESSAGE is user-facing but hard-codes English. Replace it with an intent-named localization ID and resolve it where the error is shown.

Based on learnings: newly added user-facing strings in TypeScript and TSX files must use intent-named localization IDs with named interpolation placeholders.

Source: Learnings

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

ℹ️ No critical issues — one UX rough edge worth a look, nothing blocking.

Reviewed changes

  • Runtime capability — registers jira.user-fields.v1 in RUNTIME_CAPABILITIES so hosts advertise user-field support via getStatus().
  • Client module extraction — moves jiraCreateIssue, jiraListAssignableUsers, and jiraSearchUsers into runtime-jira-user-fields-client.ts, re-exported from runtime-jira-client.ts to keep the file under the max-lines limit.
  • Remote negotiation — jiraSearchUsers returns [] when the host lacks the capability, and jiraCreateIssue asserts the capability before sending userFieldKeys to a remote host while leaving ordinary creation untouched.
  • Tests — adds local/remote routing, capability-degradation, and fallback coverage with exact RPC-param assertions.

The gating scope is correct: only the surface introduced in #17456 (jira.searchUsers and userFieldKeys) is fenced, while the pre-existing jira.listAssignableUsers path stays ungated.

Pullfrog  | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using DeepSeek Pro (free via Pullfrog for OSS) | 𝕏

30_000
))
) {
return []

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.

On an older host this silently returns [], which JiraUserPicker renders as "No users found" — the user gets no signal that the server needs updating, unlike the create path's explicit update-required message. Consider distinguishing "host lacks the capability" from "no results" so the picker can surface the same hint instead of a misleading empty state.

Technical details
# Surface the update-required hint on the search path

## Affected sites
- src/renderer/src/runtime/runtime-jira-user-fields-client.ts:69 — returns `[]` when the host lacks `jira.user-fields.v1`
- src/renderer/src/components/jira-user-picker.tsx:75 — renders any empty result as "No users found"

## Required outcome
- A user searching users against an outdated host sees an update-required message rather than a bare empty state, without changing the create-path behavior already in place.

## Suggested approach (optional)
- Have `jiraSearchUsers` return a discriminated result (e.g. `{ ok: false; reason: 'unsupported' }` vs a plain `JiraUser[]`) or expose the capability verdict, then have `JiraUserPicker` show `JIRA_USER_FIELDS_UPDATE_REQUIRED_MESSAGE` (or an i18n equivalent) when unsupported.

@OrcaWin

OrcaWin commented Aug 31, 2026

Copy link
Copy Markdown
Collaborator Author

Reviewed end to end. The capability negotiation is scoped to the new Jira user-field RPC/payload, preserves ordinary issue creation on older hosts, and is covered by local/remote routing and fallback tests. The only failing check is the repository-wide static-analysis max-lines error in untouched src/main/runtime/rpc/dispatcher.ts (302 lines); this PR does not introduce or modify that violation. Merging the focused compatibility follow-up.

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