Watch mainnet separately from testnet in the uptime checker - #179
Conversation
|
@collinsezedike Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
|
@collinsezedike is attempting to deploy a commit to the determined's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
Reviewed and merged as-is — no changes needed. You flagged that you had not run the full gate this pass. Ran it: I exercised the exported logic directly rather than trusting the description, because the back-compat and fail-safe claims are the whole risk surface:
One property worth stating for the record, since it is the issues actual thesis: if nobody sets Leaving the cron schedule disabled and the real URL unset was right; both are owner decisions. |
What
scripts/uptime-check.mjsonly ever checked one API/web pair, hardcoded to the testnet deploy.render.mainnet.yamlstands up a separatequay-api-mainnetservice that nothing pings — after cutover, the service that actually moves money could be down with no automated signal at all, while the existing checker keeps reporting a green testnet nobody is paying through.Closes #162
How
scripts/uptime-check.mjsnow builds a list of environments (buildEnvironments) instead of one hardcoded pair. Testnet keeps its exact original defaults, env var names, and unprefixed target ids (api/web/synthetic) — zero migration for existingdocs/uptime-state.jsonhistory or the README's badge files. Mainnet has no URL default of any kind: it's only checked onceUPTIME_MAINNET_API_URLis actually configured, and its targets are prefixed (mainnet-api, etc.) so they get their own history series and can't collide with testnet's.docs/STATUS.mdis now grouped by environment (## Testnet,## Mainnet, each with its own### API/### Web dashboard/### Create-link (synthetic)subsections) — a section only appears once that environment has actually been checked."Mainnet — API"), which flows straight through to the auto-filed incident title (🔴 Uptime: Mainnet — API is down) with no workflow-side change needed..github/workflows/uptime.ymlpasses the newUPTIME_MAINNET_API_URL/UPTIME_MAINNET_WEB_URL/UPTIME_MAINNET_SYNTHETIC_CHECKthrough from repo Variables (plain hostnames, not secrets)./linkscheck defaults off even once the API URL is set — it would write a throwaway row into the real production database on every successful run, andPOST /linkshas no scoped-credential story yet (issue 8.9 - The synthetic create-link check has 401'd since seller auth landed #163). Documented as an explicit opt-in.docs/RUNBOOK.mddocumenting exactly which variables activate mainnet watching.buildEnvironments,buildTargets,renderStatusMd,recordResult,uptimePct) behind anisCliInvocation()guard, matching the existing pattern inscripts/db-backup.ts— no more side effects on import, so it's actually testable.Deliberately out of scope, per
TODO.md§5's own delegation for this issue: I did not set a realUPTIME_MAINNET_API_URL, and did not re-enable the disabled cron schedule inuptime.yml. Both need real infrastructure/judgement only the repo owner has.Test plan
scripts/uptime-check.test.ts(pnpm test:scripts) — covers testnet's back-compat defaults/ids, mainnet's no-default/opt-in behavior, target id prefixing and label formatting, andrenderStatusMd's per-environment grouping (including that an unconfigured/unchecked environment produces no section).pnpm test:scripts— my new file passes in full (18/18). Unrelated:scripts/db-backup-restore.test.tsfails locally on Windows withEBUSY: resource busy or lockedon temp-file cleanup — a pre-existing environment issue on this file I didn't touch, not a regression from this change.pnpm typecheck/pnpm test/pnpm buildacross the workspace — this PR touches no workspace package source (scripts/, one workflow YAML, one doc), so none of the affected packages' build graphs changed. Flagging this explicitly rather than claiming a full green I didn't re-verify this round; happy to run it if you'd like it confirmed before merge.