Skip to content

Batch 2026-07-06-2: 10 completed specs - #111

Merged
fclairamb merged 94 commits into
mainfrom
batch/2026-07-06-2
Jul 8, 2026
Merged

fclairamb merged 94 commits into
mainfrom
batch/2026-07-06-2

Conversation

@fclairamb

Copy link
Copy Markdown
Owner

Summary

Integrates 10 completed specs from the batch/2026-07-06-2 integration branch:

  • One-click MCP connector setup
  • Recent activity event links and rendering
  • Checks list last_result overfetch fix
  • Dashboard E2E flake fix (login contention)
  • Embedded Postgres orphan sweep + watchdog
  • SaaS Free plan entitlements defaults fix (+ live k8xp SaaS deployment rollout)
  • Check live subscription slug-vs-uid fix
  • E2E hardcoded API_BASE fix
  • Check result region fallback fix
  • make dev devloop log rotation

Each spec was implemented in its own branch, independently completeness-audited, and merged into the batch branch; specs are archived under specs/done/2026/07/.

Test plan

  • Verified 0 merge conflicts against current main (git merge-tree)
  • go build ./... clean across all backend packages
  • go test ./... passing (3 unrelated failures traced to a pre-existing embedded-postgres-go shared-cache race under concurrent package test runs — reproduced in isolation on unrelated code, not caused by this merge)
  • dash0 tsc --noEmit clean
  • CI green on this PR

🤖 Generated with Claude Code

fclairamb and others added 30 commits July 6, 2026 21:15
Adds a one-click MCP connector setup experience: a new "AI assistants"
dashboard page (Organization section) with the instance MCP URL, per-client
install affordances (Claude, Claude Code, Cursor, VS Code, generic/other),
read-only-scope and self-hosted-caveat callouts, plus a docs rewrite that
leads with the URL-only OAuth flow and demotes the manual bearer-token flow
to a headless/CI fallback section.
…name

Every incident.* event (created/escalated/escalation_failed/resolved/
reopened/acknowledged/unacknowledged/snoozed/unsnoozed, single + group
variants) now sets CheckUID on the event row and includes check_uid,
check_slug, check_name in the payload. Previously acknowledged/unack/
snoozed/unsnoozed had none of these, and created/resolved/reopened had
check_uid+check_slug but not check_name.

emitEvent now sets event.CheckUID from incident.CheckUID in one place,
covering the created/escalated/resolved/reopened funnel. The four
direct-event paths (ack/unack/snooze/unsnooze) and the escalation-step
job's soft-failure event each get a best-effort GetCheck lookup so the
payload can carry check_slug/check_name too.
activation.Emit gains a trailing variadic extra ...models.JSONMap param.
Two reserved keys (_incident_uid, _check_uid) are popped off and set on
the event row (IncidentUID/CheckUID) instead of being written to Payload;
everything else merges into the stored payload alongside "source". All
existing call sites keep compiling unchanged since the new param is
optional.

Wires it up for:
- org.activation.first_notification_configured (channel creation + Freebox
  pairing in integrations/service.go): payload gains channel_uid,
  channel_name, channel_type from the just-created Connection.
- org.activation.first_incident_paged (job_notification.go): links the
  event to the incident/check that triggered the first page via the
  reserved UID keys, plus check_slug/check_name in the payload.
…ctivity

event-display.tsx: getEventCheckName now falls back to payload.check_slug
when check_name is absent (covers pre-existing incident events that only
ever captured the slug). Adds getEventChannelName/getEventChannelUid for
the notification-channel enrichment, and a distinct Rocket icon for
org.activation.* milestones (previously fell through to the generic
Calendar).

RecentActivityList (dashboard card) now renders BOTH the incident link
and the check link when their UIDs are present, instead of only ever
showing a single check link gated on payload.check_name. The channel-name
variant of "First Notification Configured" links the channel name to its
integration edit page when channel_uid is present, falling back to the
generic sentence for historical events lacking the new payload fields.

i18n: fill every missing types.*/descriptions.* key for the full 18-value
EventType constant list (escalation_failed, reopened, unacknowledged,
snoozed, unsnoozed, status_update.*, signup_completed,
first_result_received, first_incident_paged) across en/de/es/fr, keeping
this repo's existing all-locales-key-parity convention. Leaves the
pre-existing incident.opened key untouched (no matching backend constant,
out of scope here).
…nline

CopyableValue and CopyErrorButton in notifications.$notificationUid.tsx
duplicated the same clipboard mechanics already factored out into
copyable-code.tsx's copyToClipboard(). Extract a shared CopyableInline
primitive (inline value + button, or bare button via inline={false}) and
register it on the design reference page.
…ifecycle

Adds event_check_enrichment_test.go covering the full incident lifecycle
through ProcessCheckResult (created, resolved, escalated, reopened) and
the direct-event paths (acknowledge, unacknowledge, snooze, unsnooze),
asserting every emitted event has CheckUID set on the row plus
check_uid/check_slug/check_name in the payload. Also pins the
no-backfill contract: a hand-built "old shape" event round-trips through
ListEvents with no row CheckUID and no synthesized check_name.

Adds two activation tests: extra payload + reserved UID keys
(_incident_uid/_check_uid) round-trip onto the event row without leaking
into the stored payload, and the plain channel-payload shape used by
first_notification_configured. Required creating real check/incident
rows for the FK-backed columns — an initial version using placeholder
UUIDs passed vacuously (Emit swallows the FK failure and inserts nothing,
which ListEvents then reported as zero events, not a failure).

Also splits Emit's extra-merging loop into a small applyExtra helper to
keep cyclomatic complexity under the linter's threshold.
Extends mockDashboard() to accept an events fixture, and adds three
dashboard E2E tests: an incident.created row renders both the incident
link and a named check link; a historical event missing check_name
falls back to check_slug for the check link text; and a real channel
created via the API surfaces its name as a link to the integration page
in the first_notification_configured row.

All three verified passing against the local :4000 test-mode devloop.
integrations/service_test.go: TestCreateChannelEmitsEnrichedActivationEvent
drives CreateIntegration through a real webhook creation and asserts the
resulting first_notification_configured event carries channel_uid/
channel_name/channel_type.

test/integration/incident_notifications_audit_test.go:
TestFirstIncidentPagedEventIsEnriched reuses the existing
notificationAuditSetup/triggerIncident harness to run a real
NotificationJobRun end to end and asserts first_incident_paged links to
the triggering incident/check (IncidentUID/CheckUID on the row) with
check_slug/check_name in the payload.
…07-06-2

Recent activity: incident/check links, activation event rendering,
notification channel name.

- Backend: every incident.* lifecycle event (created/escalated/
  escalation_failed/resolved/reopened/acknowledged/unacknowledged/
  snoozed/unsnoozed, single + group) now sets CheckUID on the row and
  includes check_uid/check_slug/check_name in the payload.
- activation.Emit gains an optional extra payload (variadic
  models.JSONMap) with two reserved keys (_incident_uid/_check_uid) that
  link the resulting event row to an incident/check. Wired up for
  first_notification_configured (channel_uid/channel_name/channel_type)
  and first_incident_paged (incident/check linkage + check_name).
- Frontend: RecentActivityList renders both the incident link and a
  named check link (falling back check_name -> check_slug -> generic
  label); first_notification_configured shows the channel name linked to
  its integration page; a distinct icon for org.activation.* milestones;
  every EventType constant now has an i18n label across en/de/es/fr.
- Tests: 9 Go tests pinning the enriched payloads across the incident
  lifecycle + both activation call sites, 3 new Playwright E2E tests for
  the dashboard Recent activity card.
Consolidates CopyableValue and CopyErrorButton in notifications.$notificationUid.tsx
into a shared CopyableInline primitive in copyable-code.tsx.
…ntion)

Postgres: DISTINCT ON (check_uid) + organization_uid predicate to ride
results_raw_idx. SQLite: equivalent ROW_NUMBER() OVER (PARTITION BY
check_uid ...) window-function CTE, joined back to the base table so the
rn column never leaks into the models.Result scan. Both backends now stay
behaviorally identical per the sync-pg-to-sqlite convention.

Threads organization_uid through the three call sites (ListChecks, GetCheck,
checkworker's executePassiveJob) and the mock in slack_test.go.

Previously both backends fetched every raw row for the requested checks and
kept only the newest per check in a Go loop — with the default 24h raw
retention, a 1-minute check could return up to 1,440 rows to keep 1.
… scoping

Seeds 50 raw rows across two checks on both backends and asserts the map
returns exactly one row per check (the newest by period_start), plus a
second test proving the organization_uid predicate actually scopes results
and doesn't leak across organizations.
fclairamb and others added 23 commits July 7, 2026 04:34
saveResult and saveErrorResult previously copied checkJob.Region straight
onto the persisted result, which stays NULL for any check without explicit
regions[] (the common single-worker/self-hosted case). Fall back to the
executing worker's own registered region so results always attribute a
region without touching the multi-region assignment path.
Adds TestSaveResultFallsBackToWorkerRegion (success path),
TestSaveErrorResultFallsBackToWorkerRegion (error path), and
TestSaveResultKeepsExplicitJobRegion (multi-region assignment still wins),
driving the real executeJob path via a heartbeat check for the success/
priority tests and a no-type job for the error path.
check-detail.spec.ts's region-column test previously grabbed .first() of
all result rows, which could land on the synchronous 'created' placeholder
row (structurally regionless, inserted before any worker claims the job)
instead of the real executed result. Filter out rows whose status badge
reads 'created' and give the wait the same ~30s headroom as job scheduling
+ worker claim + HTTP check + save + poll/refetch needs.
…ch/2026-07-06-2

Fixes check results never carrying a region unless the check has explicit
regions[]: saveResult/saveErrorResult now fall back to the executing
worker's own registered region when checkJob.Region is nil, instead of
persisting NULL. Includes backend unit tests for the success/error/
explicit-region-priority cases and an e2e test fix to target a genuine
executed result row instead of the synchronous "created" placeholder.
All acceptance criteria genuinely met (code correct, tests green,
e2e passes reliably); annotated with a premise correction found
during audit — ResolveRegionsForCheck already prevents the nil-region
case in normal usage, so the worker.Region fallback is defensive code
for bypass paths rather than a fix for a currently-reachable gap.
Part C shipped: k8xp overlays flipped to SP_DEPLOYMENT_MODE=saas,
admin entitlement overrides seeded for real orgs, new image built
via GitHub Actions and deployed to solidping-dev, live-verified via
the entitlements API (scratch orgs get Free/10/6, stonaltech and
others keep their overrides, unthrottled).
…gnored

The unanchored 'devloop' entry (meant for a stray go-build binary) also
matched the cmd/devloop source directory, silently ignoring any new file
added there. Same latent trap for 'back' and 'server'.

Co-Authored-By: Claude Fable 5 <[email protected]>
Line-boundary rotation at a configurable cap with shifted .1/.2 backups,
fresh active file per session (previous tail kept as .1), and graceful
degradation to terminal-only on open/write failure.

Co-Authored-By: Claude Fable 5 <[email protected]>
…g logs

Generalize the backend supervisor into a named per-child supervisor:
-proc name:dir:command children (the bun dev servers) run under devloop,
every stream (devloop lines, build output, child stdout/stderr) is
mirrored to the terminal and a size-rotated <name>.log via -log-dir,
shutdown stops the whole tree with SIGINT/grace/SIGKILL, and children
that die on their own are reported loudly (no auto-restart).

Co-Authored-By: Claude Fable 5 <[email protected]>
dev/dev-test/dev-saas run one foreground devloop that supervises the
backend plus both bun dev servers with rotating logs — no tee, no
backgrounded pipelines to orphan. dev-backend switches from
'go run . serve | tee' to devloop, gaining hot reload and log rotation
(backend-only without reload remains 'make run').

Co-Authored-By: Claude Fable 5 <[email protected]>
build-backend, lint-back (0 issues), make test (full suite green on
re-run; one-off checkworker flake was pre-existing and unrelated),
devloop unit tests race-clean under 10x stress, and live scratch-dir
verification: rotation/shift/prune, no torn lines, single process tree,
SIGINT reaps all children with shutdown lines landing in backend.log,
build failures logged to file, restart keeps previous tail as .1.

Co-Authored-By: Claude Fable 5 <[email protected]>
devloop owns dev-time process supervision and size-rotated logs:
rotating writer in cmd/devloop, -proc auxiliary children for the bun
dev servers, dev targets collapsed to one foreground devloop, docs.

Co-Authored-By: Claude Fable 5 <[email protected]>
…Postgres

GetOrgNotification's uid column is uuid-typed in Postgres; a non-UUID
identifier like a stale/garbage URL segment errored on the implicit
cast instead of matching zero rows, surfacing as a 500 instead of the
friendly not-found state. The SQLite-backed handler unit test never
caught this since SQLite has no such column typing — only the
Postgres-backed E2E run in CI did.
@fclairamb
fclairamb enabled auto-merge (squash) July 8, 2026 00:04
@fclairamb
fclairamb merged commit d105be4 into main Jul 8, 2026
11 checks passed
@fclairamb
fclairamb deleted the batch/2026-07-06-2 branch July 8, 2026 00:22
fclairamb added a commit that referenced this pull request Jul 8, 2026
release-please's first-parent commit traversal only saw the merge
commit for #111 ("Batch 2026-07-06-2: 10 completed specs"), which
isn't conventional-commit-formatted, so none of the 93 squashed
feat:/fix: commits it merged were auto-categorized. Manually adding
entries here, following the same precedent already used for #89's
release (0.2.0) — multiple bullets against a single merge commit sha.
@fclairamb fclairamb mentioned this pull request Jul 8, 2026
fclairamb added a commit that referenced this pull request Jul 8, 2026
🤖 I have created a release *beep* *boop*
---


##
[0.2.1](v0.2.0...v0.2.1)
(2026-07-08)


### Features

* **dash0:** one-click MCP connector setup — AI assistants page with a
URL-only OAuth flow, per-client icons, shared copy/collapsible code
primitives ([#111](#111))
([d105be4](d105be4))
* **dash0:** Recent activity links directly to the originating
incident/check and shows the channel name; incident lifecycle events
enriched with check UID/name
([#111](#111))
([d105be4](d105be4))
* **entitlements:** SaaS Free-plan defaults now match the billing Free
plan (10 checks, 6/min, no SSO), with a backend-driven
"Free"/"Team"/"Self-hosted" plan display identity
([#111](#111))
([d105be4](d105be4))
* **devloop:** `make dev`/`make dev-test` supervise dash0 and status0
with size-rotated per-process logs instead of unbounded raw output
([#111](#111))
([d105be4](d105be4))


### Bug Fixes

* **checks:** list endpoint no longer overfetches O(retention) raw rows
per check for `lastResult` — one row per check via `DISTINCT ON`
([#111](#111))
([d105be4](d105be4))
* **e2e:** dashboard E2E suite flaked on per-test login contention;
authenticate once per Playwright worker instead of once per test
([#111](#111))
([d105be4](d105be4))
* **db:** embedded-Postgres orphan sweep + watchdog reclaims leaked
dev/test instances left behind by crashed processes
([#111](#111))
([d105be4](d105be4))
* **realtime:** check-detail live subscription used the URL slug instead
of the canonical uid, silently breaking live updates on slug-based check
URLs ([#111](#111))
([d105be4](d105be4))
* **e2e:** hardcoded `localhost:4000` in several spec files ignored
`E2E_BASE_URL`, breaking test runs against non-default servers
([#111](#111))
([d105be4](d105be4))
* **checkworker:** check results fell back to a null region for
default-region checks instead of the executing worker's own region
([#111](#111))
([d105be4](d105be4))
* **notifications:** a malformed notification UID errored on the
Postgres `uuid` column cast instead of rendering the friendly not-found
state ([#111](#111))
([d105be4](d105be4))
* **dash0:** live-socket CONNECTING crash + route-level error boundaries
([#108](#108))
([008c015](008c015))
* **deps:** update go dependencies (non-major)
([#109](#109))
([ec616d4](ec616d4))
* **deps:** update module github.com/oapi-codegen/oapi-codegen/v2 to
v2.7.2 ([#110](#110))
([09d6ad0](09d6ad0))
* **deps:** update module github.com/ohler55/ojg to v1.28.2
([#107](#107))
([335615c](335615c))
* **deps:** update module github.com/wneessen/go-mail to v0.8.0
([#103](#103))
([aa533c1](aa533c1))
* Slack multi-org, region filtering, mail-checker hang fixes,
live-status dot
([#100](#100))
([35f3aa2](35f3aa2))

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