Skip to content

ref(integrations): Extract GitHub installation callout from org link view#116379

Merged
evanpurkhiser merged 1 commit into
masterfrom
evanpurkhiser/ref-integrations-extract-github-installation-callout-from-org-link-view
May 28, 2026
Merged

ref(integrations): Extract GitHub installation callout from org link view#116379
evanpurkhiser merged 1 commit into
masterfrom
evanpurkhiser/ref-integrations-extract-github-installation-callout-from-org-link-view

Conversation

@evanpurkhiser
Copy link
Copy Markdown
Member

@evanpurkhiser evanpurkhiser commented May 28, 2026

IntegrationOrganizationLink was carrying GitHub-only installation lookup logic — the /extensions/github/installation/:id/ fetch, the "sender verification" info banner, the "couldn't verify" warning fallback, and the corresponding error toast — wedged in alongside the generic org-picker flow that other providers also use. This moves it into a sibling GitHubInstallationCallout component so the org-link view doesn't conflate two unrelated provider entry points, and the GitHub-specific code isn't fetched (or even imported) for non-GitHub installs.

While moving, the previous useApiQuery call — which had a /../../... path hack to escape /api/0/ — is replaced with a hand-rolled queryOptions factory using an unprefixed Client({baseUrl: ''}). The factory mirrors the shape apiOptions produces (returns ApiResponse<T>, uses selectJson to unwrap), so cache semantics match the rest of the codebase. A long-form comment in the file explains why this endpoint lives outside /api/0/ (it's mounted under extensions/github/ in the integration package's urls.py rather than the API URL conf).

@github-actions github-actions Bot added the Scope: Frontend Automatically applied to PRs that change frontend components label May 28, 2026
@evanpurkhiser evanpurkhiser force-pushed the evanpurkhiser/ref-integrations-extract-github-installation-callout-from-org-link-view branch from b40223f to bd33822 Compare May 28, 2026 14:06
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 28, 2026

📊 Type Coverage Diff

Metric Before After Delta
Coverage 93.59% 93.58% 🔴 -0.01%
Typed 133,006 133,008 🟢 +2
Untyped 9,115 9,118 🔴 +3
🔍 3 new type safety issues introduced

any-typed symbols (2 new)

File Line Detail
static/app/views/integrationOrganizationLink/gitHubInstallationCallout.tsx 46 json (var(binding))
static/app/views/integrationOrganizationLink/gitHubInstallationCallout.tsx 46 response (var(binding))

Type assertions (as) (1 new)

File Line Detail
static/app/views/integrationOrganizationLink/gitHubInstallationCallout.tsx 51 as GitHubIntegrationInstallationjson as GitHubIntegrationInstallation

This is informational only and does not block the PR.

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 1 potential issue.

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 bd33822. Configure here.

…view

`IntegrationOrganizationLink` was carrying GitHub-only installation
lookup logic — the `/extensions/github/installation/:id/` fetch, the
"sender verification" info banner, the "couldn't verify" warning
fallback, and the corresponding error toast — wedged in alongside the
generic org-picker flow that other providers also use. Move it into a
sibling `GitHubInstallationCallout` component so the org-link view
doesn't conflate two unrelated provider entry points, and the
GitHub-specific bits aren't fetched (or even imported) for non-GitHub
installs.

While moving, replace the previous `useApiQuery` call — which had a
`/../../...` path hack to escape `/api/0/` — with a hand-rolled
`queryOptions` factory using an unprefixed `Client({baseUrl: ''})`. The
factory mirrors the shape `apiOptions` produces (returns
`ApiResponse<T>`, uses `selectJson` to unwrap), so cache semantics match
the rest of the codebase. A long-form comment in the file explains why
this endpoint lives outside `/api/0/`.

Adds a spec for the new component covering both branches.
@evanpurkhiser evanpurkhiser force-pushed the evanpurkhiser/ref-integrations-extract-github-installation-callout-from-org-link-view branch from bd33822 to 66d7b14 Compare May 28, 2026 14:30
@evanpurkhiser evanpurkhiser enabled auto-merge (squash) May 28, 2026 15:23
Copy link
Copy Markdown
Contributor

@Abdkhan14 Abdkhan14 left a comment

Choose a reason for hiding this comment

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

Looks good to me.

The test file can use a afterEach(() => jest.restoreAllMocks()), not the end of the world since it's used on the last test and there's only one spy, but for good hygiene.

@evanpurkhiser evanpurkhiser merged commit e2e3054 into master May 28, 2026
76 checks passed
@evanpurkhiser evanpurkhiser deleted the evanpurkhiser/ref-integrations-extract-github-installation-callout-from-org-link-view branch May 28, 2026 17:37
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