-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Closed
Copy link
Description
seems to cause #4191
Description
There is a getPullRequestsForUserAndWorkspace method in the shared library. But in #4099 we used the own implementation of it, because the shared library does not provide info about reviewers.
Also we need URLs of head and base repositories, to avoid hacking it like here:
Our current Bitbucket conversion of type is here, all information is collected in one request:
vscode-gitlens/src/plus/integrations/providers/bitbucket/models.ts
Lines 366 to 397 in 289fb9e
| { | |
| base: { | |
| branch: pr.destination.branch.name, | |
| sha: pr.destination.commit.hash, | |
| repo: pr.destination.repository.name, | |
| owner: pr.destination.repository.full_name.split('/')[0], | |
| exists: true, | |
| url: pr.destination.repository.links.html.href, | |
| }, | |
| head: { | |
| branch: pr.source.branch.name, | |
| sha: pr.source.commit.hash, | |
| repo: pr.source.repository.name, | |
| owner: pr.source.repository.full_name.split('/')[0], | |
| exists: true, | |
| url: pr.source.repository.links.html.href, | |
| }, | |
| isCrossRepository: pr.source.repository.uuid !== pr.destination.repository.uuid, | |
| }, | |
| undefined, // isDraft | |
| undefined, // additions | |
| undefined, // deletions | |
| undefined, // commentsCount | |
| undefined, // thumbsCount | |
| getBitbucketReviewDecision(pr), | |
| pr.participants // reviewRequests:PullRequestReviewer[] | |
| ?.filter(prt => prt.role === 'REVIEWER') | |
| .map(prt => fromBitbucketParticipantToReviewer(prt, pr.closed_by, pr.state)) | |
| .filter(rv => rv.state === PullRequestReviewState.ReviewRequested), | |
| pr.participants // latestReviews:PullRequestReviewer[] | |
| ?.filter(prt => prt.participated_on != null) | |
| .map(prt => fromBitbucketParticipantToReviewer(prt, pr.closed_by, pr.state)), |
Goals:
- the logic should be implemented in the shared library
- GitLens should remove the custom implementation and start using the shared library.
Implementation
- shared library: https://github.com/gitkraken/provider-apis-package-js/pull/223
- GitLens: Extend the shared library to provide more data for bitbucket prs (and use it here) #4141
Verification steps
Check that Bitbucket Cloud pull requests work on Launchpad
- Their URLs go to right pages
- Switch to the branch works
- Merge command works