Skip to content

Add canary endpoint for e2e alert testing - #59

Merged
jasoncrawford merged 4 commits into
mainfrom
feature/canary-endpoint
Feb 24, 2026
Merged

jasoncrawford merged 4 commits into
mainfrom
feature/canary-endpoint

Conversation

@jasoncrawford

Copy link
Copy Markdown
Collaborator

Summary

  • Adds a /canary route that returns a configurable HTTP status code (read from a new settings table in Supabase)
  • Adds a "Canary" section on the settings page with a dropdown to pick the response code
  • Dropdown options are color-coded: green (200 OK), amber (502/503/504 soft failures), red (all other errors / hard failures) — matching how the check runner classifies them
  • New settings table (simple key-value store) with RLS: public read, authenticated write

How to use

  1. Merge this PR and wait for the migration to apply
  2. Add a new monitored site with URL https://<your-app>/canary and name it "Canary"
  3. To test alerting: go to Settings → Canary → pick a failure code (e.g. 500)
  4. Wait for the next cron check (up to 5 min) — incident opens, email + Slack alerts fire
  5. Set it back to 200 and resolve the incident

Test plan

  • Verify /canary returns 200 by default
  • Change setting to 500, verify /canary returns 500
  • Add /canary as a monitored site, set to 500, confirm incident + alerts fire
  • Verify settings page loads the current value correctly
  • Verify auth is required to change the setting

🤖 Generated with Claude Code

Adds a /canary route that returns a configurable HTTP status code, and a
settings UI to control it. This lets you add /canary as a monitored site
and trigger real incidents to verify email and Slack alerting works.

- New `settings` table (key-value) with canary_status_code default 200
- /canary route reads the setting and returns that status code
- Dropdown on settings page with color-coded status codes (green/amber/red
  matching success/soft-fail/hard-fail classification)
- Server action with auth check and validation

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@vercel

vercel Bot commented Feb 24, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
site-status Ready Ready Preview, Comment Feb 24, 2026 2:57pm

Request Review

@supabase

supabase Bot commented Feb 24, 2026 •

Copy link
Copy Markdown

Updates to Preview Branch (feature/canary-endpoint) ↗︎

Deployments Status Updated
Database ✅ Tue, 24 Feb 2026 14:57:03 UTC
Services ✅ Tue, 24 Feb 2026 14:57:03 UTC
APIs ✅ Tue, 24 Feb 2026 14:57:03 UTC

Tasks are run on every commit but only new migration files are pushed.
Close and reopen this PR if you want to apply changes from existing seed or migration files.

Tasks Status Updated
Configurations ✅ Tue, 24 Feb 2026 14:57:03 UTC
Migrations ✅ Tue, 24 Feb 2026 14:57:04 UTC
Seeding ✅ Tue, 24 Feb 2026 14:57:04 UTC
Edge Functions ✅ Tue, 24 Feb 2026 14:57:04 UTC

View logs for this Workflow Run ↗︎.
Learn more about Supabase for Git ↗︎.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The canary dropdown added a second combobox to the settings page,
causing a strict mode violation in the Slack contact test.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@jasoncrawford
jasoncrawford merged commit 106ea30 into main Feb 24, 2026
4 checks passed

This branch was successfully deployed

1 active deployment
Preview — 7c16bba2 Deployed Feb 24, 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