-
Notifications
You must be signed in to change notification settings - Fork 14
feat(integrations): filter integrations by kind server-side #1954
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -38,7 +38,7 @@ export function useIntegrations() { | |
|
|
||
| const query = useAuthenticatedQuery( | ||
| integrationKeys.list(), | ||
| (client) => client.getIntegrations() as Promise<Integration[]>, | ||
| (client) => client.getIntegrations("github") as Promise<Integration[]>, | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
The string literal Prompt To Fix With AIThis is a comment left during a code review.
Path: apps/code/src/renderer/hooks/useIntegrations.ts
Line: 41
Comment:
**Magic string `"github"` duplicated across call sites**
The string literal `"github"` is now hardcoded in three separate files (`useIntegrations.ts`, `usePrefetchSignalData.ts`, `DataSourceSetup.tsx`) as the `kind` argument. This violates the OnceAndOnlyOnce principle — if the kind identifier ever changes, all three sites need updating. Consider exporting a shared constant (e.g. `GITHUB_INTEGRATION_KIND = "github"`) from `integrationStore.ts` and referencing it at every call site and in the existing `i.kind === "github"` guards.
How can I resolve this? If you propose a fix, please make it concise. |
||
| ); | ||
|
|
||
| useEffect(() => { | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
kindquery parameterposthogClient.test.tshas no test forgetIntegrations/getIntegrationsForProject. The newkindparameter changes the URL that is fetched (appending?kind=github), but no test verifies that the query string is correctly set — or omitted whenkindisundefined. A parameterised test covering both the filtered and unfiltered cases would prevent a silent regression if the URL-building logic is touched later.Prompt To Fix With AI