core-gitlens: add a single pull request read for Azure DevOps, Bitbucket Cloud and Bitbucket Server

Author: epodivilovCreated Sep 24, 2026Updated Sep 24, 2026

Problem

Integration.getPullRequest(resource, id) returns undefined for Azure DevOps, Bitbucket Cloud and Bitbucket Server. The base method calls the optional getProviderPullRequest, and only GitHub, GitHub Enterprise, GitLab and GitLab self-hosted implement it. A consumer that needs one pull request by its URL or id has no direct read for these providers and has to scan a paginated list instead.

A list scan is bounded, so on an account with many open pull requests it can end before it reaches the wanted one. The consumer then cannot tell a missing pull request from an incomplete scan, and a pull request merged since it was last read can keep showing as open.

Issues do not have this gap: every provider implements getProviderIssue.

Evidence

Verified in @gitkraken/core-gitlens 0.7.0 (dist/plus/integrations):

  • models/integration.js: getPullRequest calls this.getProviderPullRequest?.(...), so a provider without the method resolves undefined with no error.
  • providers/github.js and providers/gitlab.js implement getProviderPullRequest and getProviderPullRequestIdentityFromMaybeUrl. The Enterprise and self-hosted classes inherit them.
  • providers/azureDevOps.js and providers/bitbucket.js implement only getProviderPullRequestForBranch, getProviderPullRequestForCommit and getProviderPullRequestIdentity.
  • providers/bitbucket-server.js implements only getProviderPullRequestForBranch and getProviderPullRequestForCommit.

Scope

  • Implement getProviderPullRequest for Azure DevOps, Bitbucket Cloud and Bitbucket Server. The returned PullRequest carries its state, including merged, and its merged and closed dates.
  • Implement getProviderPullRequestIdentityFromMaybeUrl for the same providers, so a consumer can go from a pasted URL to the id the read takes.
  • For Azure DevOps, take the id from the URL. Azure pull requests have been seen in list results with number: 0, so a number taken from a list is not a reliable key.

Related

  • #5875 — Bitbucket Data Center PR search and counts. A different surface, not a duplicate.
  • #5876 — Azure DevOps Server PR and work-item search and counts. A different surface, not a duplicate.

Source: gitkraken/vscode-gitlens