Skip to content

chore(scm-messaging-integration-ui): Serializing MS teams installation type - #121964

Open
Abdkhan14 wants to merge 1 commit into
masterfrom
abdk/ms-teams-installation-type
Open

chore(scm-messaging-integration-ui): Serializing MS teams installation type#121964
Abdkhan14 wants to merge 1 commit into
masterfrom
abdk/ms-teams-installation-type

Conversation

@Abdkhan14

@Abdkhan14 Abdkhan14 commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

Needed by: #121631

Background

MS Teams installations come in two flavours: "team" (a single team) and "tenant" (an org-wide tenant install). Only team installs support Issue Alerts, so the frontend's isEligibleForIssueAlerts check gates tenant installs out of the inline destination picker. The problem is that installation_type lives in Integration.metadata but never reaches the API — MsTeamsIntegration inherits the default get_config_data(), which returns OrganizationIntegration.config and nothing else. The frontend always receives configData: undefined, making the eligibility check permanently dead code.

Change

Override get_config_data() on MsTeamsIntegration to pluck installation_type from self.model.metadata and expose it as installationType in configData, defaulting to "" for legacy installs that predate the field ("" !== "tenant" so they remain eligible). This mirrors the pattern Slack already uses for its own installationType. No schema or DB changes — the value already exists in metadata, we are only serializing it. Three unit tests cover the team, tenant, and missing cases.

@Abdkhan14 Abdkhan14 changed the title chore(scm-messaging-integration-ui): Serializing MS teams installatio… chore(scm-messaging-integration-ui): Serializing MS teams installation type Aug 13, 2026
@github-actions github-actions Bot added the Scope: Backend Automatically applied to PRs that change backend components label Aug 13, 2026
@Abdkhan14
Abdkhan14 marked this pull request as ready for review August 13, 2026 17:54
@Abdkhan14
Abdkhan14 requested a review from a team as a code owner August 13, 2026 17:54
@jaydgoss
jaydgoss requested a review from a team August 13, 2026 21:47

@control_silo_test
class MsTeamsIntegrationConfigTest(TestCase):
def setUp(self) -> None:

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

nit: the other test classes in this file call super().setUp() here. It works without it because the fixtures are lazy, but worth keeping consistent.

)
self.installation = MsTeamsIntegration(self.integration, self.organization.id)

def test_config_data_team(self) -> None:

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

nit: this and test_config_data_tenant only differ by the string. Could fold them into one test with both asserts.

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.

2 participants