You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It's possible to directly link to a pull request from the blame tooltip. However, this link is invalid if the repository is a fork, which is a very common workflow.
In this case, the provided link might be of the form github.com/ForkOwner/repository/pulls/1. However, the actual pull request link should reference the upstream repository and be of the form github.com/UpstreamOwner/repository/pulls/1.
AaronFeickert
changed the title
Pull request links in blame tooltip does not respect forks
Pull request links in blame tooltip do not respect forks
Dec 20, 2024
The current version of the GitHub API can provide this functionality directly. This seems much more robust than trying to construct a pull request URL manually using pieced-together data from the repository and commit messages.
On further thought, it isn't clear how to take advantage of the relevant API in an efficient way. Making an API call to get the pull request associated to every commit from a file's blame seems excessive, and could hit usage limits pretty quickly. Another option would be to make the call for an individual line's blame commit on demand, but this could slow down the UX.
A simpler initial fix could be to use the API instead to get the repository's parent (if applicable) and use this to build pull request URLs. This isn't foolproof, since it could be the case that the pull request is not against the parent. However, it seems like this approach would be objectively more reliable than the current behavior.
Since #25044 has been added to our Quality Week board and @Anthony-Eid is working on it, I'm going to close this issue out. Check out 25044 for updates on the bug fix!
Check for existing issues
Describe the bug / provide steps to reproduce it
It's possible to directly link to a pull request from the blame tooltip. However, this link is invalid if the repository is a fork, which is a very common workflow.
In this case, the provided link might be of the form
github.com/ForkOwner/repository/pulls/1
. However, the actual pull request link should reference the upstream repository and be of the formgarden.eu.org/UpstreamOwner/repository/pulls/1
.Zed Version and System Specs
Zed: v0.166.1 (Zed)
OS: macOS 15.2.0
Memory: 16 GiB
Architecture: aarch64
If applicable, add screenshots or screencasts of the incorrect state / behavior
No response
If applicable, attach your Zed.log file to this issue.
Zed.log
The text was updated successfully, but these errors were encountered: