Skip to content

[DO NOT MERGE] feat(events): Convert saved event automation triggers in the heartbeat - #2447

Draft
sentry-junior[bot] wants to merge 1 commit into
feat/event-automation-filter-conversionfrom
feat/event-automation-trigger-backfill
Draft

sentry-junior[bot] wants to merge 1 commit into
feat/event-automation-filter-conversionfrom
feat/event-automation-trigger-backfill

Conversation

@sentry-junior

@sentry-junior sentry-junior Bot commented Oct 30, 2026

Copy link
Copy Markdown
Contributor

Do not merge until a release that contains #2407 and #2442 has run in production. Older releases (0.266.0 and before) require trigger.identifier and parse rows with rows.map. If this backfill runs and the app then rolls back to one of those releases, one converted row breaks automation listing for its whole team. There is no config switch.

This PR is stacked on #2442 and contains only the backfill. #2442 shipped the parts that this PR needs: create, update, and dashboard conversion, the plugin identifierMatch contract, and the reader for editedBy: "junior".

Refs #2362

What changes

  • Heartbeat backfill (event-automations/trigger-conversion.ts, agent-dispatch/heartbeat.ts). Each heartbeat checks at most 50 saved rows that have an identifier, no saved reason, and the same identifier in the row and in the trigger (listEventAutomationsToConvert). It saves each row with the revision that it read, under the row lock. A row that changed after the read is left for the next heartbeat.
    • A row that converts gets the filters from triggerWithoutIdentifier. It never gets broader.
    • A row that cannot convert keeps its identifier and stays active. It saves the reason, so later heartbeats skip it. A row whose saved filter never matches its identifier never ran, and it stays that way.
    • The heartbeat does not touch a row whose identifier column and trigger disagree. Ingest never runs such a row, and a save could make it broad.
  • Junior as the editor. Each conversion records a version with editedBy: "junior", so the version history shows "Junior", not "Editor unknown".
  • Dashboard conflict copy. A dashboard save can conflict because Junior made the only newer change. Then the edit API returns 409 with changedBy: "junior", and the editor says "Junior changed this trigger while you were editing." The API checks this as follows: it puts the trigger of the version before Junior's version on the saved row and compares that revision with the revision of the edit. Any other conflict keeps the generic copy.

Rollback

Checks (head 89783a006)

  • pnpm typecheck and pnpm lint: pass.
  • any-resource-event-automations covers the backfill through the real heartbeat:
    • a plain row converts and records a junior version,
    • a list filter narrows to the identifier's value,
    • a conflicting row keeps its identifier and its reason, stays active, and is not saved again,
    • a mismatched row is skipped,
    • a stale dashboard edit fails with changedBy: "junior",
    • dispatch stays scoped to the pull request.
  • API, agent-dispatch, Slack, and unit event suites: pass. One test fails in event-automations ("delivers the current automation card…"). It fails the same way on main locally.
  • Dashboard suite and dashboard e2e (60): pass.

via David Cramer.

--

View Session [Sentry]

Each heartbeat converts up to 50 saved triggers that still have an
identifier, under the row lock, and records a version that names Junior.
A row that cannot convert keeps its identifier and saves the reason. A
dashboard edit that read the row before the conversion fails as a
conflict that says Junior changed the trigger.

Merge only after a release with #2407 and #2442 has run in production,
because older releases cannot read rows with no identifier.

Refs #2362

Co-Authored-By: David Cramer <david@sentry.io>
@vercel

vercel Bot commented Oct 30, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated
junior-docs Ready Ready Preview Oct 30, 2026 5:34pm UTC

Request Review

This branch was successfully deployed

1 active deployment
Preview – junior-docs — 89783a00 Deployed Oct 30, 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.

0 participants