Skip to content

fix(seer-slack): use feature flag for extended slack scopes#112102

Merged
alexsohn1126 merged 19 commits into
masterfrom
alexsohn/use-feature-flag-for-extended-slack-scopes
Apr 2, 2026
Merged

fix(seer-slack): use feature flag for extended slack scopes#112102
alexsohn1126 merged 19 commits into
masterfrom
alexsohn/use-feature-flag-for-extended-slack-scopes

Conversation

@alexsohn1126
Copy link
Copy Markdown
Member

Previously, we only used an option to decide whether the extended slack scopes should be used or not.

This had a couple of problems:

  • No org-level control. If one org wants to try out extended scopes, all of Sentry would need to enable extended scopes which leads to:
  • Extra scope requested for the not-updated prod Slack app. If we request more scope than required in the production Slack app, then Slack will return an error, saying extra scope was requested.

Now that we have a SlackStagingIntegrationProvider, we can assume we already have the appropriate scopes in the Staging app, and use the extended scopes for all Staging app installations.

leeandher and others added 18 commits March 30, 2026 10:58
Change IntegrationProviderSlug.SLACK_STAGING from "slack-staging" to
"slack_staging" for consistency with URL path normalization. Fix
_is_staging_request to handle Mock objects in tests. Move
SlackStagingRequestParser to its own module to satisfy parser module
discovery test. Update test assertions for new provider/action counts.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Gate the integration setup pipeline on requires_feature_flag so that
providers like slack_staging cannot be installed by orgs without the
corresponding feature flag. Previously only the config endpoint checked
this; the setup URL was unprotected.

Add tests verifying:
- slack-staging is hidden/visible on the config endpoint based on flag
- slack-staging setup returns 404 without the flag, 302 with it
- existing providers (example) are unaffected by the new check

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…nization param

Accept Organization | RpcOrganization to match the caller in
initialize_integration_pipeline, which passes a union type.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…ove dead code

The extracted is_provider_enabled was missing the actor parameter that
features.has() uses for user-level feature flag targeting. Add it back
and pass request.user from the organization_config_integrations
endpoint.

Also remove unused Channel namedtuple from slack staging integration.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Remove the separate staging integration button and the use_staging
modal parameter branching. The staging integration now uses the same
flow as the standard integration setup.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Filter SUPPORTED_PROVIDERS to only include Slack since msteams is not
widely tested. Use a Set for more efficient membership checks.

Also clean up an import formatting in organization_integration_setup.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…nked alert

Remove hardcoded IntegrationProviderSlug.SLACK provider filter from
SlackExplorerEntrypoint and process_thread_update since integration_id
already uniquely identifies the integration. Pass the full RpcIntegration
to _resolve_user so it uses the correct provider type for identity lookup.

Also show the UnlinkedAlert banner for slack_staging orgs in notification
settings so users are prompted to link their identity.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…r for staging

The UnlinkedAlert banner was gated on .includes('slack'), hiding it
when only slack_staging was selected. Use ALLOWED_PROVIDERS instead so
both slack variants trigger the prompt.

SlackActionTranslator.required_fields hardcoded ActionType.SLACK instead
of using self.action_type, forcing the staging subclass to duplicate the
property. Use self.action_type and drop the redundant override.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Replace the global `slack.extended-scopes-enabled` option with the
org-scoped `organizations:integrations-slack-staging` feature flag to
gate extended OAuth scopes during Slack installation. Remove the now
unused option registration.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Instead of a feature flag or global option, use the staging subclass
to include extended OAuth scopes. Prod Slack returns only default
scopes; SlackStagingIntegrationProvider overrides to add extended
scopes.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@github-actions github-actions Bot added the Scope: Backend Automatically applied to PRs that change backend components label Apr 2, 2026
@alexsohn1126
Copy link
Copy Markdown
Member Author

@sentry review
bugbot review

@alexsohn1126 alexsohn1126 marked this pull request as ready for review April 2, 2026 14:47
@alexsohn1126 alexsohn1126 requested review from a team as code owners April 2, 2026 14:47
Base automatically changed from leander/support-staging-slack to master April 2, 2026 15:17
@leeandher leeandher requested review from a team as code owners April 2, 2026 15:17
@alexsohn1126 alexsohn1126 enabled auto-merge (squash) April 2, 2026 15:25
@alexsohn1126 alexsohn1126 merged commit 2bbf724 into master Apr 2, 2026
68 of 69 checks passed
@alexsohn1126 alexsohn1126 deleted the alexsohn/use-feature-flag-for-extended-slack-scopes branch April 2, 2026 15:42
@linear-code
Copy link
Copy Markdown

linear-code Bot commented Apr 2, 2026

@github-actions github-actions Bot locked and limited conversation to collaborators Apr 18, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Scope: Backend Automatically applied to PRs that change backend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants