feat(msteams): Wire Teams Marketplace installs through the API pipeline modal#116488
Merged
Conversation
…ne modal
When a user installs the Sentry app from the Microsoft Teams Marketplace,
the Sentry bot posts a card linking to `/extensions/msteams/configure/` with
a signed `signed_params` blob. That forwards to `/extensions/msteams/link/`
(the org picker), and from there the install needs to drive the API pipeline
modal.
This wires up the frontend side:
- Adds `msTeamsParams` in the org-link view, returning `{signed_params}` when
present in the URL query, and routes `handleInstallClick` through it via the
existing `gitHubAppListingParams ?? discordAppDirectoryParams ??
msTeamsParams` chain.
- Adds the `integrationMsTeams` pipeline definition. Its single step has no
interactive UI; all install data arrives bound to pipeline state, so it
auto-advances when the backend returns `appDirectoryInstall`, rendering a
brief "Finishing up..." message (guarded by a ref against strict-mode
double-fire).
- Registers the pipeline and adds `msteams` to
`UNCONDITIONAL_API_PIPELINE_PROVIDERS`.
Backend support ships separately. The configure URL still routes through the
legacy server-rendered view until a follow-up swaps it to a redirect.
| if (typeof signedParams !== 'string') { | ||
| return null; | ||
| } | ||
| return {signedParams}; |
Contributor
There was a problem hiding this comment.
Bug: The msTeamsParams object uses a camelCase key signedParams, but the backend will expect the snake_case key signed_params, causing the integration flow to fail.
Severity: HIGH
Suggested Fix
In integrationOrganizationLink/index.tsx:237, change the returned object from return {signedParams}; to return {signed_params: signedParams}; to ensure the key name matches the expected snake_case format.
Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent. Verify if this is a real issue. If it is, propose a fix; if not, explain why it's
not valid.
Location: static/app/views/integrationOrganizationLink/index.tsx#L237
Potential issue: The code at `integrationOrganizationLink/index.tsx:237` returns an
object with a camelCase key, `{signedParams}`. This object is sent to the backend as
`initialData` for the MS Teams integration pipeline. Although the backend currently
lacks a serializer for this data, the PR description indicates one will be added. This
future serializer will almost certainly expect the key to be `signed_params`
(snake_case) to align with Python conventions and the parameter name in the URL. The
current camelCase key `signedParams` will cause this future backend validation to fail,
breaking the MS Teams installation flow.
Did we get this right? 👍 / 👎 to inform future reviews.
Member
Author
There was a problem hiding this comment.
the initial data serializer will be a CamelCaseSerializer
Contributor
📊 Type Coverage Diff✅ No new type safety issues introduced. Coverage: 93.59% |
scttcper
reviewed
May 29, 2026
| * pipeline with `gitHubAppListingParams`. | ||
| * | ||
| * - Discord | ||
| * `/extensions/discord/link/?code=…&guild_id=…` (redirected from |
scttcper
approved these changes
May 29, 2026
evanpurkhiser
added a commit
that referenced
this pull request
May 29, 2026
…6490) [VDY-101: Microsoft Teams: API-driven integration setup](https://linear.app/getsentry/issue/VDY-101/microsoft-teams-api-driven-integration-setup) Adds the API-mode pipeline machinery for Microsoft Teams alongside the existing server-rendered configure flow, without changing the entry point yet. This is the first of three deploy-safe steps: the legacy `MsTeamsExtensionConfigurationView` and the `/extensions/msteams/configure/` URL are left untouched, so nothing changes for users until the frontend can drive the modal and the configure URL is later swapped to a redirect. - `MsTeamsInitialDataSerializer` unsigns the bot's `signed_params` blob and binds each field to top-level pipeline state. - `MsTeamsApiStep` has no interactive UI; it signals the frontend to auto-advance, which runs `build_integration` on the bound state. - `build_integration` now reads top-level state, falling back to the nested `state["msteams"]` the legacy view binds, so both flows work during the transition. Also adds a `can_add_externally` marker to `IntegrationProvider` for integrations whose install is initiated from the third party's app directory or marketplace and completed through the pipeline modal. MS Teams sets `can_add = False` to hide the in-app install button, so the pipeline endpoint needs this opt-in to allow the externally-initiated install. The other already-external providers (Discord, GitHub, and GitHub Enterprise via subclassing) are marked for consistency; it's a no-op for them since they're `can_add = True`. Note: mypy will be red until #116486 (typing `utils.signing.unsign` as `Any`) merges, since the serializer's `validate()` returns a `TypedDict` from `unsign()`. The frontend follow-up is #116488.
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.
VDY-101: Microsoft Teams: API-driven integration setup
When a user installs the Sentry app from the Microsoft Teams Marketplace, the Sentry bot posts a card linking to
/extensions/msteams/configure/with a signedsigned_paramsblob. That forwards to/extensions/msteams/link/(the org picker), and from there the install needs to drive the API pipeline modal. This wires up the frontend side:msTeamsParamsin the org-link view, returning{signedParams}whensigned_paramsis present in the URL query, and routeshandleInstallClickthrough it via the existinggitHubAppListingParams ?? discordAppDirectoryParams ?? msTeamsParamschain.integrationMsTeamspipeline definition. Its single step has no interactive UI; all install data arrives already bound to pipeline state, so it auto-advances when the backend returnsappDirectoryInstall, rendering a brief "Finishing up..." message (guarded by a ref against React strict-mode double-fire).msteamstoUNCONDITIONAL_API_PIPELINE_PROVIDERS.Depends on the backend support (separate PR) and must not deploy before it: the modal calls the API pipeline
initializeendpoint formsteams, which only works once the backend serializer / step /can_add_externallychanges are live. The/extensions/msteams/configure/URL still routes through the legacy server-rendered view until a follow-up swaps it to a redirect.