Skip to content

fix(yaml): exclude managedBy from ResourceGroupSnapshot#29

Merged
caballeto merged 1 commit intomainfrom
fix/exclude-managed-by-from-snapshots
May 5, 2026
Merged

fix(yaml): exclude managedBy from ResourceGroupSnapshot#29
caballeto merged 1 commit intomainfrom
fix/exclude-managed-by-from-snapshots

Conversation

@caballeto
Copy link
Copy Markdown
Contributor

Summary

Mirrors the existing pattern used for MonitorSnapshotmanagedBy is a mutation signal (provenance), not declarative state, and should not participate in snapshot diffs.

Why now

Pre-emptive change for devhelmhq/mono#362, which adds managedBy to AlertChannel/StatusPage/ResourceGroup DTOs (and their Create/Update request bodies).

When that PR's spec is regenerated by the CLI (scripts/regen-from.sh), the new managedBy property appears on Schemas['UpdateResourceGroupRequest'], which makes Required<Schemas['UpdateResourceGroupRequest']> require managedBy: ... everywhere — including in toDesiredSnapshot / toCurrentSnapshot, which (correctly) don't populate it.

Result: the mono PR's Evolution Harness fails the CLI surface with TS2322:

src/lib/yaml/handlers.ts(637,43): error TS2322:
  Type '{ name; description; ... 6 more ...; recoveryCooldownMinutes; }'
  is not assignable to type 'ResourceGroupSnapshot'.

This change exempts managedBy from the Required<> projection so the snapshot type stays declarative-state-only, exactly like the Monitor handler does at line 693.

Test plan

  • npm run typecheck — passes
  • npm run build — passes (manifest still generates correctly)
  • Spec evolution harness on the linked mono PR turns green once both land

Made with Cursor

Mirrors the existing pattern used for MonitorSnapshot — `managedBy`
is a mutation signal (provenance), not declarative state, and should
not participate in snapshot diffs.

Pre-emptive: required when the API exposes `managedBy` on
UpdateResourceGroupRequest (devhelmhq/mono#362). Without this, the
CLI's regen-from-spec build fails with TS2322 because
toDesiredSnapshot/toCurrentSnapshot don't (and shouldn't) populate
the new field.

Co-authored-by: Cursor <cursoragent@cursor.com>
@caballeto caballeto merged commit 6ed1d07 into main May 5, 2026
3 checks passed
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