Skip to content

feat: incident refs (#42), Telegram incident commands, first-failure snapshots and TLS edge chaining - #217

Merged
fclairamb merged 52 commits into
mainfrom
batch/2026-08-13
Aug 14, 2026
Merged

fclairamb merged 52 commits into
mainfrom
batch/2026-08-13

Conversation

@fclairamb

@fclairamb fclairamb commented Aug 14, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • Incidents get a short reference — #42. A per-org, monotonically increasing number assigned at creation, concurrency-safe on both engines, with existing incidents backfilled oldest-first. Soft-deleted incidents keep their number and numbers are never reused, so a reference always means one incident forever. Surfaced in the API, dash0 (list + detail), Slack and Telegram — a UUID was never something anyone would type into a chat on a phone, which is what blocked typed incident commands.
  • Telegram becomes interactive. An inline Acknowledge button on alerts (same service path Slack uses, toast confirmation, original message edited in place to "✅ Acknowledged by … at …" with the button removed, idempotent on already-acked/resolved), plus /status, /incidents, /ack [#ref], /incident <#ref> and /help, registered via setMyCommands so they autocomplete. Unlinked chats are refused on both the command and callback paths.
  • Incidents record what caused them. incidents.details existed but nothing ever wrote to it, while the Slack formatter was already reading failure_reason from it and falling back to the literal "Check failed". The first failing result is now snapshotted at open — a copy, not a reference, since retention deletes raw results — with last_failure added on reopen without disturbing the original cause. Rendered as a "First failure" / "Latest relapse" card in dash0; both Slack readers light up as a side effect.
  • TLS edge fallback upstream. An instance can forward a connection for a host it neither reserves nor serves to a configured upstream over PROXY protocol v2, carrying the original client address, so two instances can share one edge. SNI is peeked strictly below TLS termination (fragmented ClientHellos handled, every byte replayed), with the same Host-peek on :80 so the downstream can still solve HTTP-01. Fail-closed: no-SNI, malformed hellos and peek timeouts stay local; a cycle is refused; an unreachable upstream closes rather than falling back. Off unless configured.
  • Two dash0 fixes. Region chips on the check detail page were ordered inconsistently between the chart and the Recent Results filter (@-prefixed private slugs jumped the queue in one but not the other); and the redundant docs icon is gone from the check detail toolbar.

No breaking changes.

Migration

One scratch migration per engine — 012_incident_number.{up,down}.sql — adding number plus a unique (organization_uid, number) index, backfilled ordered by started_at. The Postgres side is fully idempotent; the SQLite ADD COLUMN is not (SQLite has no IF NOT EXISTS for columns), which is the intended loud failure if a database's bun_migrations row doesn't match.

The numbering guard in both engines' tests was generalized: it asserts every numeric prefix in the directory is unique, rather than checking one hardcoded filename — bun keys applied migrations on the prefix alone, so a reused prefix means a silently skipped migration.

Test plan

  • make build-backend lint-back test — green, lint reports 0 issues
  • make build-dash0 + dash0 eslint — green, no new errors over the ~44-error pre-existing baseline
  • make build-docs — green
  • Postgres migration and number-assignment race tests run explicitly without -short (they self-skip under -short, which is what CI runs): TestIncidentNumbers_Postgres 7.76s, TestIncidentNumberBackfillOrdersByStartedAt_Postgres 9.94s, both pass
  • Chained-edge integration tests: forwarding, ClientHello replay, original-client propagation through two PROXY rewrites, downstream serving its own certificate, last-hop refusal, HTTP-01 across a 3-hop chain
  • Each of the five specs passed an independent completeness audit against its source before being archived
  • dash0 E2E for #42 is authored but not run locally (the devloop isn't in SP_RUNMODE=test); spec 11's E2E was run against a side-car test server and passes
  • The real-CA (Pebble) chained ACME test is Docker- and -short-gated, like the pre-existing Pebble test — ungated tests still cover the chain end to end

Known limitation

Telegram group-chat ack attribution is implemented generically and exercised via the callback path, but is unreachable in v1: group chats cannot be linked at all (/start is refused outside private chats, and Telegram contacts can only be verified there). Making them linkable needs a Telegram-user-id → org-member mapping, which the spec explicitly puts out of scope. The branch is commented as unreachable so it isn't mistaken for live code.

🤖 Generated with Claude Code

…differently on the chart and the Recent Results filter
…ifferently on the chart and the Recent Results filter
…n-SNI/Host connections to a second server over PROXY protocol v2
…d unknown-SNI/Host connections to a second server over PROXY protocol v2
…known-SNI/Host connections to a second server over PROXY protocol v2
…known-SNI/Host connections to a second server over PROXY protocol v2
…nown-SNI/Host connections to a second server over PROXY protocol v2
fclairamb and others added 19 commits August 14, 2026 00:02
…nline-keyboard/callback support to the Telegram client
012 is the next free scratch number after the consolidated 011_v0_14_0, per
wiki/conventions/database.md. The 013 gap was defensive: it assumed a database
could still carry a bun_migrations row for the pre-consolidation 012 scratch
migration. That consolidation (573e9e8) landed before the v0.14.0 release, so
no released install ever recorded a 012.

The numbering guard is generalized while we are here: instead of asserting the
one hardcoded '012_' filename is absent, both engines' tests now assert every
numeric prefix in the directory is unique — the actual invariant, since bun
keys applied migrations on the prefix alone.

Co-Authored-By: Claude Opus 5 <[email protected]>
@fclairamb fclairamb changed the title fix: incident refs (#42), Telegram incident commands, first-failure snapshots, TLS edge chaining and two dash0 fixes feat: incident refs (#42), Telegram incident commands, first-failure snapshots, TLS edge chaining and two dash0 fixes Aug 14, 2026
@fclairamb fclairamb changed the title feat: incident refs (#42), Telegram incident commands, first-failure snapshots, TLS edge chaining and two dash0 fixes feat: incident refs (#42), Telegram incident commands, first-failure snapshots and TLS edge chaining Aug 14, 2026
@fclairamb
fclairamb enabled auto-merge (squash) August 14, 2026 06:44
@fclairamb
fclairamb merged commit a8cbaf3 into main Aug 14, 2026
11 checks passed
@fclairamb
fclairamb deleted the batch/2026-08-13 branch August 14, 2026 07:07
fclairamb added a commit that referenced this pull request Aug 14, 2026
🤖 I have created a release *beep* *boop*
---


##
[0.15.0](v0.14.0...v0.15.0)
(2026-08-14)


### Features

* incident refs
([#42](#42)), Telegram
incident commands, first-failure snapshots and TLS edge chaining
([#217](#217))
([a8cbaf3](a8cbaf3))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).
This was referenced Sep 8, 2026
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