feat(integrations): slack staging app sidegrade#111687
Draft
alexsohn1126 wants to merge 10 commits intoalexsohn/seer-explorer-slack-integration-cleanupfrom
Draft
feat(integrations): slack staging app sidegrade#111687alexsohn1126 wants to merge 10 commits intoalexsohn/seer-explorer-slack-integration-cleanupfrom
alexsohn1126 wants to merge 10 commits intoalexsohn/seer-explorer-slack-integration-cleanupfrom
Conversation
Route OAuth credentials to the staging Slack app when use_staging=1 is passed as a query parameter during the integration setup flow. The sidegrade swaps the existing integration's credentials in place, so all alert rules and notification preferences continue to work. - Read use_staging from query params and gate behind slack-staging-app feature flag in OrganizationIntegrationSetupView - Forward use_staging through the identity pipeline so the OAuth flow uses slack-staging.client-id and slack-staging.client-secret - Set installation_type to "staging" in integration metadata - Try staging signing secret as fallback in webhook authorization Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…alexsohn/slack-staging-sidegrade
…alexsohn/slack-staging-sidegrade
…alexsohn/slack-staging-sidegrade
Replace SlackPromptLinkMessageBuilder with a SlackRenderable built from slack_sdk block objects, matching the interface expected by send_threaded_ephemeral_message. Extract the renderable construction into _build_link_identity_renderable for reuse and testability. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The custom message parameter is no longer needed since the link identity prompt now uses SlackRenderable directly. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…alexsohn/slack-staging-sidegrade
Add SlackStagingSidegradeFlowTest using IntegrationTestCase to test the end-to-end sidegrade flow (production -> staging -> production). Reuse assert_setup_flow from SlackIntegrationTest with a new init_params parameter to support passing query params like use_staging=1 during the OAuth init step. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Use a thin wrapper method that delegates to SlackIntegrationTest's assert_setup_flow instead of assigning the unbound method directly, which mypy rejects due to self-type mismatch. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Move the Slack OAuth setup flow assertion logic from SlackIntegrationTest into a standalone assert_slack_setup_flow() function in tests/sentry/integrations/slack/test_helpers.py. Both SlackIntegrationTest and SlackStagingSidegradeFlowTest now delegate to it, fixing mypy errors from cross-class method reuse. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.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
Adds the ability to sidegrade an organization's Slack integration between production and staging apps by swapping credentials in-place on the existing Integration row.
Backend changes (
src/):organization_integration_setup.py: Gateuse_staging=1query param behind theorganizations:slack-staging-appfeature flag; passuse_stagingconfig into the integration pipeline.slack/integration.py: Propagateuse_stagingconfig through the identity pipeline. Setinstallation_typeto"staging"or"born_as_bot"inbuild_integration()based on the config.identity/slack/provider.py: Return staging OAuth client ID/secret fromslack-staging.*options whenuse_stagingis set.slack/requests/base.py: Fall back to the staging signing secret when the production secret fails, so webhooks from either app are accepted.Test changes (
tests/):test_slack_staging_sidegrade.py(new): Tests for setup gating, identity provider credential selection,build_integration()metadata, signing secret fallback, and end-to-end sidegrade flows (production → staging → production).test_helpers.py(new): Extractedassert_slack_setup_flow()fromSlackIntegrationTestinto a shared helper so bothSlackIntegrationTestandSlackStagingSidegradeFlowTestcan reuse it.test_integration.py:assert_setup_flownow delegates to the shared helper, with a newinit_paramsargument for passing query params (e.g.use_staging=1) during the OAuth init step.