Skip to content

feat: file captured errors as Linear issues (config-gated) - #3

Merged
asharahmed merged 1 commit into
mainfrom
feat/linear-delivery
Jun 29, 2026
Merged

feat: file captured errors as Linear issues (config-gated)#3
asharahmed merged 1 commit into
mainfrom
feat/linear-delivery

Conversation

@asharahmed

Copy link
Copy Markdown
Owner

Why

Completes capture → Linear: a newly-captured AppError becomes a tracked Linear issue automatically — the work item an engineer (and, next, an agent) acts on. Built on the capture pipeline from #2; the IIssueTracker seam introduced there means zero changes to the capture path to light this up.

What

  • LinearIssueTracker (IIssueTracker) — issueCreate GraphQL mutation; Linear personal API key sent raw in the Authorization header (not Bearer, per Linear's API). Title + a markdown description (exception, where, occurrences, fingerprint, stack excerpt — all already secret-scrubbed at capture). Best-effort: any failure returns null and the error stays recorded locally; capture never depends on Linear being reachable.
  • AddLinearIssueTracker — registers it (replacing NullIssueTracker) only when Linear:ApiKey + Linear:TeamId are set. Inert by default — same config-gated shape as the dogfood ingest key, so this lands with no secret of yours and you wire the token when ready.
  • GET /api/admin/errors (Admin) + AppErrorDto — view captured errors and their Linear link; optional ?status=Open|Resolved|Muted.

Verification

  • ✅ Full solution builds clean.
  • 4 LinearIssueTracker unit tests pass locally (stub HttpMessageHandler, no Docker): proves the request shape (raw-key auth, teamId forwarded), response parse (identifier/url), the not-configured short-circuit, and the HTTP-error / mutation-failure fallbacks.
  • ⏳ Capture integration test + the rest run in CI as before.

To activate (when you're ready)

Set Linear__ApiKey + Linear__TeamId (Container App secrets / Terraform). Until then it's a no-op and everything else works.

Next

The agent: a Linear issue (or label) kicks off an agent that tries to reproduce the error and, only if it can, opens a fix PR — gated on the integration + E2E tiers from #1.

Completes capture -> Linear: a newly-captured AppError is filed as a Linear
issue via the GraphQL API, and the returned identifier/url is stored back on
the error. The capture path is unchanged when Linear isn't configured.

- LinearIssueTracker (IIssueTracker): issueCreate mutation, raw API key in the
  Authorization header, scrubbed title/description; best-effort (returns null on
  any failure — capture never depends on Linear being reachable).
- AddLinearIssueTracker: registered (replacing NullIssueTracker) ONLY when
  Linear:ApiKey + Linear:TeamId are set — inert by default, same shape as the
  dogfood ingest key. Named "linear" HttpClient.
- GET /api/admin/errors (Admin) + AppErrorDto: view captured errors and their
  Linear link, optional ?status= filter.
- 4 unit tests (stub HttpMessageHandler, no Docker): request shape + raw-key
  auth + response parse + not-configured + http-error/failure fallbacks.
@asharahmed
asharahmed merged commit affb0cb into main Jun 29, 2026
8 of 10 checks passed
@asharahmed
asharahmed deleted the feat/linear-delivery branch June 29, 2026 01:26
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