Skip to content

ref(integrations): Convert AddIntegration to useAddIntegration hook#112278

Merged
evanpurkhiser merged 2 commits intomasterfrom
evanpurkhiser/ref-integrations-convert-addintegration-from-class-render-prop-to-useaddintegration-hook
Apr 6, 2026
Merged

ref(integrations): Convert AddIntegration to useAddIntegration hook#112278
evanpurkhiser merged 2 commits intomasterfrom
evanpurkhiser/ref-integrations-convert-addintegration-from-class-render-prop-to-useaddintegration-hook

Conversation

@evanpurkhiser
Copy link
Copy Markdown
Member

Replace the class-based AddIntegration render prop component with a
useAddIntegration hook. This modernizes the integration setup flow to
use hooks and prepares for the API-driven pipeline modal by adding
feature-flag-gated support for opening a React pipeline modal instead
of the legacy Django popup window.

  • Convert AddIntegration class component to useAddIntegration hook
  • Refactor AddIntegrationButton to use the hook directly
  • Add API pipeline feature flag support for github and gitlab providers
  • Rewrite tests to use renderHookWithProviders with comprehensive
    coverage for both legacy and API pipeline flows

@evanpurkhiser evanpurkhiser requested a review from a team as a code owner April 6, 2026 19:03
@evanpurkhiser evanpurkhiser requested review from a team and leeandher and removed request for a team April 6, 2026 19:03
@github-actions github-actions bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Apr 6, 2026
Copy link
Copy Markdown
Contributor

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 3 potential issues.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit c0667fb. Configure here.

window.removeEventListener('message', handleMessage);
dialogRef.current?.close();
};
}, [provider.key, provider.name, organization]);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Effect cleanup closes popup dialog on organization reference change

Medium Severity

The useEffect dependency array includes organization (an object), so any reference change triggers cleanup which calls dialogRef.current?.close() — closing the popup mid-installation. The original class component only closed the dialog on unmount. The onInstall and analyticsParams values were correctly stored in refs to avoid this, but organization was not given the same treatment despite only being used in an analytics call inside handleMessage.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit c0667fb. Configure here.

Comment thread static/app/views/settings/organizationIntegrations/addIntegration.tsx Outdated
@evanpurkhiser evanpurkhiser force-pushed the evanpurkhiser/ref-integrations-convert-addintegration-from-class-render-prop-to-useaddintegration-hook branch from c0667fb to 509bf57 Compare April 6, 2026 19:58
Comment thread static/app/views/settings/organizationIntegrations/addIntegration.spec.tsx Outdated
@evanpurkhiser evanpurkhiser force-pushed the evanpurkhiser/ref-integrations-convert-addintegration-from-class-render-prop-to-useaddintegration-hook branch from 509bf57 to 2549863 Compare April 6, 2026 22:27
…seAddIntegration hook

Replace the class-based AddIntegration render prop component with a
useAddIntegration hook. This modernizes the integration setup flow to
use hooks and prepares for the API-driven pipeline modal by adding
feature-flag-gated support for opening a React pipeline modal instead
of the legacy Django popup window.

- Convert AddIntegration class component to useAddIntegration hook
- Refactor AddIntegrationButton to use the hook directly
- Add API pipeline feature flag support for github and gitlab providers
- Rewrite tests to use renderHookWithProviders with comprehensive
  coverage for both legacy and API pipeline flows
@evanpurkhiser evanpurkhiser force-pushed the evanpurkhiser/ref-integrations-convert-addintegration-from-class-render-prop-to-useaddintegration-hook branch from 2549863 to 5474548 Compare April 6, 2026 22:59
@evanpurkhiser evanpurkhiser merged commit 86eb858 into master Apr 6, 2026
67 of 68 checks passed
@evanpurkhiser evanpurkhiser deleted the evanpurkhiser/ref-integrations-convert-addintegration-from-class-render-prop-to-useaddintegration-hook branch April 6, 2026 23:21
george-sentry pushed a commit that referenced this pull request Apr 9, 2026
…112278)

Replace the class-based AddIntegration render prop component with a
useAddIntegration hook. This modernizes the integration setup flow to
use hooks and prepares for the API-driven pipeline modal by adding
feature-flag-gated support for opening a React pipeline modal instead
of the legacy Django popup window.

- Convert AddIntegration class component to useAddIntegration hook
- Refactor AddIntegrationButton to use the hook directly
- Add API pipeline feature flag support for github and gitlab providers
- Rewrite tests to use renderHookWithProviders with comprehensive
  coverage for both legacy and API pipeline flows

---------

Co-authored-by: getsantry[bot] <66042841+getsantry[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Frontend Automatically applied to PRs that change frontend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants