fix(constructs): treat null webhookSecret as unset in MSTeams codegen [ship] - #1423
Merged
Conversation
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
enabled auto-merge (squash)
July 27, 2026 13:30
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
MSTeamsAlertChannelCodegen.validateSafety()checkedconfig.webhookSecret !== undefined, so anullwebhookSecret (the shape real API responses use for "no secret configured") incorrectly threwImportSafetyViolation.checkly import plansilently fall back to a genericWebhookAlertChannelconstruct instead of the more readableMSTeamsAlertChannel, sinceWebhookAlertChannelCodegencatchesImportSafetyViolationand falls back.if (config.webhookSecret)), matching the existing, correct behavior in the siblingTelegramAlertChannelCodegenandIncidentioAlertChannelCodegen, and matching thewebhookSecret?: string | nulltype.Test plan
msteams-alert-channel-codegen.spec.tsasserting a resource withconfig.webhookSecret: nullgenerates aMSTeamsAlertChannelconstruct (not a fallback), mirroring the existingtelegram-alert-channel-codegen.spec.tspattern.ImportSafetyViolation) and passes after the fix.pnpm --filter checkly test— 131 test files / 1688 tests passing.🤖 Generated with Claude Code