Sitelet https://github.com/simstudioai/sim/pull/6873
Skip to content

feat(slack): launch v2 triggers and backfill custom bots - #6873

Merged
TheodoreSpeaks merged 9 commits into
stagingfrom
feat/migrate-slack-ff
Aug 25, 2026
Merged

feat(slack): launch v2 triggers and backfill custom bots#6873
TheodoreSpeaks merged 9 commits into
stagingfrom
feat/migrate-slack-ff

Conversation

@TheodoreSpeaks

Copy link
Copy Markdown
Collaborator

Summary

  • launch Slack v2 with custom-bot triggers and gate native OAuth behind the existing extended-scopes environment setting
  • backfill legacy Slack credentials while preserving existing webhook URLs through credential-based fan-out
  • add bounded, idempotent migration behavior and focused webhook coverage

Type of Change

  • Feature

Testing

  • 245 focused Vitest tests
  • Sim and DB type-checks
  • full lint and 29 repository audits
  • local migration dry run

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

@vercel

vercel Bot commented Aug 19, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
docs Skipped Skipped Aug 25, 2026 8:58am

Request Review

@cursor

cursor Bot commented Aug 19, 2026

Copy link
Copy Markdown

PR Summary

High Risk
Touches Slack webhook authentication, credential storage, and a live data migration that rewrites bot secrets and routing. Failures here can drop or duplicate event delivery.

Overview
Releases slack_v2 as the default Slack block and trigger. The legacy block stays executable but hidden. Custom bots are generally available; the native Sim Slack app trigger is gated by SLACK_EXTENDED_SCOPES / NEXT_PUBLIC_SLACK_EXTENDED_SCOPES. Action-only bots may omit a signing secret; event ingest still requires one.

Migrates pasted bot tokens into reusable slack-custom-bot credentials via a dry-run-then-live script. Legacy webhook URLs are preserved: migrated rows are marked ingressMode: legacy_custom_bot and fan out by credential routing key instead of duplicating secrets. Path lookup now authenticates those aliases through the custom-bot ingress path, with bounded fan-out and fail-fast on partial markers.

Webhook lookup also caps targets per path/routing key. Docs and integration availability now treat Slack as slack_v2 with the redesigned event trigger.

Reviewed by Cursor Bugbot for commit 5f2a0bb. Bugbot is set up for automated code reviews on this repo. Configure here.

@greptile-apps

greptile-apps Bot commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

The PR launches the Slack v2 trigger, adds reusable custom-bot ingress and legacy credential backfill, and gates native Slack OAuth triggers behind extended scopes.

  • Routes native and custom-bot events through shared bounded fan-out and acknowledgment handling.
  • Migrates legacy Slack trigger credentials while preserving existing webhook paths.
  • Aligns Slack block metadata, credential selection, deployment configuration, documentation, and tests.

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains; the previously reported Slack acknowledgment and retry issues are resolved across native, custom-bot, and migrated legacy ingress paths.

Important Files Changed

Filename Overview
apps/sim/lib/webhooks/slack-dispatch.ts Centralizes bounded Slack fan-out and consistently reduces dispatch outcomes into acknowledgment or retry responses.
apps/sim/app/api/webhooks/trigger/[path]/route.ts Adds credential-based handling for migrated legacy Slack webhook paths while preserving direct webhook delivery.
apps/sim/app/api/webhooks/slack/custom/[credentialId]/route.ts Delegates custom-bot verification and dispatch to shared ingress helpers and returns the reduced dispatch result.
apps/sim/lib/webhooks/slack-custom-ingress.ts Implements reusable custom-bot credential verification, routing-key lookup, and dispatch.
packages/db/scripts/migrate-slack-custom-bots.ts Adds bounded, resumable migration behavior for legacy Slack custom-bot credentials and webhook routing metadata.
apps/sim/lib/webhooks/providers/slack.ts Makes queue-admission failures retryable by returning a non-success provider response.
apps/sim/blocks/blocks/slack.ts Releases the Slack v2 block and aligns its trigger and authentication metadata.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart LR
  S[Slack delivery] --> I{Ingress}
  I -->|Native app| N[Team-based lookup]
  I -->|Custom bot| C[Credential-based lookup]
  I -->|Migrated legacy URL| L[Verify credential aliases]
  N --> F[Bounded webhook fan-out]
  C --> F
  L --> F
  F --> R{Dispatch results}
  R -->|Queued or intentionally ignored| A[HTTP 200 acknowledgment]
  R -->|All targets fail| E[Non-2xx retry response]
Loading

Reviews (7): Last reviewed commit: "fix(slack): retry failed webhook deliver..." | Re-trigger Greptile

Comment thread apps/sim/app/api/webhooks/trigger/[path]/route.ts Outdated
Comment thread apps/sim/app/api/webhooks/trigger/[path]/route.ts
@TheodoreSpeaks

Copy link
Copy Markdown
Collaborator Author

@greptile

@TheodoreSpeaks

Copy link
Copy Markdown
Collaborator Author

@cursor review

Comment thread apps/sim/app/api/webhooks/slack/custom/[credentialId]/route.ts Outdated
Comment thread apps/sim/app/api/webhooks/trigger/[path]/route.ts Outdated
Comment thread packages/db/scripts/migrate-slack-custom-bots.ts
Comment thread apps/sim/app/api/webhooks/trigger/[path]/route.ts
@TheodoreSpeaks

Copy link
Copy Markdown
Collaborator Author

@greptile

@TheodoreSpeaks

Copy link
Copy Markdown
Collaborator Author

@cursor review

Comment thread apps/sim/app/api/webhooks/slack/custom/[credentialId]/route.ts Outdated

@cursor cursor 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.

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit 8c78e18. Configure here.

@TheodoreSpeaks

Copy link
Copy Markdown
Collaborator Author

@greptile

@TheodoreSpeaks

Copy link
Copy Markdown
Collaborator Author

@cursor review

@cursor cursor 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.

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit 12513cb. Configure here.

@cursor cursor 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.

Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 5f2a0bb. Configure here.

Comment thread apps/sim/lib/webhooks/deploy.ts
@TheodoreSpeaks

Copy link
Copy Markdown
Collaborator Author

@greptile

@TheodoreSpeaks

Copy link
Copy Markdown
Collaborator Author

@cursor review

@cursor

cursor Bot commented Aug 25, 2026

Copy link
Copy Markdown

Skipping Bugbot: Bugbot is disabled for this repository. Visit the Bugbot dashboard to update your settings.

Comment thread apps/sim/app/api/webhooks/slack/custom/[credentialId]/route.ts Outdated
@TheodoreSpeaks

Copy link
Copy Markdown
Collaborator Author

@greptile

@TheodoreSpeaks

Copy link
Copy Markdown
Collaborator Author

@cursor review

@cursor

cursor Bot commented Aug 25, 2026

Copy link
Copy Markdown

Skipping Bugbot: Bugbot is disabled for this repository. Visit the Bugbot dashboard to update your settings.

Comment thread apps/sim/app/api/webhooks/slack/custom/[credentialId]/route.ts Outdated
@TheodoreSpeaks

Copy link
Copy Markdown
Collaborator Author

@greptile

@TheodoreSpeaks

Copy link
Copy Markdown
Collaborator Author

@cursor review

@cursor

cursor Bot commented Aug 25, 2026

Copy link
Copy Markdown

Skipping Bugbot: Bugbot is disabled for this repository. Visit the Bugbot dashboard to update your settings.

@TheodoreSpeaks
TheodoreSpeaks merged commit 4c0bd94 into staging Aug 25, 2026
29 checks passed
@TheodoreSpeaks
TheodoreSpeaks deleted the feat/migrate-slack-ff branch August 25, 2026 18:11
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