Skip to content

feat: post webhooks via the @slack/webhook SDK with action-side retries#630

Draft
zimeg wants to merge 8 commits into
mainfrom
webhook-trigger-sdk
Draft

feat: post webhooks via the @slack/webhook SDK with action-side retries#630
zimeg wants to merge 8 commits into
mainfrom
webhook-trigger-sdk

Conversation

@zimeg

@zimeg zimeg commented Jun 30, 2026

Copy link
Copy Markdown
Member

Summary

Converts both webhook techniques to the @slack/webhook SDK and removes axios / axios-retry as direct dependencies of the action:

  • incoming-webhookIncomingWebhook class
  • webhook-triggerWebhookTrigger class

Retry behavior (0 / 5 / 10 / RAPID) and HTTPS proxy support are preserved, so this is not a regression. Since the webhook SDK classes don't accept a retryConfig (unlike WebClient), retries run in the action via p-retry, reusing @slack/web-api's named retry policies. Non-retryable responses (4xx other than 429) abort immediately; request errors and 5xx/429 are retried.

src/config.js no longer owns an axios client or builds the webhook User-Agent — the SDKs set their own. The action still registers app metadata with @slack/web-api.

⚠️ Before merge

  • @slack/webhook is pinned to a local file:../node-slack-sdk/packages/webhook path for development. It MUST be swapped to a published version (one that exports WebhookTrigger) before this merges.

Notes

  • No @slack/web-api version bump in this PR; client.js (the API-method technique) is unchanged and still uses @slack/web-api@7 (axios transitively).
  • dist/ is rebuilt as part of release, not committed here.

Requirements

🤖 Generated with Claude Code

zimeg and others added 6 commits June 30, 2026 04:02
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>
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>
@zimeg zimeg added enhancement New feature or request javascript Pull requests that update Javascript code semver:minor tests labels Jun 30, 2026
@changeset-bot

changeset-bot Bot commented Jun 30, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 08d6c7a

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Retries now live in the @slack/webhook package via retryConfig, matching
how the API-method technique passes retryConfig to @slack/web-api. The
action maps its 0/5/10/RAPID input to the SDK's exported retry policies.

Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>
@zimeg

zimeg commented Jul 2, 2026

Copy link
Copy Markdown
Member Author

Retries now live upstream in @slack/webhook (node-slack-sdk branch eden/webhook-retries, off the WWFB eden/webhook-trigger WIP) rather than in the action.

  • Both IncomingWebhook and WebhookTrigger now accept a retryConfig?: RetryOptions option (mirroring @slack/web-api's WebClient), defaulting to no retries (opt-in).
  • The webhook package re-exports the same named policies (fiveRetriesInFiveMinutes, tenRetriesInAboutThirtyMinutes, rapidRetryPolicy).
  • Retry conditions match transient failures: 429 + 5xx retry, other 4xx abort, network errors retry.

This PR now just passes retryConfig through to the SDK constructors and maps 0/5/10/RAPID to the exported policies — no action-side p-retry wrapper. Pre-merge gate is unchanged: swap the file: link for a published @slack/webhook that includes these retry policies.

Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request javascript Pull requests that update Javascript code semver:minor tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant