Repository navigation
Release 0.8.36: hotfix coverage probe uses direct S3 - #634
Merged
Merged
Conversation
…#630) * fix(admin): probe summary.json directly from S3 (not via self-Worker) Discovered on first post-deploy smoke of /admin/summary/coverage: all 130 published versions classified as kind: error, status: 522 (Cloudflare 'origin connection timed out'). Direct curl to the same data.nemar.org/<id>/<v>/summary.json URL from outside returned 200 in ~730ms. The 522 only happens when the call originates inside the Worker. Root cause: probeSummary used globalThis.fetch against data.nemar.org/<id>/<v>/summary.json, but that URL is served by the SAME Worker that hosts /admin/summary/coverage. Fanning out 8 concurrent × 130 ids triggers Worker-to-Worker subrequest behavior that 522s under load. Cross-component code-reviewer flagged this as 'option c' on PR #623 (the cleaner alternative to the cache-bust fix we shipped at the time); the bill came due on first prod run. Fix: refactor probeSummary to read S3 directly via loadSummary() — the same code path Phase 3's page-bundle service uses for its summary fan-in. Bypasses CF + the self-call entirely, so no subrequest limit and no 24h s-maxage to cache-bust around. Wiring: introduce SummaryFetcher type + defaultSummaryFetcher(env) builder, and dependency-inject the fetcher into probeSummary / buildCoverageReport. Tests stub the fetcher directly instead of swapping globalThis.fetch. Tests: 11 unit tests cover the schema classifier (ok / stale / forward-compat 1.2 / forward-compat 2.0 / missing / error / malformed JSON / empty schema_version / missing key / non-string schema / fetcher-args wire contract). Backend typecheck clean. * review(#630): hang-protection timeout, default-arg fix, ordering + totals tests
This branch was previously deployed
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.
Summary
Hotfix release on top of 0.8.35. Single fix:
GET /admin/summary/coveragewas returning HTTP 522 for every published version becauseprobeSummaryfetcheddata.nemar.org/<id>/<v>/summary.json— the same Worker hosting/admin/*. Self-fan-out × 8 concurrent × 130 ids → Cloudflare Worker-to-Worker subrequest timeout. Fix: read S3 directly vialoadSummary(), same code path Phase 3's page-bundle uses.Closes the post-deploy-smoke incident found right after 0.8.35 shipped. Without this, the backfill flow (
nemar admin summary check --fix) is blocked.Included
probeSummaryto direct-S3 read via dep-injectedSummaryFetcher; add 8s per-probe timeout against hang; tests rewritten for the new pattern (14 unit tests).Companion follow-ups (filed, not blocking)
kind: "corrupt"for invalid summary.json JSON #631 — distinctkind: "corrupt"for invalid summary.json JSON (currently indistinguishable from "missing schema_version")error_kinddiscriminator instead of overloadedstatus: 0so the cron's majority_errored escalation only fires on permanent failuress3OptionsFromEnvhelper (DRY across 3 services) + plumbAbortSignalthroughloadSummaryTest plan
bun test test/manifest-coverage.unit.test.ts)/admin/summary/coverage; expect 0 errors, ~130 stale (every existing summary is schema 1.0 until backfill runs)nemar admin summary check --match 'on*' --fix --yes→ monitor →--match 'nm*' --fix --yesMerge strategy
Regular merge per project rule.