Repository navigation
fix(jira): negotiate user-field support with remote hosts - #17532
Conversation
Greptile SummaryThe PR adds explicit capability negotiation for Jira user fields so newer clients remain compatible with older paired hosts.
Confidence Score: 5/5The 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.
|
| 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]
Reviews (1): Last reviewed commit: "fix(jira): negotiate user-field support ..." | Re-trigger Greptile
📝 WalkthroughWalkthroughThe change adds the Merge Risk: 🔵 Low · up to 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)
✅ Passed checks (3 passed)
Full details: Description checkExplanation 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
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
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. Comment |
There was a problem hiding this comment.
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
📒 Files selected for processing (4)
src/renderer/src/runtime/runtime-jira-client.test.tssrc/renderer/src/runtime/runtime-jira-client.tssrc/renderer/src/runtime/runtime-jira-user-fields-client.tssrc/shared/protocol-version.ts
Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.
| 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.' |
There was a problem hiding this comment.
🎯 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
There was a problem hiding this comment.
ℹ️ No critical issues — one UX rough edge worth a look, nothing blocking.
Reviewed changes
- Runtime capability — registers
jira.user-fields.v1inRUNTIME_CAPABILITIESso hosts advertise user-field support viagetStatus(). - Client module extraction — moves
jiraCreateIssue,jiraListAssignableUsers, andjiraSearchUsersintoruntime-jira-user-fields-client.ts, re-exported fromruntime-jira-client.tsto keep the file under the max-lines limit. - Remote negotiation —
jiraSearchUsersreturns[]when the host lacks the capability, andjiraCreateIssueasserts the capability before sendinguserFieldKeysto 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.
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
| 30_000 | ||
| )) | ||
| ) { | ||
| return [] |
There was a problem hiding this comment.
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.|
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. |

Follow-up to #17456 (merged as df48337).
The merged Jira user-field flow adds a new
jira.searchUsersRPC and sendsuserFieldKeysto 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:jira.user-fields.v1in runtime capabilities.jira.searchUserswhen the remote host does not advertise the capability; the picker degrades to no results.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.