Skip to content

feat(service): Create Linear issues from findings - #548

Open
gricha wants to merge 4 commits into
mainfrom
codex/linear-finding-drafts
Open

gricha wants to merge 4 commits into
mainfrom
codex/linear-finding-drafts

Conversation

@gricha

@gricha gricha commented Oct 10, 2026 •

Copy link
Copy Markdown
Member

Create Linear issues from the finding inspector and full page, with the description, evidence, and source links. The button then links to the issue. Using the finding UUID as the Linear issue ID makes repeated clicks, retries, and lost responses reuse the same ticket.

Set LINEAR_API_KEY and LINEAR_TEAM_ID in Vercel and redeploy. Leave both unset to keep the action hidden. The key stays on the server. Browser users in the configured tenant can create tickets for findings they can read; bearer tokens cannot use the action.

Depends on #549. Ticket descriptions use the finding's permanent short URL.

Lint, strict typechecking, build, and tests pass. Integration tests mock Linear.

@vercel

vercel Bot commented Oct 10, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
warden-prod Ready Ready Preview Oct 10, 2026 8:31pm UTC

Request Review

@sentry-junior sentry-junior Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. linear.app/new with title/description matches Linear's documented prefill URL, and building the backlink from the finding UUID (without the dashboard's search params) gives the ticket a stable reference even when short IDs repeat. Since FindingArticle is shared, the inspector and the full page get the same draft, and the optional evidence, location, source, and commit lines drop out cleanly for older findings. The new app tests pass for me locally on this branch.

@sentry-junior sentry-junior Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, small addition. Linking the draft to the UUID page and leaving range out of it both look right, and the old-finding test covers the optional fields well. Two things to look at:

  • In linear-issue.tsx, - Source: uses detail.sourceUrl directly. FindingArticle only renders it when it matches ^https?://, and the schema's z.url() doesn't enforce that. Pull that check into a small shared helper, like safeSourceUrl(detail), and use it in both places. That way the ticket can't carry a link the dashboard itself refuses to render.
  • Worst case, the draft URL gets big. The description can be up to 8k chars and verification up to 4k, and URL-encoding inflates both, so a long finding can push linear.app/new?... into the range where proxies start returning 414s. Consider capping the description/evidence in the draft (truncate with a "see Warden for full details" pointer, since the finding link is already there). If you do, add one test with a max-length finding.

@gricha
gricha force-pushed the codex/linear-finding-drafts branch from fbd5efe to d2529c3 Compare October 10, 2026 06:03
@gricha
gricha force-pushed the codex/linear-finding-drafts branch from d2529c3 to 620dd5e Compare October 10, 2026 06:34
gricha added a commit that referenced this pull request Oct 10, 2026
Replace dashboard DOM construction with strict TypeScript, React, and
Effect. Keep the existing usage and finding views, filters, themes, and
token controls. Effect validates service responses, handles failures,
and cancels obsolete requests.

Search typing survives delayed URL updates and still follows filter
resets and browser history. Newly created token secrets stay visible
during a failed list refresh, and account controls offer a retry after a
request failure. React and React DOM are pinned together.

Vite builds assets for the existing authenticated service routes. CI
checks both TypeScript configurations and Oxlint, including hooks,
accessibility, and unsafe values. Frontend requirements live in
`policies/warden-service-frontend.md`, linked from the app and service
`AGENTS.md` files.

App and service integration tests cover navigation, stale responses,
token creation, account recovery, and asset authentication. Lint,
typecheck, build, and repository tests pass.

Evidence (#545), short finding URLs (#546), and Linear drafts (#548) are
separate follow-up PRs.

---------

Co-authored-by: GPT-6 <noreply@anthropic.com>
Base automatically changed from codex/react-effect-dashboard to main October 10, 2026 06:44
@gricha
gricha force-pushed the codex/linear-finding-drafts branch from 620dd5e to bbfd720 Compare October 10, 2026 06:45
@gricha
gricha force-pushed the codex/linear-finding-drafts branch from bbfd720 to a4ee9a1 Compare October 10, 2026 16:09
@gricha
gricha force-pushed the codex/linear-finding-drafts branch from a4ee9a1 to 5e6b045 Compare October 10, 2026 16:19
@gricha gricha changed the title feat(dashboard): Open a prefilled Linear issue from findings feat(service): Create Linear issues from findings Oct 10, 2026
@gricha
gricha force-pushed the codex/linear-finding-drafts branch from 5e6b045 to 8dc675f Compare October 10, 2026 16:55
gricha and others added 3 commits October 10, 2026 13:29
Give each finding a permanent short URL and redirect existing UUID links.
Keep repeated findings distinct so opening a short URL preserves the
selected record, including after retention deletes older findings.

Backfill existing records during deployment and keep the migration
compatible with writes from the previous service version.

Refs GH-546
Co-Authored-By: GPT-6 <noreply@anthropic.com>
Create tickets through the service with a configured Linear API key and team.
Include retained evidence and source links, and show the ticket on later visits.
Use the finding UUID in Linear so repeated requests reuse the same issue.
Limit the action to browser users in the configured tenant with finding access.

Co-Authored-By: GPT-6 <noreply@anthropic.com>
Keep the finding action hidden until the service responds, so deployments
without Linear credentials do not briefly show a disabled button.

Co-Authored-By: GPT-6 <noreply@anthropic.com>
Link tickets to the finding's permanent short URL. Keep the finding UUID
as the Linear issue ID so retries still reuse the same ticket.

Co-Authored-By: GPT-6 <noreply@anthropic.com>
@gricha
gricha force-pushed the codex/linear-finding-drafts branch from 378032d to 675fe31 Compare October 10, 2026 20:30
@gricha
gricha changed the base branch from main to codex/canonical-finding-urls October 10, 2026 20:30
Base automatically changed from codex/canonical-finding-urls to main October 10, 2026 20:45

This branch was successfully deployed

2 active deployments
Preview – warden-prod — 675fe316 Deployed Oct 10, 2026 by vercel[bot]
Preview – warden — 675fe316 Deployed Oct 10, 2026 by vercel[bot]
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