-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
base: main
Are you sure you want to change the base?
Bitbucket: Launchpad #4099
Conversation
195a7ce
to
317ea91
Compare
0f22513
to
aecdedf
Compare
317ea91
to
a1727c0
Compare
aecdedf
to
cecf5a7
Compare
6844237
to
a328685
Compare
cecf5a7
to
c1f4ecc
Compare
c1f4ecc
to
55cedb2
Compare
a328685
to
aedf600
Compare
55cedb2
to
8b1c412
Compare
8b1c412
to
da1bf24
Compare
da1bf24
to
95eebe7
Compare
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(); |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because they use the built-in Bitbucket API call that it returns only PRs where I'm the author, not a reviewer.
Another reason is that the shared library doesn't return the information about reviewers and participants:
95eebe7
to
9e05dc9
Compare
9e05dc9
to
4cbc863
Compare
4cbc863
to
fbba684
Compare
Description
solves #4046
Checklist
Fixes $XXX -
orCloses #XXX -
prefix to auto-close the issue that your PR addresses