feat(cli): add StatusPageV3, StatusPageV3Component and StatusPageV3AutomationRule constructs [RED-00] - #1452
Open
tnolet wants to merge 6 commits into
Open
feat(cli): add StatusPageV3, StatusPageV3Component and StatusPageV3AutomationRule constructs [RED-00]#1452tnolet wants to merge 6 commits into
tnolet wants to merge 6 commits into
Conversation
…tomationRule constructs Constructs for components-based (v3) status pages. The page reuses the status-page resource type with a version: 3 discriminator; components point at their page (and optional parent GROUP), automation rules at the page and the components they impact. Client-side diagnostics cover the parent-must-be- a-GROUP / same-page rules and the tag requirement. Import/codegen for the three types is a follow-up, so the reference example is inlined rather than generated. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014WTgyksVAQY5jpD2fb3rYL
…tion rules `checkly import` now generates the v3 constructs. The `status-page` resource type is shared by both generations; `StatusPageCodegen` dispatches on the payload's `version` to the new `StatusPageV3Codegen`. Components and automation rules get their own codegens and resource types (`status-page-component`, `status-page-automation-rule`), with page and parent references resolved to imported variables, friend exports already declared in the project, or `fromId()` as a fallback. `status-page` and `status-page-component` become friend types so a component or rule can attach to a page declared in code. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014WTgyksVAQY5jpD2fb3rYL
Member
|
I might have missed this during a quick scroll through so sorry if already covered but: Could you add the Also, Windows tests are failing and it looks like a real failure, though it seems odd. Re-run to confirm it's not flaky, and if it remains fix the tests please. |
Member
Author
|
Will do later today. Hopefully tomorrow we can merge it |
… passes on Windows `path.relative` yields backslash-separated paths on Windows, so the `sources['resources/status-pages/...']` lookups returned undefined. The generated import paths were already POSIX; only the spec's keys were not. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014WTgyksVAQY5jpD2fb3rYL
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.
Affected Components
None AI notes
I tested this locally and it all seems to work as described: the constructs, the import / export / codegen etc.
This can live next to current status pages till we actively deprecate them. Backend and frontend have already been pushed.
Notes for the Reviewer
Monitoring-as-code for v3 (components-based) status pages. Backend side: checkly/monorepo#3846 (mapping tables, merged) and checkly/monorepo#3852 (resource types, node classes, public API).
Three constructs, exported from
checkly/constructs:StatusPageV3— samestatus-pagetype key asStatusPage, discriminated byversion: 3in the payload (theCheckGroupV2precedent). Nocards; carries the v3 page settings (description,logoDark,privacyPolicyLink,termsOfServiceLink,footerText,googleAnalyticsTag,allowIndexing).StatusPageV3.fromId()lets components/rules attach to a page created in the UI.StatusPageV3Component(status-page-component) —{ statusPage, type: 'SERVICE' | 'GROUP', name, description?, hidden?, displayOrder, parent? }. The component points at its page (the backend needs the page first; the deploy DAG resolves the ref). Validation:parentmust be a GROUP on the same page.StatusPageV3AutomationRule(status-page-automation-rule) — tags-scoped rule opening one incident on the listed components;coolDownMinutesmaps to the backend'scoolDownWindowMinutes. Validation: at least one tag, noOPERATIONALimpact, components on the same page.Registered in
Resources/Project.data, the deploy payload order (services, pages, components, rules, …), the deploy pretty-names, and the AI-context reference (example inlined). A logical id deployed asStatusPagecannot be redeployed asStatusPageV3— the backend rejects it with a clear message rather than silently switching generations.Deliberately not in this PR:
construct-codegen/import plansupport for the three types (the backend import plan does not emit them yet, so nothing breaks), which is why the reference example is hand-written instead of generated intogen/.Testing
src/constructs/__tests__/status-page-v3.spec.ts: synthesized payloads (version: 3,{ ref }values,coolDownWindowMinutes), duplicate-logicalId diagnostic,fromId()UUID validation, parent-not-a-GROUP / other-page / empty-tags diagnostics.pnpm run test:types, eslint andtscclean;prepare:ai-contextruns.route-deploy-status-pages-v3integration spec (same payload the constructs synthesize).🤖 Generated with Claude Code
https://claude.ai/code/session_014WTgyksVAQY5jpD2fb3rYL
Import / codegen (added)
checkly importnow generates these constructs:StatusPageCodegendispatches on the payloadversionto a newStatusPageV3Codegen; components and automation rules have their own codegens and importable resource types (status-page-component,status-page-automation-rule), with page/parent references resolved to imported variables, friend exports, orfromId(). Backend side (import plan emitting v3 pages, components and rules, with single-page cascade): checkly/monorepo#3893.