Skip to content

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

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

Closed
3 tasks
sergeibbb opened this issue Mar 5, 2025 · 2 comments · Fixed by #4141
Closed
3 tasks

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

sergeibbb opened this issue Mar 5, 2025 · 2 comments · Fixed by #4141
Assignees
Labels
debt Technical debt verified ✔ Verified
Milestone

Comments

@sergeibbb
Copy link
Member

sergeibbb commented Mar 5, 2025

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:

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

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
@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
@sergeibbb
Copy link
Member Author

Status update:

The changes of the shared library are merged.
But they might want to update the function signature before the release.
Anyway, we are waiting for the new version and then continue here.

@github-actions github-actions bot added needs-verification Request for verification pending-release Resolved but not yet released to the stable edition labels Mar 24, 2025
@axosoft-ramint axosoft-ramint added verified ✔ Verified and removed needs-verification Request for verification labels Mar 31, 2025
@d13 d13 removed the pending-release Resolved but not yet released to the stable edition label Apr 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
debt Technical debt verified ✔ Verified
Projects
None yet
3 participants