Skip to content

Conversation

@JordonKash
Copy link
Contributor

Description

This pull request resolves an issue where GitLens incorrectly links pull requests when a commit originates from a different Azure DevOps project, despite the commit tree being visible in the current project.

When a commit from a pull request (PR) in one Azure DevOps project (e.g., Project B) is reflected in another project (e.g., Project A) due to shared repositories or mirrored refs, GitLens correctly displays the commit in Project A. However, it incorrectly assumes the associated PR also exists in Project A, resulting in a broken or invalid PR link. Since PRs are scoped to their respective projects, this leads to a mismatch between the commit’s origin and the generated PR URL.

Fix includes using pr.repository.project.name when fetching the repository name, rather than just the current projectName.

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 self-assigned this Apr 8, 2025
@sergeibbb sergeibbb linked an issue Apr 8, 2025 that may be closed by this pull request
@sergeibbb sergeibbb changed the base branch from main to fix/4207-azure-project-pr-links April 8, 2025 14:07
@sergeibbb sergeibbb marked this pull request as ready for review April 8, 2025 14:07
@sergeibbb sergeibbb merged commit 7c3758b into gitkraken:fix/4207-azure-project-pr-links Apr 8, 2025
3 checks passed
sergeibbb added a commit that referenced this pull request Apr 8, 2025
* Fixes #4207 - Incorrect PR Link Across Azure DevOps Projects

* Fixes a mistake in Changelog and prettifies the changed files

(#4210, #4213)

---------

Co-authored-by: Jordon Kashanchi <[email protected]>
saeedzaha pushed a commit to saeedzaha/vscode-gitlens that referenced this pull request Apr 28, 2025
* Fixes gitkraken#4207 - Incorrect PR Link Across Azure DevOps Projects

* Fixes a mistake in Changelog and prettifies the changed files

(gitkraken#4210, gitkraken#4213)

---------

Co-authored-by: Jordon Kashanchi <[email protected]>
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.

Incorrect PR Link Across Azure DevOps Projects

2 participants