Restore stay-on-PR feature
Created by: felixfbecker
I think this is how it was supposed to work. The part
was used in GitHub's urlToFile()
, but not actually passed anymore from anywhere (which didn't fail since it was optional).
This passes it again, and puts it into a context
parameter because it took me a while to understand before and this clearly separates the target from the context of the invocation (i.e. the source).
I'm not sure about how I feel about coupling this to the invocation part in general. What if the j2d was invoked by command, but the rev still matches? What if the codeintel is a fallback commit from LSIF? But maybe these are not real issues.
The alternative would be to find which part belongs to the target rev, but this would require more context information (because figuring out the rev of a code view is potentially async and we don't want to do that in urlToFile
, and it was already done), which is actually not that easy to pipe through the code (this PR is actually a good foundation for such context information).
I could not test this because of https://github.com/sourcegraph/sourcegraph/issues/6539 (didn't find any MR or PR with same-PR/MR symbols yet that didn't fail)
Tested on Gitlab MRs and GitHub PRs.
Fixes #6547 (closed)