Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extend the shared library to provide more data for Bitbucket PRs #4128

Open
sergeibbb opened this issue Mar 5, 2025 · 1 comment · May be fixed by #4141
Open

Extend the shared library to provide more data for Bitbucket PRs #4128

sergeibbb opened this issue Mar 5, 2025 · 1 comment · May be fixed by #4141
Assignees
Labels
debt Technical debt
Milestone

Comments

@sergeibbb
Copy link
Member

sergeibbb commented Mar 5, 2025

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:

Image

Our current Bitbucket conversion of type is here, all information is collected in one request:

{
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:

  1. the logic should be implemented in the shared library
  2. GitLens should remove the custom implementation and start using the shared library.

Implementation

@sergeibbb sergeibbb added the triage Needs to be looked at label Mar 5, 2025
@sergeibbb sergeibbb added this to the 16.4 milestone Mar 5, 2025
@sergeibbb sergeibbb self-assigned this Mar 5, 2025
@sergeibbb
Copy link
Member Author

Hi @gitkraken-jacobw

Here is a ticket related to making some changes in the shared library.

What do you think is the best way to handle it?

@sergeibbb sergeibbb added debt Technical debt and removed triage Needs to be looked at labels Mar 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
debt Technical debt
Projects
None yet
1 participant