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

Bitbucket: Launchpad #4099

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open

Bitbucket: Launchpad #4099

wants to merge 5 commits into from

Conversation

sergeibbb
Copy link
Member

@sergeibbb sergeibbb commented Feb 24, 2025

Description

solves #4046

Checklist

  • I have followed the guidelines in the Contributing document
  • My changes follow the coding style of this project
  • My changes build without any errors or warnings
  • My changes have been formatted and linted
  • My changes include any required corresponding changes to the documentation (including CHANGELOG.md and README.md)
  • My changes have been rebased and squashed to the minimal number (typically 1) of relevant commits
  • My changes have a descriptive commit message with a short title, including a Fixes $XXX - or Closes #XXX - prefix to auto-close the issue that your PR addresses

@sergeibbb sergeibbb marked this pull request as draft February 24, 2025 17:20
@sergeibbb sergeibbb marked this pull request as ready for review February 24, 2025 17:20
@sergeibbb sergeibbb marked this pull request as draft February 24, 2025 17:21
@sergeibbb sergeibbb force-pushed the 4045-home-pr-issue branch 2 times, most recently from 195a7ce to 317ea91 Compare February 25, 2025 14:13
@sergeibbb sergeibbb force-pushed the 4046-bitbucket-launchpad branch from 0f22513 to aecdedf Compare February 25, 2025 14:21
@sergeibbb sergeibbb force-pushed the 4046-bitbucket-launchpad branch from aecdedf to cecf5a7 Compare February 25, 2025 14:22
@sergeibbb sergeibbb force-pushed the 4045-home-pr-issue branch 2 times, most recently from 6844237 to a328685 Compare February 25, 2025 14:28
@sergeibbb sergeibbb force-pushed the 4046-bitbucket-launchpad branch from cecf5a7 to c1f4ecc Compare February 25, 2025 14:31
@sergeibbb sergeibbb marked this pull request as ready for review February 25, 2025 14:31
@sergeibbb sergeibbb linked an issue Feb 25, 2025 that may be closed by this pull request
8 tasks
@sergeibbb sergeibbb force-pushed the 4046-bitbucket-launchpad branch from c1f4ecc to 55cedb2 Compare February 25, 2025 14:47
@sergeibbb sergeibbb force-pushed the 4046-bitbucket-launchpad branch from 55cedb2 to 8b1c412 Compare February 26, 2025 08:57
Base automatically changed from 4045-home-pr-issue to main February 26, 2025 10:52
@sergeibbb sergeibbb force-pushed the 4046-bitbucket-launchpad branch from 8b1c412 to da1bf24 Compare February 26, 2025 10:54
@sergeibbb sergeibbb force-pushed the 4046-bitbucket-launchpad branch from da1bf24 to 95eebe7 Compare February 26, 2025 13:09
Comment on lines +277 to +297
const repos = await this.getProviderProjectsForResources(session, workspaces);
if (repos == null || repos.length === 0) return undefined;

const api = await this.container.bitbucket;
if (!api) return undefined;
const prsResult = await Promise.allSettled(
repos.map(repo =>
api.getUsersPullRequestsForRepo(
this,
session.accessToken,
user.id,
repo.owner,
repo.name,
this.apiBaseUrl,
),
),
);
return prsResult
.map(r => getSettledValue(r))
.filter(r => r != null)
.flat();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not just use getPullRequestsForUserAndWorkspace from the shared provider library here, mapping over your workspaces (which is one call per workspace and includes paging) and then converting from ProviderPullRequest to PullRequest with the transformation function instead of doing it ourselves on a per-repo basis?

Copy link
Member Author

@sergeibbb sergeibbb Feb 27, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@axosoft-ramint

Because they use the built-in Bitbucket API call that it returns only PRs where I'm the author, not a reviewer.
image

Another reason is that the shared library doesn't return the information about reviewers and participants:
image

@sergeibbb sergeibbb force-pushed the 4046-bitbucket-launchpad branch from 95eebe7 to 9e05dc9 Compare February 27, 2025 15:59
@sergeibbb sergeibbb force-pushed the 4046-bitbucket-launchpad branch from 9e05dc9 to 4cbc863 Compare February 27, 2025 18:21
@sergeibbb sergeibbb force-pushed the 4046-bitbucket-launchpad branch from 4cbc863 to fbba684 Compare February 28, 2025 11:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bitbucket Cloud: Add Launchpad Support
2 participants