Repository navigation
feat(jira): remember repository project defaults - #28622
Conversation
39669fc to
883d0ff
Compare
a294bdc to
40aa8b6
Compare
44face1 to
ab347f9
Compare
48bf596 to
1035b76
Compare
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Priority: ➖ Normal Merge Risk: ⚪ Minimal · up to
|
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
- Configuration used: Repository UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
43094905-bc91-47b5-b044-6e408197825d
📥 Commits
Reviewing files that changed from the base of the PR and between eb1ee8f and 1035b76590b4710cec685ee76bbca3a33943ace2.
📒 Files selected for processing: 85
src/main/persistence-jira-project.test.tssrc/main/persistence/loading-store/repo-lifecycle-operations.tssrc/main/persistence/tracking-repos/repo-hydration.tssrc/main/persistence/tracking-repos/repo-sanitization.tssrc/main/persistence/tracking-repos/repo-update-operations.tssrc/main/runtime/runtime-repository-settings-controller.tssrc/renderer/src/components/NewWorkspaceComposerModal.tsxsrc/renderer/src/components/TaskPageJiraStatusFilters.test.tsxsrc/renderer/src/components/TaskPageJiraStatusFilters.tsxsrc/renderer/src/components/jira-project-picker.test.tsxsrc/renderer/src/components/jira-project-picker.tsxsrc/renderer/src/components/new-workspace/NewWorkspaceComposerNameSection.tsxsrc/renderer/src/components/new-workspace/NewWorkspaceComposerProjectSection.tsxsrc/renderer/src/components/new-workspace/RunTargetCombobox.host-identity.test.tsxsrc/renderer/src/components/new-workspace/RunTargetCombobox.tsxsrc/renderer/src/components/new-workspace/SetProjectLocationDialog.host-identity.test.tsxsrc/renderer/src/components/new-workspace/SetProjectLocationDialog.test.tsxsrc/renderer/src/components/new-workspace/SetProjectLocationDialog.tsxsrc/renderer/src/components/new-workspace/SmartWorkspaceNameField.jira-accessibility.test.tsxsrc/renderer/src/components/new-workspace/new-workspace-composer-card-props.tssrc/renderer/src/components/new-workspace/run-target-options.tssrc/renderer/src/components/new-workspace/smart-workspace-name-field-model.tssrc/renderer/src/components/new-workspace/smart-workspace-name-field-surface.tsxsrc/renderer/src/components/new-workspace/use-jira-composer-project.test.tsxsrc/renderer/src/components/new-workspace/use-jira-composer-project.tssrc/renderer/src/components/new-workspace/use-smart-workspace-name-field-foundation.source.test.tsxsrc/renderer/src/components/new-workspace/use-smart-workspace-secondary-searches.tssrc/renderer/src/components/new-workspace/use-work-item-source-foundation.tssrc/renderer/src/components/settings/RepositoryJiraProjectSection.test.tsxsrc/renderer/src/components/settings/RepositoryJiraProjectSection.tsxsrc/renderer/src/components/settings/RepositoryPane.tsxsrc/renderer/src/components/settings/repository-search.tssrc/renderer/src/components/task-page-jira-status-catalog.tssrc/renderer/src/components/task-page/jira/Filters.linked-mode.test.tsxsrc/renderer/src/components/task-page/jira/Filters.tsxsrc/renderer/src/components/use-jira-project-inventory.test.tsxsrc/renderer/src/components/use-jira-project-inventory.tssrc/renderer/src/components/use-task-page-composer-actions.tssrc/renderer/src/components/use-task-page-jira-list-effects.test.tssrc/renderer/src/components/use-task-page-jira-list-effects.tssrc/renderer/src/components/use-task-page-jira-list-state.owner.test.tsxsrc/renderer/src/components/use-task-page-jira-list-state.tssrc/renderer/src/components/use-task-page-jira-project-scope.test.tsxsrc/renderer/src/components/use-task-page-jira-project-scope.tssrc/renderer/src/hooks/composer-state/composer-card-contract.tssrc/renderer/src/hooks/composer-state/composer-card-props.tssrc/renderer/src/hooks/composer-state/composer-decisions.tssrc/renderer/src/hooks/composer-state/composer-external-sync.tssrc/renderer/src/hooks/composer-state/composer-review-base-test-fixture.tssrc/renderer/src/hooks/composer-state/composer-source-state.tssrc/renderer/src/hooks/composer-state/composer-target-input-contracts.tssrc/renderer/src/hooks/composer-state/composer-target-state.jira-mapping.test.tsxsrc/renderer/src/hooks/composer-state/composer-target-state.tssrc/renderer/src/hooks/composer-state/composer-target-store.tssrc/renderer/src/hooks/composer-state/draft-target-sync.test.tssrc/renderer/src/hooks/composer-state/draft-target-sync.tssrc/renderer/src/hooks/composer-state/host-runtime-effects.tssrc/renderer/src/hooks/composer-state/initial-target-model.tssrc/renderer/src/hooks/composer-state/initial-target-state.jira-mapping.test.tsxsrc/renderer/src/hooks/composer-state/initial-target-state.tssrc/renderer/src/hooks/composer-state/jira-mapped-owner-flow.integration.test.tsxsrc/renderer/src/hooks/composer-state/runtime-target-model.tssrc/renderer/src/hooks/composer-state/runtime-target-selection.tssrc/renderer/src/hooks/composer-state/server-ssh-repo-connect.test.tssrc/renderer/src/hooks/composer-state/source-context-state.tssrc/renderer/src/hooks/composer-state/target-change-actions.tssrc/renderer/src/hooks/composer-state/target-store-model.tssrc/renderer/src/hooks/useComposerState-host-context-boundaries.test.tssrc/renderer/src/hooks/useComposerState.integration.test.tssrc/renderer/src/hooks/useComposerState.tssrc/renderer/src/i18n/locales/en.jsonsrc/renderer/src/lib/jira-source-host.tssrc/renderer/src/lib/project-host-setup-options.tssrc/renderer/src/lib/project-host-workspace-target.jira-mapping.test.tssrc/renderer/src/lib/project-host-workspace-target.tssrc/renderer/src/runtime/runtime-jira-client.tssrc/renderer/src/runtime/runtime-jira-project-client.test.tssrc/renderer/src/runtime/runtime-jira-project-client.tssrc/renderer/src/store/repos/repo-state.tssrc/renderer/src/store/repos/repo-update.tssrc/shared/jira-project-reference.test.tssrc/shared/jira-project-reference.tssrc/shared/jira-source-host.tssrc/shared/repo-types.tssrc/shared/rpc-contract/repo-update-params.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 4 remain after this review.
a5f4ed4 to
b313a1d
Compare
Preserve Jira source ownership while selecting mapped execution targets, keep repository defaults and overrides scoped to resolved host copies, and prevent stale or duplicate setup identities from switching hosts.
b313a1d to
ba22a2b
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
- Configuration used: Repository UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
f3809656-6c35-4e19-9ea9-879e4858dd11
📥 Commits
Reviewing files that changed from the base of the PR and between a5f4ed4 and ba22a2bbabaaf09bd8408289b4922d86a4e7e952.
📒 Files selected for processing: 9
src/renderer/src/components/TaskPageJiraStatusFilters.test.tsxsrc/renderer/src/components/TaskPageJiraStatusFilters.tsxsrc/renderer/src/components/use-task-page-jira-list-effects.test.tssrc/renderer/src/components/use-task-page-jira-list-effects.tssrc/renderer/src/components/use-task-page-jira-list-state.tssrc/renderer/src/components/use-task-page-jira-project-scope.test.tsxsrc/renderer/src/components/use-task-page-jira-project-scope.tssrc/renderer/src/i18n/locales/en.jsonsrc/renderer/src/runtime/runtime-jira-client.ts
🚧 Files skipped from review as they are similar to previous changes: 1
- src/renderer/src/i18n/locales/en.json
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 5 remain after this review.
ba22a2b to
9b174ae
Compare
## ELI5 Keep the test suite working with the Jira features that have just landed. There is no visible app change. ## What Changed The host-picker test now expects the host-qualified selection the parent already accepts. The startup fixture provides Electron's protocol handler and verifies that ready installs the Jira image scheme. Jira edit tests use exported wrappers with module-local setters that are cleared on unmount, preserving the issue/source switch tests without the banned mutable function export. The WSL storage inventory classifies Jira list columns, linked-view choice and prompt templates as device preferences, matching their keys and the existing Linear policy. Skill-guide tests check the actual generated discovery projection rather than assuming it is shorter than every full guide or uses one fixed phrase. The cache test follows the headless workflow's deliberate removal of its push trigger; cache-warmer checks remain intact. ## Why Final CI found six stale integration assumptions after the Jira batch. Updating the fixtures and inventory preserves the landed behavior and the underlying checks. Changing production code, padding the Jira guide, or restoring an intentionally removed workflow trigger would change the product to satisfy incorrect test assumptions. ## Linked Issue Follow-up to #28622, #28631 and #28592. The existing headless trigger policy was introduced in #28664. ## Visual Proof N/A — tests, test fixtures and storage inventory declarations only; no visual or interaction change. ## Testing - [x] Automated tests updated. - [x] 196 focused tests across nine files pass on macOS, covering every failed shard assertion, fixture consumers and the headless workflow policy. - [x] Node and web typechecks pass; all seven changed-code quality stages, formatting and diff checks pass. - Reproduced five failing assertions in startup/export/storage tests and the skill projection failure before the repairs. The host-picker owner also reproduced the stale selection failure before correcting it. - Final full CI will run on this PR. The prior Ubuntu 22.04 persistence job crashed in the native watcher build before persistence tests ran; this change does not claim a Linux release, live Jira or real SSH pass. ## Review Independent source review found no issues; all six reviewed file hashes and the complete diff match committed head `aa703eb50147ba95646cb82f10b6d86b4f890fc4`. Risk: low. No authentication, network, protocol implementation, workflow, renderer behavior, remote messages or migration rewrite logic changes. ## Agent skill upstream boundary - [x] Not applicable; no upstream skill-installer source or artifacts copied. ## Notes The three storage keys contain device-level preferences, without workspace paths or identifiers. Tests preserve host disambiguation and issue/source switching. Platform, SSH and provider behavior remains in the existing implementations. ## Checklist - [x] Small and focused. - [x] Explained the before/after, mechanism and choice of approach. - [x] Visual proof marked N/A with a reason. - [x] Self-reviewed for correctness and cleanup. - [x] Cross-platform and SSH impact considered. - [x] Focused tests, types, formatting and quality checks pass; full CI covers the broader build.
ELI5
Choose a Jira project once in repository settings. The new-worktree issue picker and repository-scoped Tasks list start with that project, and each composer can still choose another project or All.
What Changed
Previously Orca could not remember which Jira project belonged to a repository. Adds an optional Default Jira project picker, populated from the repository host’s connected Jira account, and stores only project identity and display information through the existing repository update and persistence paths.
The composer defaults to this project and limits its issue search to that project and site. Tasks uses the explicit repository or single selected repository’s default, supports an All-project override, scopes presets and typed searches without changing their ordering, and prefers the selected project when creating a Jira issue. A shared final-query check now catches project, sprint, text-conversion and escaped status queries that exceed the request limit, with a clear error and a way to recover. Starting from a Jira issue preselects its uniquely mapped repository and execution host while retaining the Jira account that supplied the issue; ambiguous mappings leave the existing choice unchanged. Host selection, reconnects, and newly configured project locations also distinguish repositories and setups with the same ID on different hosts. If an explicitly mapped destination is unavailable, creation waits for that destination or a new user selection instead of choosing another repository. Composer overrides are scoped to repository host and location, so an All-project override does not replace another copy’s default.
Why
A project reference is enough to avoid the repeated project choice without introducing another account store, transport method, or mandatory restriction. An optional default preserves existing searches for repositories with no mapping. Project and site identities keep projects with the same ID on different Jira sites separate. A separate creation-target hint keeps workspace destination independent from Jira account ownership; passing the already resolved repository avoids a second ID-only lookup that could select the wrong host.
Linked Issue
Fixes #12753. References #23617 for its repository-project mapping portion; issue-key naming is handled separately.
Cloud prerequisite #28579, saved queries #28600, and workflow filters #28623 have merged. This PR targets main with only three mapping feature/correction commits. This implementation is new; the Cloud-query contribution and its original author are credited in #28579.
Visual Proof
The settings comparison renders the original HEAD and current repository pane with the real store. Composer and Tasks screenshots use the actual app surfaces. Jira responses are synthetic fixtures; repository saves use real IPC in an isolated profile.
Before (no repository Jira-project setting):

After (saved Alpha default):

Composer defaults to Alpha, then overrides to Bravo without changing the saved repository default:


Repository-scoped Tasks displays only Alpha’s issue:

Correction proof uses synthetic Jira and repository fixtures in the same hidden app. Starting from Bravo in an unrelated repository’s Tasks list chooses the mapped Bravo repository, including its SSH Builder destination, while keeping Jira ownership local:


Two copies with the same repository/setup ID keep their own default. An All-project override on Local Mac resets to the saved Bravo default when the actual Run on picker selects Builder:


Fresh final-head captures below use the actual repository-scope/list/filter hooks with controlled repositories and Jira/preferences transports. The fixture shell labels its synthetic boundaries.
The SSH copy restores its saved Bravo project while Jira ownership remains local:

Project, selected status and Current sprint compose one ordered preview:

A project-only query that exceeds the UTF-8 request limit shows the production error banner with Current sprint off:

Testing
Final source
9b174ae4aadf25c607f87319c85ba11423d5a312is based on landed image/board maina0c46b405ff33aa950e26d5e4c67f373932c3a2f. The final query-limit correction passed 205 focused tests across 10 files. Six new tests first failed against the prior source: project-only saved JQL, manual JQL, plain text and UTF-8 queries, plus mapped presets with escaped or UTF-8 status names. Raw search inputs remain below 8192 bytes while their composed queries exceed it. Exact 8192-byte neighbors succeed, clearing the error; cancelled failures and unfiltered oversized input are covered. The bound error reaches the existing load-error path, clears loading and never falls back to text or sends an oversized provider request.The broader mapping source previously passed 579 tests across 62 files at
ba22a2bbabaaf09bd8408289b4922d86a4e7e952; that run is historical. The final correction changes only the list-effect guard, its tests and the English error message, with all other tracked paths unchanged. The final changed-code quality gate passed for 85 files across all seven stages; own-file formatting, lint, anti-slop, focus, RPC and localization checks passed. Root's exact final node and web typechecks passed, with all 86 recorded source hashes stable. No thresholds were loosened.The controlled creation tests connect actual settings/inventory, saved repository echo, composer-derived Jira source, mapped query, source binding, quick-submit/background request and execution-host adoption. They cover ignored echoes, unavailable owners, same-ID mapping collisions and late inventory after switching accounts twice. API responses and unrelated preflight/agent detection are synthetic.
Hidden macOS Electron CDP proof at the prior
ba22source passed 157 assertions with 34 inspected captures and stable hashes across 1412 source files. That is historical evidence for the broader feature; the final list-effect guard is the sole changed file in that recorded source graph. Fresh hidden Electron CDP validation on the exact final source reran all 157 existing assertions plus 32 query-length/error/recovery assertions: 189 assertion invocations passed (185 distinct assertion names across drivers). All 39 screenshots were visually inspected; all 1413 recorded source hashes stayed unchanged, with no renderer page/console errors. The fresh profile stayed hidden and unfocused; owned processes were stopped, ports cleared, and the fixture archived and removed. Renderer/GPU/network termination events occurred during that owned cleanup after the drivers and are retained in the logs. Original nine screenshots are preserved. These checks use actual renderer hooks and surfaces with seeded stores and controlled Jira/preferences transports. No live Jira, physical SSH/credential roundtrip, full-app startup, actual filesystem creation, terminal activation, other-platform runtime or release build is claimed. CI on the reviewed9b174ae4aadf25c607f87319c85ba11423d5a312source passed static analysis/typecheck, repository guards, mobile verify, relay integration, package jobs and five persistence platforms. Ubuntu 22.04 persistence failed before tests when the bundled-runtime watcher child crashed with SIGSEGV during build:orcad; its build-script/runtime/artifact sources are unchanged by this PR. Unit shard 4 reported five failures: four inherited repository checks (headless workflow trigger, discovery-guide assumptions, exported fixture functions and WSL localStorage catalog) and one stale composer callback expectation caused by this PR's host-qualified setup key. The callback consumer accepts that key, and the one-line expectation correction passes 39 affected tests across four files. The separate six-file integration-CI repair merged as #28743 atdd4d0fa51f03ec0e60f68358d048e37cfe5705db. It corrects these shard-4 assumptions plus the missing Electron protocol mock in shard 5. All 196 focused tests across nine files, node/web typechecks, formatting and seven changed-code quality stages passed; independent source review found no issues. Full CI for that follow-up is still running. No global green-CI result is claimed.Review
Project choices read only their explicit Jira account owner. Target-only APIs share the existing status/project transports, and the inventory hook cannot accept a default-scope source.
The repository persistence façade and preload update types include the optional Jira project field. Settings verifies the host’s echoed stored value before reporting a successful save, so an older paired server that discards the optional field shows an actionable update message. New fields are optional; existing repository update routes remain wire-compatible. No credentials are persisted in the project reference.
Agent skill upstream boundary
Notes
macOS rendered proof uses a hidden Electron window. The implementation uses existing host routing, including direct SSH’s local Jira-account policy, and supports folder repositories without Git. New creation hints, retained unavailable-target state, and host-qualified picker keys are internal renderer state; this correction adds no wire or persistence fields. No path or shortcut changes. Mobile can ignore the optional repository field and retains existing behavior.
Merge risk: Low for the scoped source. Independent source, runtime and identity reviews, including the exact final query-limit delta, found no remaining source blocker. Optional defaults use existing transports and older hosts that ignore a save return actionable feedback. Jira account ownership and repository execution identity remain separate. The limits above and final CI status remain explicit.
Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)