Skip to content

feat(jira): migrate display path to REST — one auth, drop jira-cli shell-out (Slice 6)#80

Merged
f1uke merged 2 commits into
main-flukefrom
feature/jira-all-rest
Jul 12, 2026
Merged

feat(jira): migrate display path to REST — one auth, drop jira-cli shell-out (Slice 6)#80
f1uke merged 2 commits into
main-flukefrom
feature/jira-all-rest

Conversation

@f1uke

@f1uke f1uke commented Jul 11, 2026

Copy link
Copy Markdown
Owner

⚠️ Stacked on #79 — merge #79 (Browse Jira, Slice 5) FIRST

This branch is cut from feature/jira-browse, not main-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 to main-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 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).
  • Auth is now one credential path — the REST API token (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.)
  • Accepted trade-off (per approved design): viewing a linked issue now requires a token. A missing token degrades to an inline FetchError (Summary stays a 200), never a crash — identical to the other REST endpoints.

Tests

Migrated the adapter tests from a fixture Runner to httptest serving the same REST v3 testdata (the fixtures are already issue view --raw output = 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; still AO_JIRA_LIVE-gated).

Also swept stale jira-cli/display wording in service/jira, daemon, and dto comments + the user-facing FetchError strings (the auth message now points at the API token).

Verification

  • go build ./... OK; gofmt clean; golangci-lint v2.12.2 → 0 issues.
  • go test ./...: all Jira-touching packages green (adapters/jira, service/jira, httpd incl. the embedded-OpenAPI drift test, daemon). The only failing package is internal/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 on main-fluke).
  • No API-surface change (the dto.go edit is comment-only) → no OpenAPI/schema.ts drift. 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

Fluke Sattra and others added 2 commits July 12, 2026 01:09
…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>
@f1uke f1uke merged commit 0b23be0 into main-fluke Jul 12, 2026
10 checks passed
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