Skip to content

Commit 9d43a07

Browse files
committed
remove migrateRepository function
1 parent 2a2f917 commit 9d43a07

File tree

3 files changed

+21
-35
lines changed

3 files changed

+21
-35
lines changed

static/app/actionCreators/integrations.tsx

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -76,32 +76,6 @@ function applyRepositoryAddComplete(promise: Promise<Repository>) {
7676
return promise;
7777
}
7878

79-
/**
80-
* Migrate a repository to a new integration.
81-
*
82-
* @param client ApiClient
83-
* @param orgSlug Organization Slug
84-
* @param repositoryId Repository ID
85-
* @param integration Integration provider data.
86-
*/
87-
export function migrateRepository(
88-
client: Client,
89-
orgSlug: string,
90-
repositoryId: string,
91-
integration: Integration
92-
): Promise<Repository> {
93-
const data = {integrationId: integration.id};
94-
addLoadingMessage();
95-
const promise = client.requestPromise(
96-
`/organizations/${orgSlug}/repos/${repositoryId}/`,
97-
{
98-
data,
99-
method: 'PUT',
100-
}
101-
);
102-
return applyRepositoryAddComplete(promise);
103-
}
104-
10579
/**
10680
* Add a repository
10781
*

static/app/views/onboarding/components/useScmRepoSelection.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,6 @@ export function useScmRepoSelection({
102102
// Lookup missed (e.g., repo was hidden). Fall through to re-add it.
103103
}
104104

105-
// Note: for project creation (non-onboarding), we'll also need to handle
106-
// migrateRepository for repos previously connected via legacy plugins.
107105
setBusy(true);
108106
try {
109107
const created = await fetchMutation<Repository>({

static/app/views/settings/organizationIntegrations/integrationReposAddRepository.tsx

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
import {useMemo, useState} from 'react';
2+
import * as Sentry from '@sentry/react';
23

34
import {CompactSelect} from '@sentry/scraps/compactSelect';
45
import {OverlayTrigger} from '@sentry/scraps/overlayTrigger';
56

6-
import {addRepository, migrateRepository} from 'sentry/actionCreators/integrations';
7+
import {addRepository} from 'sentry/actionCreators/integrations';
78
import {DropdownButton} from 'sentry/components/dropdownButton';
89
import {t} from 'sentry/locale';
910
import {RepositoryStore} from 'sentry/stores/repositoryStore';
@@ -78,19 +79,32 @@ export function IntegrationReposAddRepository({
7879
return selection.value === item.externalSlug;
7980
});
8081

81-
let promise: Promise<Repository>;
8282
if (migratableRepo) {
83-
promise = migrateRepository(api, organization.slug, migratableRepo.id, integration);
84-
} else {
85-
promise = addRepository(api, organization.slug, selection.value, integration);
83+
Sentry.captureException(
84+
new Error(
85+
'Attempted to migrate repository integration — this code path is disabled'
86+
),
87+
{
88+
extra: {
89+
repositoryId: migratableRepo.id,
90+
integrationId: integration.id,
91+
orgSlug: organization.slug,
92+
},
93+
}
94+
);
8695
}
8796

8897
try {
89-
const repo = await promise;
98+
const repo = await addRepository(
99+
api,
100+
organization.slug,
101+
selection.value,
102+
integration
103+
);
90104
onAddRepository(repo);
91105
RepositoryStore.resetRepositories();
92106
} catch {
93-
// Error feedback is handled by addRepository/migrateRepository
107+
// Error feedback is handled by addRepository
94108
} finally {
95109
setAdding(false);
96110
}

0 commit comments

Comments
 (0)