Skip to content

fix(alert-channels): accept --config for all 20 channel types#47

Merged
caballeto merged 1 commit into
mainfrom
fix/alert-channel-config-all-types
Jun 11, 2026
Merged

fix(alert-channels): accept --config for all 20 channel types#47
caballeto merged 1 commit into
mainfrom
fix/alert-channel-config-all-types

Conversation

@caballeto

Copy link
Copy Markdown
Member

Summary

The --config flag on alert-channels create/update rejected 13 of 20 channel types with "Unknown channelType" because ALERT_CHANNEL_CONFIG_SCHEMAS was a stale 7-entry hand-maintained map. The CLI's own generated Zod schemas already defined all 20.

Fix: Both stale maps (CLI --config path + YAML apply path) are now derived from the generated OpenAPI Zod schemas, keyed by each variant's channelType literal. They can never drift again — new channel types appear automatically after pnpm sync-schema.

Also closed a worse bug in the YAML path: unmapped types previously skipped all field-level validation via an escape hatch.

Test plan

  • npm run typecheck passes
  • npm run lint passes
  • npm test — 1053 tests passed
  • Drift-guard tests assert both maps cover every CHANNEL_TYPES entry
  • Previously-rejected types (telegram, datadog, etc.) now accepted

Made with Cursor

The ALERT_CHANNEL_CONFIG_SCHEMAS map (and the YAML CHANNEL_CONFIG_SCHEMAS
map) covered only 7 of the 20 channel types, so --config for the other 13
(telegram, google_chat, pushover, mattermost, splunk_oncall, pushbullet,
linear, incident_io, rootly, zapier, datadog, jira, gitlab) was rejected
with "Unknown channelType" on the CLI path and silently skipped deep
validation on the YAML path.

Both maps are now derived from the generated OpenAPI Zod schemas (the
source of truth), keyed by each variant's channelType literal, so they
can never drift from the API again. Adds drift-guard tests asserting the
maps cover every entry in CHANNEL_TYPES.

Co-authored-by: Cursor <cursoragent@cursor.com>
@caballeto caballeto merged commit 0d74d26 into main Jun 11, 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