Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ import type {Project} from 'sentry/types/project';
import {fetchMutation} from 'sentry/utils/queryClient';
import {useOrganization} from 'sentry/utils/useOrganization';

import {bulkAutofixAutomationSettingsInfiniteOptions} from './useBulkAutofixAutomationSettings';

export function useUpdateProjectSeerPreferences(project: Project) {
const organization = useOrganization();
const queryClient = useQueryClient();
Expand Down Expand Up @@ -48,14 +46,6 @@ export function useUpdateProjectSeerPreferences(project: Project) {
},
onSettled: () => {
queryClient.invalidateQueries({queryKey});

const bulkAutofixAutomationSettingsQueryOptions =
bulkAutofixAutomationSettingsInfiniteOptions({
organization,
});
queryClient.invalidateQueries({
queryKey: bulkAutofixAutomationSettingsQueryOptions.queryKey,
});
},
});
}
18 changes: 7 additions & 11 deletions static/app/utils/seer/useMutateAutofixProject.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
import {useMutation, useQuery, useQueryClient} from '@tanstack/react-query';

import {bulkAutofixAutomationSettingsInfiniteOptions} from 'sentry/components/events/autofix/preferences/hooks/useBulkAutofixAutomationSettings';
import {projectSeerPreferencesApiOptions} from 'sentry/components/events/autofix/preferences/hooks/useProjectSeerPreferences';
import {ProjectsStore} from 'sentry/stores/projectsStore';
import type {Project} from 'sentry/types/project';
import {getApiUrl} from 'sentry/utils/api/getApiUrl';
import {makeDetailedProjectQueryKey} from 'sentry/utils/project/useDetailedProject';
import {fetchMutation} from 'sentry/utils/queryClient';
import {
buildHandoffPayload,
knownAgentIntegrationsQueryOptions,
parseAgentOption,
} from 'sentry/utils/seer/preferredAgent';
import {getSeerProjectReposInfiniteQueryOptions} from 'sentry/utils/seer/seerProjectRepos';
import {
getInfiniteSeerProjectsSettingsQueryOptions,
getSeerProjectSettingsQueryOptions,
Expand Down Expand Up @@ -99,14 +98,14 @@ export function useMutateAutofixProject() {
// provider/owner/name matching cannot. Its replace-all is transactional,
// so if this request fails we abort before touching settings and
// nothing is persisted.
const reposQueryOptions = getSeerProjectReposInfiniteQueryOptions({
organization,
project,
});
const [reposUrl] = reposQueryOptions.queryKey;
await fetchMutation({
method: 'PUT',
url: getApiUrl('/projects/$organizationIdOrSlug/$projectIdOrSlug/seer/repos/', {
path: {
organizationIdOrSlug: organization.slug,
projectIdOrSlug: project.slug,
},
}),
url: reposUrl,
data: {repos},
});

Expand Down Expand Up @@ -151,9 +150,6 @@ export function useMutateAutofixProject() {
queryKey: projectSeerPreferencesApiOptions(organization.slug, project.slug)
.queryKey,
});
queryClient.invalidateQueries({
queryKey: bulkAutofixAutomationSettingsInfiniteOptions({organization}).queryKey,
});
queryClient.invalidateQueries({
queryKey: getSeerProjectSettingsQueryOptions({
organization,
Expand Down
5 changes: 0 additions & 5 deletions static/gsApp/views/seerAutomation/seerAutomation.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,6 @@ describe('SeerAutomation', () => {
method: 'GET',
body: [],
});
MockApiClient.addMockResponse({
url: '/organizations/org-slug/autofix/automation-settings/',
method: 'GET',
body: [],
});
});

it('does not show legacy banner for orgs without legacy or beta Seer features', () => {
Expand Down
Loading