Skip to content

Commit 8f72ea3

Browse files
feedback
1 parent d694641 commit 8f72ea3

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

packages/backend/src/ee/repoPermissionSyncer.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,10 @@ export class RepoPermissionSyncer {
257257
const client = createBitbucketCloudClient(config.user, credentials.token);
258258

259259
const parsedMetadata = repoMetadataSchema.safeParse(repo.metadata);
260-
const bitbucketCloudMetadata = parsedMetadata.success ? parsedMetadata.data.codeHostMetadata?.bitbucketCloud : undefined;
260+
if (!parsedMetadata.success) {
261+
throw new Error(`Repo ${id} has invalid metadata: ${JSON.stringify(parsedMetadata.error.errors)}`);
262+
}
263+
const bitbucketCloudMetadata = parsedMetadata.data.codeHostMetadata?.bitbucketCloud;
261264
if (!bitbucketCloudMetadata) {
262265
throw new Error(`Repo ${id} is missing required Bitbucket Cloud metadata (workspace/repoSlug)`);
263266
}
@@ -285,7 +288,7 @@ export class RepoPermissionSyncer {
285288

286289
return {
287290
accountIds: accounts.map(account => account.id),
288-
// Since we only fetch users who have been explicitly granted accesss to the repo,
291+
// Since we only fetch users who have been explicitly granted access to the repo,
289292
// this is a partial sync.
290293
isPartialSync: true,
291294
}

0 commit comments

Comments
 (0)