feat: file captured errors as Linear issues (config-gated) - #3
Merged
Conversation
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.
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.
Why
Completes capture → Linear: a newly-captured
AppErrorbecomes a tracked Linear issue automatically — the work item an engineer (and, next, an agent) acts on. Built on the capture pipeline from #2; theIIssueTrackerseam introduced there means zero changes to the capture path to light this up.What
LinearIssueTracker(IIssueTracker) —issueCreateGraphQL mutation; Linear personal API key sent raw in theAuthorizationheader (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 (replacingNullIssueTracker) only whenLinear:ApiKey+Linear:TeamIdare 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
LinearIssueTrackerunit tests pass locally (stubHttpMessageHandler, no Docker): proves the request shape (raw-key auth,teamIdforwarded), response parse (identifier/url), the not-configured short-circuit, and the HTTP-error / mutation-failure fallbacks.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.