Skip to content

Commit

Permalink
Update provider-apis package to use PR converter util function
Browse files Browse the repository at this point in the history
  • Loading branch information
jdgarcia committed Jun 3, 2024
1 parent 17849f5 commit ffe0bb6
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 13 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
"watch:firefox": "yarn run set-manifest:firefox:force && yarn watch"
},
"dependencies": {
"@gitkraken/provider-apis": "0.22.7",
"@gitkraken/provider-apis": "0.22.8",
"@tanstack/query-async-storage-persister": "5.32.0",
"@tanstack/react-query": "5.32.0",
"@tanstack/react-query-persist-client": "5.32.0",
Expand Down
13 changes: 5 additions & 8 deletions src/providers.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import type { Account, PullRequestWithUniqueID } from '@gitkraken/provider-apis';
import type { Account } from '@gitkraken/provider-apis';
import {
AzureDevOps,
Bitbucket,
BitbucketServerUtils,
EntityIdentifierProviderType,
EntityIdentifierUtils,
EntityType,
Expand Down Expand Up @@ -60,6 +61,7 @@ const fetchGitLabFocusViewData = async (token: ProviderToken) => {

const { data: pullRequests } = await gitlab.getPullRequestsAssociatedWithUser({
username: providerUser.username,
includeFromArchivedRepos: false,
});

return { providerUser: providerUser, pullRequests: pullRequests.map(pr => ({ ...pr, uuid: '' })) };
Expand Down Expand Up @@ -96,17 +98,12 @@ const fetchBitbucketServerFocusViewData = async (token: ProviderToken) => {
return {
providerUser: data.user as Account,
pullRequests: (data.body.values as any[]).map(pullRequest => ({
...BitbucketServerUtils.restApiPullRequestToCommonPullRequest(pullRequest),
// Bitbucket Server PR ids are just the number, they are not unique across repos, so instead
// we use the PR url as the id.
id: pullRequest.links.self[0].href,
number: pullRequest.id,
title: pullRequest.title,
url: pullRequest.links.self[0].href,
repository: {
name: pullRequest.fromRef.repository.name,
},
uuid: '',
})) as PullRequestWithUniqueID[],
})),
};
};

Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -285,10 +285,10 @@
resolved "https://registry.yarnpkg.com/@eslint/js/-/js-8.44.0.tgz#961a5903c74139390478bdc808bcde3fc45ab7af"
integrity sha512-Ag+9YM4ocKQx9AarydN0KY2j0ErMHNIocPDrVo8zAE44xLTjEtz81OdR68/cydGtk6m6jDb5Za3r2useMzYmSw==

"@gitkraken/[email protected].7":
version "0.22.7"
resolved "https://registry.npmjs.org/@gitkraken/provider-apis/-/provider-apis-0.22.7.tgz#f217e1d275b578c33a38ce03564a10ee6b6b3e2c"
integrity sha512-twLjzIahStD4FkI10UxxikLLocE0r9IkX2qPjZiBfhyZbGKVdnFEdYdbZaeKOxTt87T6LyTPhdGnRLMrZfCWpA==
"@gitkraken/[email protected].8":
version "0.22.8"
resolved "https://registry.npmjs.org/@gitkraken/provider-apis/-/provider-apis-0.22.8.tgz#5e70e00b94a386275b141fb42b055c7124adce15"
integrity sha512-i2/+gC1j940zjS8rn124HYPLXa7O8t3i5PbLNNB6Xp+wFCTmLeILkcuIFAV1xH1291KoqaWY0HJMZlsmpdo7ww==
dependencies:
js-base64 "3.7.5"
node-fetch "2.7.0"
Expand Down

0 comments on commit ffe0bb6

Please sign in to comment.