feat(jira): migrate display path to REST — one auth, drop jira-cli shell-out (Slice 6)#80
Merged
Merged
Conversation
…ce 5) The last slice of the Jira build: a "Browse Jira" entry point next to "+ New task" opens a full-page surface where you pick a Jira project first (searchable dropdown of the real project list, remembers your last pick), search/pick a Story within it, and "Create session" hands off to the New-task modal pre-filled with the issue — creating a worker bound to its key. Manual + read-only by design; nothing auto-imports onto the board. Reuses the Slice-4 REST endpoints (GET /jira/search, GET /jira/projects) — no new backend. Frontend only. - useJiraProjects hook + mockJiraProjects; generalize useJiraSearch to fire when a project is scoped (lists a project's issues with no text typed), leaving the New-task/link pickers (project="") on the 2-char gate. - JiraProjectPicker: searchable dropdown, "Last used" chip, remembers the pick via localStorage (ao.jira.lastProject). - BrowseJiraPage + un-nested route _shell.projects.$projectId_/jira; client-side type filter chips; issue rows with Create session. - NewTaskDialog gains an optional initialIssue (Browse handoff, mockup 03). - ShellTopbar "Browse Jira" button (active on the surface). Fixtures fully synthetic (DEMO-/ACME-, example.atlassian.net). Match mockup 02. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…i shell-out (Slice 6)
The Summary-tab Jira context + board badge (per-key issue read) was the last
path still shelling out to jira-cli (`jira issue view --raw`) with keychain
auth from Slice 1. Move it onto the SAME Jira Cloud REST v3 client that search
(Slice 4) and status transitions (Slice 3) already use.
- adapters/jira/client.go: Get() now fetches GET /rest/api/3/issue/{key}?fields=*all
via the shared newJiraRequest auth seam, reusing all the existing REST v3 → Issue
mapping (mapIssue/decoders/detectSprint/browseURL) and the ADF parser unchanged.
Deleted the Runner seam, cliRunner, WithRunner, AO_JIRA_BIN, and the CLI-stderr
classifier; added issueStatusError (404→NotFound, 401/403→AuthFailed, else
Unavailable). NewClient no longer wires a runner.
- Result: one credential path — the REST API token (JIRA_API_TOKEN/AO_JIRA_TOKEN).
No jira-cli binary and no macOS-keychain read for display. A missing token
degrades to an inline FetchError (Summary stays a 200), never a crash — same as
the other REST endpoints.
- Tests migrated from a fixture Runner to httptest serving the same REST v3
testdata (fixtures are already `issue view --raw` = REST JSON): mapping, request
shape + basic-auth, invalid-key-before-request, HTTP status classification,
config-error, transport-error, malformed-body. live_test → REST (needs a token).
- Swept stale jira-cli/display wording in service/jira, daemon, dto comments +
user-facing FetchError strings (auth message now points at the API token).
No API-surface change (dto edit is comment-only) → no OpenAPI/schema drift.
Frontend untouched.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This branch is cut from
feature/jira-browse, notmain-fluke, because we're building the night run without waiting for merges. Until #79 lands, the diff below also includes Slice 5's commit. After #79 merges tomain-fluke, this PR reduces to just the Slice-6 commit (dd3c339a). Review/merge order: #79 → this.Slice 6 — All-REST migration (the final slice of the approved Jira build)
The Summary-tab Jira context + board badge (the per-key issue read) was the last path still shelling out to jira-cli (
jira issue view --raw) with macOS-keychain auth from Slice 1. This moves it onto the same Jira Cloud REST v3 client that search (Slice 4) and status transitions (Slice 3) already use.Result: one auth path
IssueReader.Get()now fetchesGET /rest/api/3/issue/{key}?fields=*allvia the sharednewJiraRequestauth seam — reusing all the existing REST v3 →Issuemapping (mapIssue/decoders/detectSprint/browseURL) and the ADF parser unchanged.Runnerseam,cliRunner,WithRunner,AO_JIRA_BIN, and the CLI-stderr classifier. AddedissueStatusError(404→NotFound, 401/403→AuthFailed, else Unavailable).JIRA_API_TOKEN/AO_JIRA_TOKEN). No jira-cli binary and no keychain read for display. (jira-cli's config file is still read only for the non-secret base URL + login, same as search/transitions.)FetchError(Summary stays a 200), never a crash — identical to the other REST endpoints.Tests
Migrated the adapter tests from a fixture
Runnerto httptest serving the same REST v3testdata(the fixtures are alreadyissue view --rawoutput = REST JSON): field mapping, request shape + basic-auth header, invalid-key-rejected-before-request, HTTP status classification (404/401/403/500), config-error, transport-error, malformed-body.live_test→ REST (TestLive_RealREST, needs a token; stillAO_JIRA_LIVE-gated).Also swept stale jira-cli/display wording in
service/jira,daemon, anddtocomments + the user-facingFetchErrorstrings (the auth message now points at the API token).Verification
go build ./...OK;gofmtclean; golangci-lint v2.12.2 → 0 issues.go test ./...: all Jira-touching packages green (adapters/jira,service/jira,httpdincl. the embedded-OpenAPI drift test,daemon). The only failing package isinternal/cli(4 spawn tests) — pre-existing on the branch point, unrelated to this change (verified identical failure with the diff stashed; env-specific to the local sandbox, green in CI onmain-fluke).dto.goedit is comment-only) → no OpenAPI/schema.tsdrift. Frontend untouched.This completes the approved Jira build (Slices 1–6): display, move-status, search, link, browse — all on one REST client, one token.
🤖 Generated with Claude Code