Skip to content

Commit

Permalink
Use the provider-api package's encode function for generating PR uuids
Browse files Browse the repository at this point in the history
  • Loading branch information
jdgarcia committed May 31, 2024
1 parent 1743dc6 commit 6337b6b
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions src/providers.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
import { AzureDevOps, Bitbucket, GitHub, GitLab } from '@gitkraken/provider-apis';
import {
AzureDevOps,
Bitbucket,
EntityIdentifierProviderType,
EntityIdentifierUtils,
EntityType,
GitHub,
GitLab,
} from '@gitkraken/provider-apis';
import { fetchProviderToken } from './gkApi';
import type { FocusViewData, FocusViewSupportedProvider, Provider } from './types';

Expand All @@ -25,7 +33,11 @@ const fetchGitHubFocusViewData = async (token: string) => {
providerUser: providerUser,
pullRequests: pullRequests.map(pr => ({
...pr,
uuid: JSON.stringify(['github', 'pr', '1', '', pr.graphQLId || pr.id]),
uuid: EntityIdentifierUtils.encode({
provider: EntityIdentifierProviderType.Github,
entityType: EntityType.PullRequest,
entityId: pr.graphQLId || pr.id,
}),
})),
};
};
Expand Down

0 comments on commit 6337b6b

Please sign in to comment.