chore: refresh OpenAPI spec + managedBy on RG/SP/AlertChannel#33
Merged
chore: refresh OpenAPI spec + managedBy on RG/SP/AlertChannel#33
Conversation
mono#369 added `managedBy` to Create/Update Request DTOs for ResourceGroup, StatusPage, and AlertChannel (it was already on Monitor), and added `currentStatus` to MonitorDto. After the spec_updated dispatch post-merge, the bundled CLI spec was stale and several spec-check tests broke. Changes: * Refresh `docs/openapi/monitoring-api.json` from the live mono spec. * Regenerate `src/lib/api.generated.ts`, `api-zod.generated.ts`, `spec-facts.generated.ts`, and `descriptions.generated.ts`; refresh the generated skill field references. * Inject `managedBy: 'CLI'` in the YAML transforms for AlertChannel, ResourceGroup, and StatusPage so resources created via `devhelm apply` get correct attribution. Mirrors the existing Monitor transform. * Add `managedBy` to `API_ONLY_FIELDS` for alertChannel, resourceGroup, and statusPage in the field-parity test — the CLI sets it internally, it is not a YAML-authored field. * Update `monitors test --config` malformed-config test: the previous bad fixture relied on `managedBy` being a required field, which it no longer is. Pivot to omitting the still-required `name` field so the Zod parse still produces a stable, typed validation error. This unblocks the spec-check workflow on `main` and clears the way for v0.7.1, which also fixes the v0.7.0 `resource-groups list` bug (strict Zod schema rejected the now-present `managedBy` response field). Co-authored-by: Cursor <cursoragent@cursor.com>
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
After
mono#369merged and dispatchedspec_updated, the CLI'sspec-check(and downstreamnpm test) ran red because:managedByonCreate*/Update*DTOs forResourceGroup,StatusPage, andAlertChannel(added for attribution parity withMonitor); missingcurrentStatusonMonitorDto.field-parityaudit (test/yaml/spec-field-parity.test.ts) saw the newmanagedByAPI field with no entry inAPI_ONLY_FIELDSfor those three resource families and failed the audit.test/commands/monitors-test-config.test.tsdeliberately omittedmanagedByto trigger a Zod error; that field is now optional (server defaults toAPI/ surface-injected value), so the assertionexpect(out).toContain('managedBy')no longer matched the actual error.This PR fixes the immediate spec-check breakage and the v0.7.0
resource-groups listbug that started this whole sprint (strict Zod was rejecting the production API's newmanagedByresponse field).Changes
docs/openapi/monitoring-api.jsonfrom the live mono spec.src/lib/api.generated.ts,api-zod.generated.ts,spec-facts.generated.ts,descriptions.generated.ts, and the skill field references.managedBy: 'CLI'in YAML transforms for AlertChannel, ResourceGroup, and StatusPage so resources created viadevhelm applyget correct attribution. Mirrors the existingMonitortransform pattern; the snapshot diffs already excludemanagedByso we don't fight the dashboard on subsequent updates.managedBytoAPI_ONLY_FIELDSforalertChannel,resourceGroup, andstatusPagein the field-parity test — the CLI sets it internally and YAML users must not author it.namefield so we keep a stable, typed Zod error path.Why managedBy on those three resources is API-only (not YAML)
managedBy is a provenance signal owned by the surface, not declarative state authored by the user. If a YAML config drops the field, the CLI should still stamp CLI; if the user explicitly wrote managedBy: TERRAFORM we would want to reject it because YAML files belong to the CLI. Marking it API-only enforces that contract.
Test plan
Made with Cursor