Repository navigation
feat(checkins): add cron and background-job monitoring - #783
Merged
Merged
Conversation
Add interval and timezone-aware cron monitors with encrypted secret ping URLs, run-aware runtime deadlines, atomic outage transitions and durable alert intents. Reuse the scheduled evaluator, existing alert channels and nightly retention; keep pings outside ingest quota with independent monitor and project limits. Add role-aware dashboard management, Node withCheckIn support, recipes and unit, HTTP, privacy, migration and database integration coverage.
Validate monitor IDs with the shared strict UUID parser and encode the resource segment before fetching. Select action suffixes from fixed literals and reject resource actions without a monitor. Add regression coverage for valid paths, malformed UUIDs and route-injection attempts.
Accept X-TT-Checkin-Token and Bearer authentication on the existing check-in surface while preserving path-token URLs and shared validation/limits. Use trusted client IPs for the ping scope and scrub the new sensitive header from API and dashboard Sentry events. Send header pings by default in the Node helper, with an explicit URL transport option, and document the safer curl form in the dashboard and check-in guides. Cover header actions, invalid tokens, no-op previews, log privacy and visitor rate-limit identity. Verify migration and integration tests on disposable Postgres 16 without production database access.
Rename the unapplied check-in migration to 20261012133000 so it sorts after the deployed signup funnel migration. Preserve SQL byte-for-byte and update the migration safety test reference.
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Scheduled jobs previously had no per-job deadline or runtime monitoring. This adds Check-ins: a missing completion, explicit failure, or timed-out run creates one outage alert; the next success creates one recovery through existing channels.
X-TT-Checkin-TokenorAuthorization: Bearerauthentication on/checkinand action paths. Strict token/action validation, UUID run IDs, retry dedupe, ignored HEAD/preview bots and independent limits. Pings do not consume ingest quota.withCheckInuses headers by default for valid token URLs;tokenTransport: "url"retains path authentication.Validation:
pnpm lintand fullpnpm build: pass.pnpm test: 1,688 passed, 175 DB-gated tests skipped, zero failures. API: 1,204; dashboard: 330; Node: 33; other SDKs and publish guards: 121.localhost:55433/ci):prisma migrate deployapplies all migrations, including20261012133000_checkin_monitors, cleanly. Full API tests withRUN_DB_INTEGRATION_TESTS=true: 1,371 passed, 8 skipped, zero failures; all 12 check-in integration tests pass. Container stopped and removed afterwards.origin/developand the uncommitted hardening diff;git diff --checkpasses. Existing commits and develop merges preserved.Operational notes: API needs a backed-up
CHECKIN_ENCRYPTION_KEY; dashboard may needCHECKIN_PUBLIC_BASE_URL. Limits are per process. Path-token URLs remain visible to proxy/CDN logs; use header authentication to keep secrets out of request URLs. Alerts retain existing best-effort email semantics. CodeQL alert #12 clearance remains dependent on CI after runner publication; no local CodeQL CLI verification was performed.Update existing PR #783 only, base
develop, preserving its non-draft state. No merge, deploy, production data access or SDK publication. Source changes are left uncommitted for the external runner.Migration timestamp follow-up (2026-10-12):
20261012120000_checkin_monitorsto20261012133000_checkin_monitors; SQL is byte-for-byte unchanged. Updated the migration safety test path; no stale repository references remain.localhost:55434/ci): all 54 migrations deploy cleanly, with signup_funnel before checkin_monitors.vitest run --maxWorkers=4passed without changing tests or timeouts.pnpm lintandpnpm --filter api build(including TypeScript build check) pass;git diff --checkpasses.origin/developmigration/schema snapshot reports the same six differences. No check-in drift; unrelated migrations/schema left unchanged. Therefore a globally zero-drift result remains unfulfilled due to existing develop drift.