drizzle
Use this skill when writing or modifying Drizzle ORM schemas, queries, or migrations in this repo — specifically the…
End-to-end smoke test for the public Errors HTTP API (error groups). Seeds failed runs into ClickHouse so the error materialized views populate, then drives the real endpoints against the running webapp — list (with filters + pagination), retrieve, resolve/ignore/unresolve, the
Claude Code
$ npx -y skills add triggerdotdev/trigger.dev --skill errors-api-e2e --agent claude-code
Codex
$ npx skills add triggerdotdev/trigger.dev --skill errors-api-e2e -a codex -y
Cursor
$ npx skills add triggerdotdev/trigger.dev --skill errors-api-e2e -a cursor -y
Gemini CLI
$ npx skills add triggerdotdev/trigger.dev --skill errors-api-e2e -a gemini-cli -y
GitHub Copilot
$ npx skills add triggerdotdev/trigger.dev --skill errors-api-e2e -a github-copilot -y
OpenCode
$ npx skills add triggerdotdev/trigger.dev --skill errors-api-e2e -a opencode -y
Windsurf
$ npx skills add triggerdotdev/trigger.dev --skill errors-api-e2e -a windsurf -y
name: errors-api-e2e description: End-to-end smoke test for the public Errors HTTP API (error groups). Seeds failed runs into ClickHouse so the error materialized views populate, then drives the real endpoints against the running webapp — list (with filters + pagination), retrieve, resolve/ignore/unresolve, the `filter[error]` runs filter, user attribution via the `trigger.dev mint-token` -> JWT exchange, and the 401/403/404 negatives. Use for "smoke test the errors API", "test the errors API e2e", "prove the errors endpoints work", or to re-verify after changes. allowed-tools: Read, Bash
Proves the public Errors API against the **running** webapp with real HTTP. No mocks. The error data plane is ClickHouse (`errors_v1` + `error_occurrences_v1`, both materialized-view-fed from `task_runs_v2`) plus Postgres `ErrorGroupState` for lifecycle status; this skill seeds straight into `task_runs_v2` and lets the MVs do the rest.
Code under test:
`errorId` is `error_<fingerprint>` (round-trips via `ErrorId` in `@trigger.dev/core/v3/isomorphic`).
> Important wiring facts the seed relies on (verified): > - The MVs read the error type/message from `error.data.*`, so the seeded > `error` JSON column **must** be wrapped: `{"data": {"type": ..., "message": ..., "stack": ...}}`. > - The MVs only fire for failed statuses: `SYSTEM_FAILURE | CRASHED | INTERRUPTED | COMPLETED_WITH_ERRORS | TIMED_OUT`, and require a non-empty `error_fingerprint`. > - `GET /api/v1/runs` lists run **ids** from ClickHouse but **hydrates from Postgres** `TaskRun`. So the error-list/detail/action legs work from a ClickHouse-only seed, but the `filter[error]` leg needs a **paired** Postgres `TaskRun` row whose `id` equals the ClickHouse `run_id`.
Run everything from the repo root in one shell. Invoke the built CLI via a function (a `CLI="node …"` variable won't word-split under zsh):
cli() { node packages/cli-v3/dist/esm/index.js "$@"; }
PROFILE=defaultcd apps/webapp CHURL=$(grep -E "^CLICKHOUSE_URL=" .env | head -1 | cut -d= -f2- | tr -d '"') DBURL=$(grep -E "^DATABASE_URL=" .env | head -1 | cut -d= -f2- | tr -d '"' | tr -d "'" | sed 's/?.*//') # Pick the seeded hello-world dev env (proj_rrkpdguyagvsoktglnod). Adjust the # WHERE if you want a different project. read ENV ORG PROJ REF < <(psql "$DBURL" -t -A -F' ' -c " SELECT re.id, re.\"organizationId\", re.\"projectId\", p.\"externalRef\" FROM \"RuntimeEnvironment\" re JOIN \"Project\" p ON p.id = re.\"projectId\" WHERE re.slug='dev' AND p.\"externalRef\"='proj_rrkpdguyagvsoktglnod' LIMIT 1;") APIKEY=$(psql "$DBURL" -t -A -c "SELECT \"apiKey\" FROM \"RuntimeEnvironment\" WHERE id='$ENV';") cd .. H="Authorization: Bearer $APIKEY" B="http://localhost:3030"
RUN=$(node -e 'console.log(Date.now().toString(36))')
TASK="errors-api-e2e-$RUN"; FP_A="fpA${RUN}"; FP_B="fpB${RUN}"
ERRID_A="error_$FP_A"; ERRID_B="error_$FP_B"
NOW_CH=$(node -e 'console.log(new Date().toISOString().replace("T"," ").replace("Z","").slice(0,23))')
NOW_MS=$(node -e 'console.log(Date.now())')
Q=$(python3 -c "import urllib.parse;print(urllib.parse.quote('INSERT INTO trigger_dev.task_runs_v2 FORMAT JSONEachRow'))")
mkrow() { # status fingerprint errorType message runId
echo "{\"environment_id\":\"$ENV\",\"organization_id\":\"$ORG\",\"project_id\":\"$PROJ\",\"run_id\":\"$5\",\"friendly_id\":\"run_$5\",\"status\":\"$1\",\"environment_type\":\"DEVELOPMENT\",\"engine\":\"V2\",\"task_identifier\":\"$TASK\",\"created_at\":\"$NOW_CH\",\"updated_at\":\"$NOW_CH\",\"error\":{\"data\":{\"type\":\"$3\",\"message\":\"$4\",\"stack\":\"at x (a.ts:1:1)\"}},\"error_fingerprint\":\"$2\",\"task_version\":\"20240101.1\",\"_version\":\"$NOW_MS\",\"_is_deleted\":0}"
}
ROWS="$(mkrow COMPLETED_WITH_ERRORS $FP_A AlphaBoom 'alpha boom happened' r_a1_$RUN)
$(mkrow COMPLETED_WITH_ERRORS $FP_A AlphaBoom 'alpha boom happened' r_a2_$RUN)
$(mkrow CRASHED $FP_B BetaCrash 'beta crash happened' r_b1_$RUN)"
printf '%s' "$ROWS" | curl -s "$CHURL/?query=$Q" --data-binary @-
# Poll until both fingerprints appear in errors_v1 (the MV is near-instant locally).
for i in $(seq 1 10); do
N=$(curl -s "$CHURL" --data-binary "SELECT count() FROM (SELECT 1 FROM trigger_dev.errors_v1 WHERE environment_id='$ENV' AND error_fingerprint IN ('$FP_A','$FP_B') GROUP BY error_fingerprint)")
[ "$N" = "2" ] && break; sleep 1
done
echo "seeded fingerprints in errors_v1: $N (want 2)"PASS: `N = 2`. Alpha has 2 occurrences, beta 1.
curl -s "$B/api/v1/errors?filter%5BtaskIdentifier%5
The quickest way to get started is to create an account and project in our web app, and follow the instructions in the onboarding. Build and deploy your first task in minutes.
Use this skill when writing or modifying Drizzle ORM schemas, queries, or migrations in this repo — specifically the…
Use when adding, modifying, or debugging OTel span timeline events in the trace view. Covers event structure, ClickHouse storage…
Use this skill when writing, designing, or optimizing Trigger.dev background tasks and workflows. This includes creating reliable…
Author and run a durable AI chat agent with chat.agent from @trigger.dev/sdk/ai: the per-turn run loop, why you MUST take…
Covers writing backend Trigger.dev tasks with @trigger.dev/sdk: defining task() and schemaTask(), the run function and its ctx,…
Advanced and operational chat.agent capabilities for Trigger.dev, loaded on demand. Load this when working on the raw Sessions…
You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or…
Ask which skill or flow fits your situation. A router over the skills in this repo.