Repository navigation
feat(status-pages): status edge Worker and renderers - #1928
Conversation
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 15 minutes. View limit details
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
Rendering foundation packages/status-page/package.json, packages/status-page/src/fixtures.ts, packages/status-page/src/format.ts, packages/status-page/src/escape.ts, packages/status-page/src/document.ts, packages/status-page/src/select.ts, packages/status-page/src/styles.ts, packages/status-page/{bunfig.toml,tsconfig.json,vitest.config.ts} |
Adds shared formatting, escaping, document, selection, style, and fixture utilities, with package and test configuration. |
Status-page outputs packages/status-page/src/{badge.ts,feed.ts,json.ts,manage.ts,page.ts,index.ts,render.test.ts} |
Adds page and management-form renderers, JSON, SVG badge, and Atom feed output. Exports the APIs and adds rendering tests. |
Storage and snapshot loading apps/status/src/{ports.ts,storage.ts,resources.ts,snapshot.ts} |
Defines storage contracts and Cloudflare adapters. Loads snapshots and overlays through cache, KV, and R2, and loads heartbeat data. |
Request handling and break-glass updates apps/status/src/{responses.ts,handler.ts,break-glass.ts,handler.test.ts,test-support.ts} |
Adds response helpers and status routes. Implements rate-limited management requests, validates and stores break-glass updates, and adds handler tests and test utilities. |
Worker and development integration apps/status/src/worker.ts, alchemy.run.ts, packages/infra/src/dev-urls.ts, .oxlintrc.json, apps/status/{bunfig.toml,package.json,tsconfig.json,vitest.config.ts}, knip.json |
Adds the Cloudflare Worker and registers it with Alchemy and development tooling. Adds app package, lint, test, typecheck, and entry-point configuration. |
Estimated code review effort: 4 (Complex) | ~60 minutes
Change: Feature
Sequence Diagram(s)
sequenceDiagram
participant Client
participant StatusWorker
participant handleRequest
participant loadView
participant nativeStorage
participant KV
participant R2
Client->>StatusWorker: Send HTTP request
StatusWorker->>handleRequest: Pass request and StatusEnv
handleRequest->>loadView: Load status page view
loadView->>nativeStorage: Read snapshot, overlay, and heartbeat
nativeStorage->>KV: Read status data
nativeStorage->>R2: Read fallback objects
loadView-->>handleRequest: Return page view or no snapshot
handleRequest-->>StatusWorker: Return HTTP response
StatusWorker-->>Client: Send response
Possibly related PRs
- MapleTechLabs/maple#1927: Defines the snapshot and overlay contract used by this Worker.
- MapleTechLabs/maple#1938: Changes the shared renderer and snapshot theme contract used for Worker output.
- MapleTechLabs/maple#1932: Adds public status-page routes that connect to the
/s/{slug}route handled here.
Suggested reviewers: jeremyfunk
Merge Risk: 
Minimal · previous review 9428a
-
The status Worker’s request conversion and lookup behavior do not present a demonstrated merge blocker. Merge after normal checks.
Pre-merge checks: 
5
-
Full details: Docstring Coverage
-
Explanation
No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 0 functions across 27 files. (8 skipped: 8 unsupported.)
-
Finishing Touches
-
📝 Generate docstrings
-
- Commit to this branch
- Create a new PR
🧪 Generate unit tests (beta)
-
- Commit to this branch
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Comment @coderabbitai help to get the list of available commands.
This comment has been minimized.
This comment has been minimized.
0a05d19 to
38eb42c
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
e54d75a to
185f722
Compare
This comment has been minimized.
This comment has been minimized.
185f722 to
9428a5b
Compare
9428a5b to
9195ef9
Compare
This comment has been minimized.
This comment has been minimized.
…KV, R2 and cache @maple/status-page renders a page snapshot as server-side HTML, a statuspage.io-style status.json, a shields-style badge, an Atom feed and the break-glass form. All customer text is escaped, and a small inline script ages the "updated" text and delayed banner on cached copies. apps/status is a Worker that only reads edge storage: host or /s/<slug> resolution, then colo cache, KV, R2 and finally any cached copy. It merges the break-glass overlay and judges freshness from the publisher heartbeat. Break-glass posts are rate limited, checked against the token digest in constant time, validated and appended to the KV overlay. The KV namespace and R2 bucket live in apps/status/src/resources.ts for the publisher to bind. A lint override keeps backend, db, ORM and auth imports out of the Worker.
…slug fallback, capped form reads Adopt the new snapshot contract: heartbeat carries probesSeenAt, components are monitored, overlay entries live one per KV key and are listed (cached 10s per colo, capped at 50 keys). The manage form defaults status and impact to No change and rejects a status from the other lifecycle. Slug lookups fall back to R2, a lookup with KV and R2 both down is an uncached 503, form bodies are read with a 32 KB capped reader, and component ids are deduped.
…rouped by lifecycle, request span and trace export, regex-free feed base
9195ef9 to
b028783
Compare
This comment has been minimized.
This comment has been minimized.
…rvives, and uptime percent floors past float error
Maple review🟢 Confidence 8/10 · likely safe to merge. Held at 8 because earlier reviews of this pull request found 5 defects. The head fixes the overlay-cache race and the uptime floor, each pinned by a test that fails on the old code; the three info findings in untouched files still stand. It does not touch
Before merge
Still open from earlier reviews
Fixed since the last review
Production impactOpen errors in the changed files (2)
After this merges, Maple checks whether they stop.
|
|
Merged with 1 step from "Before merge" still open. If it is done, tick it on the review comment; if not, now is the time.
|
Maple: after this shipped✅ Shipped clean. Nothing this change touches got worse in the hour after it deployed. Deployed to Errors in the changed files:
Maple looks once, an hour after the first deploy that carries the merge. |
Customer status pages, 2/5: the status edge Worker and renderers
apps/statusis a new Worker that serves public status pages from edge storage alone. It has no Hyperdrive, no service bindings, no auth, no billing and no telemetry export, so a page keeps showing its last known state while the API, Postgres or AWS is down. An.oxlintrc.jsonoverride bans@maple/backend,@maple/db, effect-orm and the auth packages underapps/status/**.Read path
host:, falling back to R2hosts/);/s/<slug>(KVslug:, falling back to R2slugs/).A lookup that failed because the stores errored answers an uncached 503, never a cached 404. A renamed page only answers under its current slug.
Outputs: server-rendered HTML with no client framework and one nonce'd script for relative times;
status.json; a badge SVG; an Atom feed.Break-glass:
/_manageis a plain form. It checks a token against a SHA-256 published in the snapshot (constant-time compare), and has these limits:Each post is written once to its own KV key, so nothing rewrites a shared value. "No change" is the default for status and impact on follow-ups, and a status from the other lifecycle (incident vs maintenance) is a 400.
packages/status-pageholds the renderers, and will also feed the editor preview.Tests
apps/status,vitest run, 29 passed. Covers:packages/status-page,vitest run, 15 passed. Covers escaping of hostile text, URLs and colours, bars and uptime, incident sections,status.jsonindicators, the badge and the feed.no-restricted-importserrors, then the file was deleted.Stack: #1927 → #1928 → #1929 → #1930.
🤖 Generated with Claude Code
Summary by CodeRabbit