feat(webhook): warn when URL pattern mismatches webhook class - #2688
Draft
zimeg wants to merge 4 commits into
Draft
feat(webhook): warn when URL pattern mismatches webhook class#2688zimeg wants to merge 4 commits into
zimeg wants to merge 4 commits into
Conversation
Add a logger to @slack/webhook that warns at construction time when: - IncomingWebhook receives a URL containing "/triggers/" - WebhookTrigger receives a URL containing "/services/" This helps catch misconfiguration that causes duplicate deliveries or hangs (see #654). Both classes now accept optional `logger` and `logLevel` options via their defaults/options argument. Refs: #654 Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>
🦋 Changeset detectedLatest commit: d33b86c The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #2688 +/- ##
==========================================
+ Coverage 89.11% 89.17% +0.05%
==========================================
Files 65 66 +1
Lines 10351 10398 +47
Branches 473 478 +5
==========================================
+ Hits 9224 9272 +48
+ Misses 1096 1095 -1
Partials 31 31
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
…ogger Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>
Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>
Co-Authored-By: Claude <svc-devxp-claude@slack-corp.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
@slack/webhook(@slack/loggeras a new dependency,>=4.0.0)IncomingWebhookwarns if the URL contains/triggers/(likely meant forWebhookTrigger)WebhookTriggerwarns if the URL contains/services/(likely meant forIncomingWebhook)loggerandlogLevelin their constructor optionshooks.slack.com,hooks.dev.slack.com, etc.)Motivation
Users upgrading to v4 of
slack-github-actionaccidentally usewebhook-type: webhook-triggerwith an incoming webhook URL (or vice versa), causing duplicate deliveries and hangs. This SDK-level warning catches the misconfiguration at construction time regardless of the consumer (GHA, custom scripts, etc.).Refs: slackapi/slack-github-action#654
Test plan
🤖 Generated with Claude Code