Skip to content

feat(write-back): update the code of every resource type, not only checks and groups [RED-997] - #1498

Open
sorccu wants to merge 2 commits into
simo/red-992-write-back-prop-coveragefrom
simo/red-997-write-back-resource-types
Open

sorccu wants to merge 2 commits into
simo/red-992-write-back-prop-coveragefrom
simo/red-997-write-back-resource-types

Conversation

@sorccu

@sorccu sorccu commented Sep 23, 2026 •

Copy link
Copy Markdown
Member

Stacked on #1497 (RED-992). Docs: checkly/docs#521.

Summary

The interactive checkly deploy write-back ("Update my code with the changes made in Checkly") rewrote checks and check groups only. Every other resource type was skipped with "updating the code is supported for checks and check groups only", although the plan already reports the deployed row and per-key changes for them. This adds a rule table for each:

  • Alert channels, every class. The props are flat in the code and nested under config on the wire, so each rule maps config/<key> onto the top-level prop; SMS and phone call rename number to phoneNumber, MS Teams and incident.io rename template to payload. A credential (url, apiKey, serviceKey, webhookSecret, header and query-parameter values) arrives blanked and flagged, so it is refused before or at the rule, never written. The channel type, the fixed webhook type and method of the webhook-based classes, and Telegram's packed template are refused with their own reason through refusing() rules (a companion with a refuse and no primary, now checked before the primary lookup).
  • Private locations, dashboards (customCSS refused as a stylesheet), status pages v2 (cards refused) and v3 (each theme colour under an existing themeColors.light/.dark), services, v3 components (configuration.* onto showHistoricalData/expandedByDefault; page and parent are references) and automation rules (coolDownWindowMinutes onto coolDownMinutes; page and components are references).
  • Maintenance windows: name, tags, the dates as new Date('<iso>') through a new date helper kind (the global Date needs no import; an existing new Date(…) or string is replaced, a variable is not), and repeatInterval, repeatUnit and repeatEndsAt as a group.

Every new props type is held at build time to its written list plus a reasoned left-out union, and the class-coverage spec now requires every concrete construct class to have rules or be excluded on purpose (abstract bases, fromId references, relations, Project).

Other changes

  • A written-together group is now also enforced at the candidate level: a member refused by the planner, or one the code changed, drops the rest of its group. Before, only a member the splicer refused did, so a heartbeat period or DNS name server could be written without its partner.

Limitations

  • A construct is looked for in the file the CLI was loading when it was created. A construct declared in a module several files import is attributed to the first importer, where the lookup fails; RED-982 (fix(constructs): attribute a construct to the file that declares it #1491) fixes the attribution independently.
  • A themeColors.light/.dark colour is added only when that object exists in the code; nested parents are not created.
  • Telegram's packed template and URL and incident.io's API-key header are not unpacked into their props.

🤖 Generated with Claude Code

sorccu and others added 2 commits September 23, 2026 16:45
…, windows and status pages [RED-997]

The interactive deploy write-back rewrote checks and check groups only;
every other resource type was skipped although the plan reports its
deployed row and per-key changes. Add a rule table for every alert
channel class (the flat props mapped from the wire's config, number and
template renamed onto phoneNumber and payload, the fixed webhook type and
method and Telegram's packed template refused by name), private
locations, dashboards (customCSS refused as a stylesheet), maintenance
windows (name, tags, and the repeat interval and unit as a group; the
dates follow), status pages v2 and v3 (each theme colour under an existing
light or dark object), services, v3 components and automation rules.

A credential arrives blanked and flagged, so it is refused before or at
the rule, never written. Every new props type is held at build time to
its written list plus a reasoned left-out union, and the spec now
requires every concrete construct class to have rules or be excluded on
purpose. A member of a written-together group that is refused, or that
the code changed, now drops the rest of its group at the candidate level
too, so a schedule is never half-written.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…RED-997]

The account reports startsAt, endsAt and repeatEndsAt as ISO strings; the
construct takes Date objects, which checkly import spells as
`new Date('<iso>')`. Add a `date` helper kind that builds that expression
with the codegen's own valueForDate (now shared with the import), needs
no import since Date is a global, replaces an existing `new Date(…)` or a
string, and refuses a variable or a file that binds Date to something of
its own. repeatEndsAt joins the repeat group, so the interval, unit and
end date are written together or not at all.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant