Skip to content

Adds Bitbucket PR Support: remotes, autolinks, home, etc. #4070

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

Merged
merged 6 commits into from
Feb 26, 2025

Conversation

sergeibbb
Copy link
Member

@sergeibbb sergeibbb commented Feb 18, 2025

Description

solves #4045

Adds enriched Bitbucket PRs to various places:

  • such as remote branches on remotes,
  • autolinks on commits, on Home and in Graph.

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 linked an issue Feb 18, 2025 that may be closed by this pull request
9 tasks
@sergeibbb sergeibbb force-pushed the 4044-bitbucket-basic branch from f1680a0 to 8d1586f Compare February 20, 2025 12:45
Base automatically changed from 4044-bitbucket-basic to main February 20, 2025 12:52
sergeibbb added a commit that referenced this pull request Feb 20, 2025
sergeibbb added a commit that referenced this pull request Feb 20, 2025
sergeibbb added a commit that referenced this pull request Feb 21, 2025
sergeibbb added a commit that referenced this pull request Feb 21, 2025
CHANGELOG.md Outdated
@@ -37,6 +37,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p
- Adds a _Switch Model_ button to the AI confirmation prompts
- Adds Windsurf support — closes [#3969](https://github.com/gitkraken/vscode-gitlens/issues/3969)
- Adds "pro" indicators for applicable integrations — closes [#3972](https://github.com/gitkraken/vscode-gitlens/issues/3972)
- Adds integration with Bitbucket Cloud by showing enrichhed links to PRs and issues [#4045](https://github.com/gitkraken/vscode-gitlens/issues/4045)
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's do a header line for the parent issue once all the BitBucket support is in, with sub-lines like this one covering each aspect of the integration. For now, this can stay out of this PR.

@@ -0,0 +1,289 @@
import type { HttpsProxyAgent } from 'https-proxy-agent';
Copy link
Contributor

Choose a reason for hiding this comment

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

For consistency can this file follow the naming pattern of similar ones for other providers?

Copy link
Member Author

Choose a reason for hiding this comment

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

done

return undefined;
}
let hasReviews = false;
let hasRejections = false;
Copy link
Contributor

Choose a reason for hiding this comment

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

A change request isn't quite the same as a rejection IMO. Maybe hasChangeRequests?

Copy link
Member Author

Choose a reason for hiding this comment

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

done

Comment on lines 263 to 264
undefined,
undefined,
Copy link
Contributor

@axosoft-ramint axosoft-ramint Feb 21, 2025

Choose a reason for hiding this comment

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

I suggest surfacing to the team that we do not know mergeableState or viewerCanUpdate on PRs from BitBucket, because this means that several Launchpad categories, including Ready to Merge, Has Conflicts, Failing CI, won't work with BitBucket PRs.

Copy link
Member Author

Choose a reason for hiding this comment

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

@axosoft-ramint

ok. There is also problem with assignees that does not exist in Bitbucket.

Comment on lines 290 to 292
pr.participants
?.filter(prt => prt.role === 'REVIEWER')
.map(prt => fromBitbucketParticipantToReviewer(prt, pr.closed_by, pr.state)),
Copy link
Contributor

Choose a reason for hiding this comment

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

This would be all reviewers assigned to the PR who's review state is "review requested" i.e. they have been requested to review but have not yet submitted a review for that request.

Is that what this filter is capturing? Note importantly that anyone who's review status is "approved, changes requested, commented, dismissed" etc. shouldn't be in this list.

Copy link
Member Author

Choose a reason for hiding this comment

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

@axosoft-ramint So, we should show Pending only, right?

owner: string,
repo: string,
id: string,
options: {
Copy link
Contributor

@axosoft-ramint axosoft-ramint Feb 21, 2025

Choose a reason for hiding this comment

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

An options param shouldn't be required here. Any required bits should be outside of the options object.

Suggested change
options: {
options?: {

Copy link
Member Author

Choose a reason for hiding this comment

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

fixed. I've moved the baseUrl to required params.

sergeibbb added a commit that referenced this pull request Feb 24, 2025
sergeibbb added a commit that referenced this pull request Feb 24, 2025
(#4045, #4070)

rename bitbucket-api.ts to bitbucket.ts
sergeibbb added a commit that referenced this pull request Feb 24, 2025
sergeibbb added a commit that referenced this pull request Feb 24, 2025
(#4045, #4070)

rename bitbucket-api.ts to bitbucket.ts
sergeibbb added a commit that referenced this pull request Feb 24, 2025
Copy link
Contributor

@axosoft-ramint axosoft-ramint left a comment

Choose a reason for hiding this comment

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

A bit weird that we require qualifiers like "pull request #" for autolinks instead of having it work like GitHub, but we can address that separately.

@sergeibbb sergeibbb force-pushed the debt/4098-remove-searched-wrappers branch 2 times, most recently from 867f9d2 to 36cc563 Compare February 26, 2025 08:24
Base automatically changed from debt/4098-remove-searched-wrappers to main February 26, 2025 08:42
@sergeibbb sergeibbb merged commit 1d41f04 into main Feb 26, 2025
3 checks passed
sergeibbb added a commit that referenced this pull request Feb 26, 2025
sergeibbb added a commit that referenced this pull request Feb 26, 2025
@sergeibbb sergeibbb deleted the 4045-home-pr-issue branch February 26, 2025 10:52
saeedzaha pushed a commit to saeedzaha/vscode-gitlens that referenced this pull request Apr 28, 2025
saeedzaha pushed a commit to saeedzaha/vscode-gitlens that referenced this pull request Apr 28, 2025
saeedzaha pushed a commit to saeedzaha/vscode-gitlens that referenced this pull request Apr 28, 2025
saeedzaha pushed a commit to saeedzaha/vscode-gitlens that referenced this pull request Apr 28, 2025
saeedzaha pushed a commit to saeedzaha/vscode-gitlens that referenced this pull request Apr 28, 2025
saeedzaha pushed a commit to saeedzaha/vscode-gitlens that referenced this pull request Apr 28, 2025
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 Home PR/Issue Support
2 participants