Skip to content

fix(constructs): treat null webhookSecret as unset in MSTeams codegen [ship] - #1423

Merged
thebiglabasky merged 3 commits into
mainfrom
claude/reverent-haslett-3a624a
Jul 27, 2026
Merged

fix(constructs): treat null webhookSecret as unset in MSTeams codegen [ship]#1423
thebiglabasky merged 3 commits into
mainfrom
claude/reverent-haslett-3a624a

Conversation

@thebiglabasky

Copy link
Copy Markdown
Contributor

Summary

  • MSTeamsAlertChannelCodegen.validateSafety() checked config.webhookSecret !== undefined, so a null webhookSecret (the shape real API responses use for "no secret configured") incorrectly threw ImportSafetyViolation.
  • This made checkly import plan silently fall back to a generic WebhookAlertChannel construct instead of the more readable MSTeamsAlertChannel, since WebhookAlertChannelCodegen catches ImportSafetyViolation and falls back.
  • Changed the check to a truthy check (if (config.webhookSecret)), matching the existing, correct behavior in the sibling TelegramAlertChannelCodegen and IncidentioAlertChannelCodegen, and matching the webhookSecret?: string | null type.

Test plan

  • Added msteams-alert-channel-codegen.spec.ts asserting a resource with config.webhookSecret: null generates a MSTeamsAlertChannel construct (not a fallback), mirroring the existing telegram-alert-channel-codegen.spec.ts pattern.
  • Confirmed the new test fails against the old code (thrown ImportSafetyViolation) and passes after the fix.
  • pnpm --filter checkly test — 131 test files / 1688 tests passing.

🤖 Generated with Claude Code

validateSafety() used `!== undefined`, which throws ImportSafetyViolation
for a null webhookSecret — the shape real API responses use for alert
channels with no secret configured. This made `checkly import` silently
fall back to a generic WebhookAlertChannel construct instead of the more
readable MSTeamsAlertChannel. Telegram and Incident.io already handle
this correctly with a truthy check.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@thebiglabasky thebiglabasky changed the title fix(constructs): treat null webhookSecret as unset in MSTeams codegen fix(constructs): treat null webhookSecret as unset in MSTeams codegen [ship] Jul 27, 2026
@thebiglabasky
thebiglabasky enabled auto-merge (squash) July 27, 2026 13:30

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Auto-approved: ship/show PR from a same-repo branch.

@thebiglabasky
thebiglabasky merged commit 15f9838 into main Jul 27, 2026
15 checks passed
@thebiglabasky
thebiglabasky deleted the claude/reverent-haslett-3a624a branch July 27, 2026 13:40
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