ref(integrations): Remove legacy GitHub/GitLab feature toggles from detail view#113924
Conversation
jaydgoss
left a comment
There was a problem hiding this comment.
Should this be feat flagged?
No need, we'll make the configurations available in both places and then just remove this one after it's merged. I just merged #113923 so once that goes out we can merge this |
…etail view Part of Phase 3 of VDY-110. The PR-comment and missing-member toggles are now exposed in the per-install integration configuration form via the standard JSONForm descriptors (landed in the prior backend commit). Drop the custom github/gitlab features tab on the integration detail page so the two code paths don't compete. The slack case in the same switch stays — slack alert-thread flags are an out-of-scope anti-pattern tracked separately. Fixes: [VDY-113](https://linear.app/getsentry/issue/VDY-113/phase-3-move-scm-settings-ui-to-per-install-integration-config)
d9872b9 to
7d306f4
Compare
| const isDisabled = !hasOrgWrite || !hasIntegration; | ||
|
|
||
| switch (provider?.key) { | ||
| case 'github': | ||
| return ( | ||
| <FieldGroup> | ||
| <AutoSaveForm | ||
| name="githubPRBot" | ||
| schema={githubFeaturesSchema} | ||
| initialValue={organization.githubPRBot} | ||
| mutationOptions={orgMutationOptions} | ||
| > | ||
| {field => ( | ||
| <field.Layout.Row | ||
| label={t('Enable Comments on Suspect Pull Requests')} | ||
| hintText={ | ||
| hasIntegration | ||
| ? t( | ||
| 'Allow Sentry to comment on recent pull requests suspected of causing issues.' | ||
| ) | ||
| : t('You must have a GitHub integration to enable this feature.') | ||
| } | ||
| > | ||
| <field.Switch | ||
| checked={field.state.value} | ||
| onChange={field.handleChange} | ||
| disabled={isDisabled} | ||
| aria-label={t('Enable Comments on Suspect Pull Requests')} | ||
| /> | ||
| </field.Layout.Row> | ||
| )} | ||
| </AutoSaveForm> | ||
| <AutoSaveForm | ||
| name="githubNudgeInvite" | ||
| schema={githubFeaturesSchema} | ||
| initialValue={organization.githubNudgeInvite} | ||
| mutationOptions={orgMutationOptions} | ||
| > | ||
| {field => ( | ||
| <field.Layout.Row | ||
| label={t('Enable Missing Member Detection')} | ||
| hintText={ | ||
| hasIntegration | ||
| ? t( | ||
| 'Allow Sentry to detect users committing to your GitHub repositories that are not part of your Sentry organization..' | ||
| ) | ||
| : t('You must have a GitHub integration to enable this feature.') | ||
| } | ||
| > | ||
| <field.Switch | ||
| checked={field.state.value} | ||
| onChange={field.handleChange} | ||
| disabled={isDisabled} | ||
| aria-label={t('Enable Missing Member Detection')} | ||
| /> | ||
| </field.Layout.Row> | ||
| )} | ||
| </AutoSaveForm> | ||
| </FieldGroup> | ||
| ); | ||
| case 'gitlab': | ||
| return ( | ||
| <FieldGroup> | ||
| <AutoSaveForm | ||
| name="gitlabPRBot" | ||
| schema={gitlabFeaturesSchema} | ||
| initialValue={organization.gitlabPRBot} | ||
| mutationOptions={orgMutationOptions} | ||
| > | ||
| {field => ( | ||
| <field.Layout.Row | ||
| label={t('Enable Comments on Suspect Pull Requests')} | ||
| hintText={ | ||
| hasIntegration | ||
| ? t( | ||
| 'Allow Sentry to comment on recent pull requests suspected of causing issues.' | ||
| ) | ||
| : t('You must have a GitLab integration to enable this feature.') | ||
| } | ||
| > | ||
| <field.Switch | ||
| checked={field.state.value} | ||
| onChange={field.handleChange} | ||
| disabled={isDisabled} | ||
| aria-label={t('Enable Comments on Suspect Pull Requests')} | ||
| /> | ||
| </field.Layout.Row> | ||
| )} | ||
| </AutoSaveForm> | ||
| </FieldGroup> | ||
| ); | ||
| case 'slack': | ||
| return ( | ||
| <FieldGroup> |
There was a problem hiding this comment.
Bug: Navigating to a GitHub/GitLab integration page with a stale ?tab=features URL parameter results in a blank content area because the tab is no longer valid.
Severity: MEDIUM
Suggested Fix
In the useIntegrationTabs hook, before setting the active tab from location.query.tab, validate that the tab exists in the list of available tabs. If it doesn't, fall back to a default valid tab (e.g., the first one) to prevent rendering a blank state.
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/settings/organizationIntegrations/integrationDetailedView.tsx#L435-L440
Potential issue: If a user navigates to a GitHub or GitLab integration detail page using
a URL with the `?tab=features` parameter (e.g., from a bookmark), the content area will
be blank. The `useIntegrationTabs` hook sets `activeTab` to 'features' from the URL
without validating it against the available tabs for the integration. Since the
'features' tab is no longer available for GitHub/GitLab, no tab appears selected, and
the `renderFeatures()` function's default case returns `null`, leading to an empty view.
This is a regression, as this URL was previously valid.
Did we get this right? 👍 / 👎 to inform future reviews.
…ils endpoint (#113925) Part of Phase 3 of VDY-110. The `githubPRBot` / `githubNudgeInvite` / `gitlabPRBot` fields on `PUT /organizations/{slug}/` backed the legacy integration-detail UI that was removed in the prior commit ([#113924](#113924)). Every install's toggles now live on `OrganizationIntegration.config` and are edited through the per-integration config endpoint. - Remove the three entries from `ORG_OPTIONS` so the endpoint no longer writes to `OrganizationOption` for them. - Drop the three `BooleanField` declarations on `OrganizationSerializer` and the `@extend_schema` docs so the OpenAPI spec stops advertising fields the backend no longer accepts. - Drop the (now unused) `GITHUB_COMMENT_BOT_DEFAULT` / `GITLAB_COMMENT_BOT_DEFAULT` imports. `PUT` bodies that still include these fields are silently dropped (DRF unknown-field default). The derived read-side fields on the response continue to exist — the missing-member invite banner still reads `githubNudgeInvite` — and will be audited/removed in Phase 4. Ref: [VDY-113: Phase 3: Move SCM settings UI to per-install integration config](https://linear.app/getsentry/issue/VDY-113/phase-3-move-scm-settings-ui-to-per-install-integration-config)
…etail view (#113924) Part of Phase 3 of VDY-110. The PR-comment and missing-member toggles are now exposed in the per-install integration configuration form via the standard JSONForm descriptors (landed in the prior backend commit, [#113923](#113923)). Drop the custom github/gitlab features tab on the integration detail page so the two code paths don't compete. The slack case in the same switch stays — slack alert-thread flags are an out-of-scope anti-pattern tracked separately. Ref: [VDY-113: Phase 3: Move SCM settings UI to per-install integration config](https://linear.app/getsentry/issue/VDY-113/phase-3-move-scm-settings-ui-to-per-install-integration-config)
…ils endpoint (#113925) Part of Phase 3 of VDY-110. The `githubPRBot` / `githubNudgeInvite` / `gitlabPRBot` fields on `PUT /organizations/{slug}/` backed the legacy integration-detail UI that was removed in the prior commit ([#113924](#113924)). Every install's toggles now live on `OrganizationIntegration.config` and are edited through the per-integration config endpoint. - Remove the three entries from `ORG_OPTIONS` so the endpoint no longer writes to `OrganizationOption` for them. - Drop the three `BooleanField` declarations on `OrganizationSerializer` and the `@extend_schema` docs so the OpenAPI spec stops advertising fields the backend no longer accepts. - Drop the (now unused) `GITHUB_COMMENT_BOT_DEFAULT` / `GITLAB_COMMENT_BOT_DEFAULT` imports. `PUT` bodies that still include these fields are silently dropped (DRF unknown-field default). The derived read-side fields on the response continue to exist — the missing-member invite banner still reads `githubNudgeInvite` — and will be audited/removed in Phase 4. Ref: [VDY-113: Phase 3: Move SCM settings UI to per-install integration config](https://linear.app/getsentry/issue/VDY-113/phase-3-move-scm-settings-ui-to-per-install-integration-config)
Part of Phase 3 of VDY-110. The PR-comment and missing-member toggles are now exposed in the per-install integration configuration form via the standard JSONForm descriptors (landed in the prior backend commit, #113923). Drop the custom github/gitlab features tab on the integration detail page so the two code paths don't compete.
The slack case in the same switch stays — slack alert-thread flags are an out-of-scope anti-pattern tracked separately.
Ref: VDY-113: Phase 3: Move SCM settings UI to per-install integration config
Migration phases