From 26d0a05a1534b9bcf5f2e62b3fad0502607bc488 Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 14 Apr 2026 10:58:10 +0000 Subject: [PATCH] docs(flaky-tests): document webhook event schemas with field descriptions PR #3519 added descriptive metadata to the three Flaky Tests webhook event schemas published via Svix. Each event type now has per-field descriptions visible in the Svix app portal. Add reference tables for test_case.monitor_status_changed, v2.test_case.status_changed, and test_case.investigation_completed to the Flaky Tests webhooks page. Co-Authored-By: Claude Opus 4.6 --- flaky-tests/webhooks/README.md | 60 ++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) diff --git a/flaky-tests/webhooks/README.md b/flaky-tests/webhooks/README.md index 300bdb52..f393e8eb 100644 --- a/flaky-tests/webhooks/README.md +++ b/flaky-tests/webhooks/README.md @@ -14,6 +14,66 @@ Trunk lets you create custom workflows with **event-triggered webhooks**. Flaky {% embed url="https://www.svix.com/event-types/us/org_2eQPL41Ew5XSHxiXZIamIUIXg8H/#test_case.status_changed" %} +Trunk publishes three Flaky Tests event types to Svix. Each event includes a full JSON schema with field descriptions visible in the Svix app portal. + +#### `test_case.monitor_status_changed` + +Emitted when a monitor activates or resolves for a test case. + +| Field | Type | Description | +|---|---|---| +| `type` | string | Always `test_case.monitor_status_changed` | +| `timestamp` | string (ISO 8601) | When the event occurred | +| `monitor.id` | string (UUID) | Unique identifier for the monitor | +| `monitor.type` | string | The type of monitor (e.g. `pass_on_retry`) | +| `monitor.status` | string | Current monitor status (`active` or `resolved`) | +| `evidence` | object | Data supporting the status change; structure varies by monitor type | +| `repository.id` | string (UUID) | Unique identifier for the repository | +| `repository.html_url` | string | URL of the repository | +| `test_case.id` | string (UUID) | Stable unique identifier for the test | +| `test_case.name` | string | Name of the test | +| `test_case.classname` | string | Test classname | +| `test_case.file_path` | string | File path of the test | +| `test_case.html_url` | string | URL to the test detail page in Trunk | +| `test_case.codeowners` | string[] | Code owners associated with the test | +| `test_case.quarantined` | boolean | Whether the test is quarantined | +| `test_case.variant` | string | Test variant name | + +#### `v2.test_case.status_changed` + +Emitted when a test case changes status (e.g. becomes flaky or is resolved), triggered by a monitor. + +| Field | Type | Description | +|---|---|---| +| `type` | string | Always `v2.test_case.status_changed` | +| `timestamp` | string (ISO 8601) | When the event occurred | +| `previous_status` | string | The prior status of the test case | +| `new_status` | string | The updated status of the test case | +| `triggered_by.monitor_id` | string | Unique identifier of the triggering monitor | +| `triggered_by.monitor_type` | string | Type of monitor that triggered the change | +| `triggered_by.monitor_status` | string | Status of the monitor at the time of the trigger | +| `repository` | object | See `repository` fields above | +| `test_case` | object | See `test_case` fields above | + +#### `test_case.investigation_completed` + +Emitted when an AI-powered flaky test analysis finishes for a test case. + +| Field | Type | Description | +|---|---|---| +| `type` | string | Always `test_case.investigation_completed` | +| `investigation_id` | string (UUID) | Unique identifier for the investigation | +| `confidence` | number | Overall confidence score (0-1) for the findings | +| `created_at` | string (ISO 8601) | When the investigation completed | +| `markdown_summary` | string | Markdown-formatted summary of findings and recommendations | +| `failure_message` | string | The original failure message that triggered the investigation | +| `facts` | array | Facts discovered during the investigation | +| `facts[].fact_type` | string | Category of the fact (e.g. `GIT_BLAME`) | +| `facts[].content` | string | Detailed description with citations to supporting evidence | +| `facts[].confidence` | number | Confidence score (0-1) for this individual fact | +| `repository` | object | See `repository` fields above | +| `test_case` | object | See `test_case` fields above | + You can also find guides for specific examples here:
Send a Slack Messageslack-integration.md
Create a GitHub Issuegithub-issues-integration.md
Send a Microsoft Teams Messagemicrosoft-teams-integration.md
Create a Linear Issuelinear-integration.md
Create a Jira Issuejira-integration.md