Skip to content

feat(automations): Show event triggers in the same words everywhere - #2385

Merged
dcramer merged 1 commit into
mainfrom
feat/trigger-presentation
Oct 29, 2026
Merged

dcramer merged 1 commit into
mainfrom
feat/trigger-presentation

Conversation

@sentry-junior

@sentry-junior sentry-junior Bot commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

Stacked on #2381. Item 4 of #2362: how event triggers show in the dashboard and Slack.

What changed

There is now one shared trigger description in packages/junior-plugin-api/src/event-triggers.ts:

interface EventTriggerDescription {
  events: string[];   // "pull request opened"
  filters: string[];  // "authors includes alice", "base is main or release"
  problems: string[]; // why the saved trigger cannot work
}
  • describeEventTrigger(resourceTypes, selection) builds it. It takes the resource types of the source, like eventTriggerProblems.
  • problems are the messages of feat(events): Reject event filters that cannot match #2381's eventTriggerProblems. So every surface shows the same words as the save check. This includes the unknown resource type and "The plugin for this source is not enabled."
  • A list: true field reads "includes X". List values on a normal field read "is X or Y".
  • eventTriggerText(resource, description) writes one line for cards and lists: Pull request · pull request opened · filters: isDraft is false.
  • Core wraps this as describeRegisteredEventTrigger(catalog, selection) in chat/events/catalog.ts. describeEventAutomationTrigger(trigger, catalog) in event-automations/tool-support.ts applies the automation catalog (automation: false resource types from ref(events): Declare core event limits per resource type #2379 are left out).

API (hard cutover)

  • The event automation summary now returns trigger: EventTriggerDescription. It no longer returns raw events, match, triggerAvailable, or triggerProblems.
  • triggerAvailable is removed from the summary and the edit response. A trigger is unavailable when trigger.problems is not empty. No consumer of the edit response used it.
  • eventAutomationTriggerProblems and eventAutomationTriggerAvailable are replaced by describeEventAutomationTrigger.
  • The agent tool result keeps its own trigger.available and trigger.problems. It now gets them from the same description.

Surfaces

All of these use the shared description now, and their old formatting code is removed:

  • Dashboard list row: one line from eventTriggerText. Unavailable comes from trigger.problems.
  • Dashboard details and the read-only view: event names plus a new TriggerFilters list ("Every filter must match:", or "No filters. Runs on every selected event."). The read-only view no longer shows a JSON dump.
  • Dashboard status: lists the saved trigger's problems with "Edit the trigger to fix it."
  • Dashboard editor: event checkboxes and list values use the shared words. Agent guidance under events is removed. The stale-trigger notice shows the saved trigger in words, not JSON. The text says "filter" everywhere.
  • Dashboard version history: each Event version shows its events and filters with TriggerFilters, not raw JSON.
  • Slack card (eventAutomationToolResult): eventTriggerText replaces the raw key = "json" strings. Status and warning come from problems.
  • Slack details (automation-details.ts): a new Filters field. Status and Needs attention come from trigger.problems.

Identifier display is out of scope. Structured identifier parts are #2362 item 6.

Version history

Each Event version in the version list API now also has trigger: EventTriggerDescription. The server builds it with the enabled plugins. The saved definition stays raw, so "make active" still posts it back unchanged. The new listedAutomationVersionSchema holds one list item. The stored automationVersionSchema is unchanged.

Verification

Rebased on #2381 at 7d3ed7ed9 (after #2379 merged). CI runs only for PRs into main, so these checks ran locally.

  • pnpm typecheck and pnpm lint pass.
  • Vitest: unit/events/*, integration/api/automations, integration/api/automation-edits, integration/slack/automation-details-webhook, and the dashboard suite (320 tests) pass.
    • unit/events/match.test.ts has representative formatter cases.
    • integration/api/automation-edits checks the version list descriptions: one clean trigger and one with a problem.
  • integration/event-automations.test.ts: 14 of 15 pass. "delivers the current automation card" fails on the generated title in my sandbox. It fails the same way on the bare feat(events): Reject event filters that cannot match #2381 branch, so this change does not cause it. Its trigger-line assertion passes.
  • Dashboard e2e: automations.spec.ts and automation-editor.spec.ts pass (9 of 9). The unavailable-trigger scenario checks the problem text.

via David Cramer.

--

View Junior Session [Sentry]

@vercel

vercel Bot commented Oct 29, 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 29, 2026 9:03pm UTC

Request Review

Add one shared Event trigger description in plugin-api: event names in
plain words, one line per filter, and the saved trigger's problems. The
problems come from `eventTriggerProblems`, so every surface shows the same
messages as the save check. A list field reads "includes X"; list values
on other fields read "is X or Y".

The automation API now returns this description instead of raw events,
match, and a separate availability flag. A trigger is unavailable when it
has problems. The dashboard list, details, editor, read-only view, and
version history, the Slack card, and the Slack details all use it. Each
Event version keeps its saved definition, so it can still be made active
again.

Refs #2362

Co-Authored-By: David Cramer <[email protected]>
@github-actions

Copy link
Copy Markdown
Contributor

10 screenshot changes — 10 changed · 0 added · 0 removed

Review screenshots in Frameshift

Automation Details · Desktop
Automation Details · Desktop
Changed
Automation Details Light · Desktop
Automation Details Light · Desktop
Changed
Automation Editor Conflict · Desktop
Automation Editor Conflict · Desktop
Changed
Automation Editor Conflict · Mobile
Automation Editor Conflict · Mobile
Changed
Automation Editor Public · Desktop
Automation Editor Public · Desktop
Changed
Automation Editor Public · Mobile
Automation Editor Public · Mobile
Changed
Show 4 more changed screenshots
Automation Event Editor · Desktop
Automation Event Editor · Desktop
Changed
Automation Event Editor · Mobile
Automation Event Editor · Mobile
Changed
Automations List · Desktop
Automations List · Desktop
Changed
Automations List · Mobile
Automations List · Mobile
Changed

@dcramer
dcramer merged commit 7a4dfc7 into main Oct 29, 2026
44 checks passed
@dcramer
dcramer deleted the feat/trigger-presentation branch October 29, 2026 21:16

This branch was successfully deployed

1 active deployment
Preview – junior-docs — d5a7d912 Deployed Oct 29, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk: high PR risk score: high

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant