Skip to content

feat(integrations): Add API driven pipeline for Slack#112315

Merged
evanpurkhiser merged 1 commit intomasterfrom
evanpurkhiser/feat-integrations-add-api-driven-pipeline-for-slack
Apr 7, 2026
Merged

feat(integrations): Add API driven pipeline for Slack#112315
evanpurkhiser merged 1 commit intomasterfrom
evanpurkhiser/feat-integrations-add-api-driven-pipeline-for-slack

Conversation

@evanpurkhiser
Copy link
Copy Markdown
Member

@evanpurkhiser evanpurkhiser commented Apr 6, 2026

Implement get_pipeline_api_steps() on SlackIntegrationProvider using a single OAuth2 step with Slack's user_scope parameter. Refactors OAuth2Provider.get_pipeline_api_steps() to expose make_oauth_api_step() so providers can customize step parameters (like extra_authorize_params). Updates build_integration() to handle both legacy state["identity"]["data"] and new state["oauth_data"] paths.

Ref VDY-42

@evanpurkhiser evanpurkhiser requested review from a team as code owners April 6, 2026 23:04
@evanpurkhiser evanpurkhiser requested review from a team and removed request for a team April 6, 2026 23:04
@linear-code
Copy link
Copy Markdown

linear-code bot commented Apr 6, 2026

@github-actions github-actions bot added the Scope: Backend Automatically applied to PRs that change backend components label Apr 6, 2026
Comment thread src/sentry/integrations/slack/integration.py Outdated
Comment thread src/sentry/integrations/slack/integration.py Outdated
Comment thread src/sentry/integrations/slack/integration.py
@evanpurkhiser evanpurkhiser force-pushed the evanpurkhiser/feat-integrations-add-api-driven-pipeline-for-slack branch from 52cf128 to 647c4e0 Compare April 7, 2026 15:23
Comment thread src/sentry/integrations/slack/integration.py Outdated
Copy link
Copy Markdown
Contributor

@cursor cursor bot left a comment

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 and found 2 potential issues.

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 647c4e0. Configure here.

Comment thread src/sentry/integrations/slack/integration.py
if "oauth_data" in state:
data = state["oauth_data"]
else:
data = state["identity"]["data"]
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Slack API errors bypass validation causing unhandled assertion

Medium Severity

The new API pipeline path for Slack integration setup doesn't validate Slack's OAuth response body for application-level errors. Slack's oauth.v2.access endpoint returns HTTP 200 even for errors, signaling them with ok: false. This leads to an unhandled AssertionError (500) in build_integration when assert data["ok"] is hit, instead of a user-friendly error.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 647c4e0. Configure here.

@evanpurkhiser evanpurkhiser force-pushed the evanpurkhiser/feat-integrations-add-api-driven-pipeline-for-slack branch from 647c4e0 to 33632d9 Compare April 7, 2026 17:54
Implement `get_pipeline_api_steps()` on `SlackIntegrationProvider` using a
single OAuth2 step with Slack's `user_scope` parameter. Refactors
`OAuth2Provider.get_pipeline_api_steps()` to expose `make_oauth_api_step()`
so providers can customize step parameters (like extra_authorize_params).
Updates `build_integration()` to handle both legacy `state["identity"]["data"]`
and new `state["oauth_data"]` paths.

Ref [VDY-42](https://linear.app/getsentry/issue/VDY-42/slack-api-driven-integration-setup)
@evanpurkhiser evanpurkhiser force-pushed the evanpurkhiser/feat-integrations-add-api-driven-pipeline-for-slack branch from 33632d9 to 8b07e1f Compare April 7, 2026 18:43
Copy link
Copy Markdown
Member

@leeandher leeandher left a comment

Choose a reason for hiding this comment

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

looks good! thanks for sharing the code between staging and prod slack where possible 🙏

@evanpurkhiser evanpurkhiser merged commit 1dce908 into master Apr 7, 2026
60 checks passed
@evanpurkhiser evanpurkhiser deleted the evanpurkhiser/feat-integrations-add-api-driven-pipeline-for-slack branch April 7, 2026 18:54
george-sentry pushed a commit that referenced this pull request Apr 9, 2026
Implement `get_pipeline_api_steps()` on `SlackIntegrationProvider` using
a single OAuth2 step with Slack's `user_scope` parameter. Refactors
`OAuth2Provider.get_pipeline_api_steps()` to expose
`make_oauth_api_step()` so providers can customize step parameters (like
extra_authorize_params). Updates `build_integration()` to handle both
legacy `state["identity"]["data"]` and new `state["oauth_data"]` paths.

Ref
[VDY-42](https://linear.app/getsentry/issue/VDY-42/slack-api-driven-integration-setup)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Backend Automatically applied to PRs that change backend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants