Repository navigation
Conversation
…another checkout When no checkout names a hosted pull request, the read goes through another project on the host, and detail, summary and preview named that lending project. A hand-off then checked the pull request out in a project that only lent its credentials. They now name the asking project when it is supported on the same host. The canonical reference and the persisted read key follow it, so two asking projects keep their own targets and a turn in the asking project refreshes its read. Recovery after a stack action refreshes the asking project and the lending project. Reads keep the lending project's checkout and credentials. Co-authored-by: Absterrg0 <148704891+Absterrg0@users.noreply.github.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ApprovabilityVerdict: Approved at Macroscope's review found this PR approvable — This is a focused server-side bug fix that separates the asking project’s checkout/cache identity from the lending project’s credentials without changing provider contracts or defaults. Regression tests cover the corrected handoff, cache refresh behavior, and existing fallback cases. You can add or adjust custom eligibility rules. Learn more. |
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
Resolve the conflict in requireProject: keep main's repositoryKeyFromRemote for the borrowed route's remote and keep the asking project's checkout. The new tests call fakePullRequestProvider, which replaced the local fakeProvider helper on main. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Note Written by Verified in a real dev environmentverified unchanged head
command and server response transcript Not verifiednative mobile, electron, macos/windows, remote/relay connections, other hosting providers, real repository rename redirects, separate github accounts per checkout, viewed-file invalidation, and failed stack-action recovery. no merge, rebase, or other remote mutation was exercised. this verifies the service behavior when the request names the asking project. the existing sidebar/thread-details link routing can select the lender before reaching this service; this pr does not change that routing. resolve/fix controls were not exercised. the checkout recording uses the explicit-project URL documented in the pr, then the actual app controls. Merged current main (4438db4)merged |
…ad-target # Conflicts: # apps/server/src/pullRequest/PullRequestService.ts
|
Note 🤖 Opus 5.5 replying on behalf of Victor. @maria-rcks thanks for the report. We ran both items in the web app at |




Part of #16455
Problem
A pull request stored under a repository name no checkout matches (for example
old-org/appafter a move) is read through the first project on that host.detail,summaryandpreviewthen name that lending project, so a handoff checks out there instead of in the project the user asked from, and the persisted read is keyed by the lender.Change
When the asking project is supported on the reference's host, a borrowed route records it as
checkout.detail,summary,preview, the canonical reference and the persisted read key take the asking project; provider reads and credentials still use the lender. A stack action refreshes both projects, since each can hold its own cached read. With no supported asking checkout on that host, the lender stays the target, as before. #23368 carries the separate checkout guard. Credit to @Absterrg0, whose closed #16514 first served such a reference from the requesting project.Scope and approval
Part of #16455. The triage confirms that the borrowed project is presented as the pull request's project and lists options that keep borrowed reads without using that project as the checkout target; the reporter suggested the same. This PR names the asking project; the guard in #23368 checks that it is a checkout of the repository. The triage leaves the fix direction to a maintainer, so it does not approve this choice.
This PR moves the handoff only where the request names the asking project, as the Pull Requests page does when its URL names that project and the stored, old repository name. From the code, the sidebar link and the thread-details pull request row pick the project on the client before this code runs (
findProjectOnChangeRequestHostinThreadDetailsPrRows.tsx), so those routes still target the lending project. When the asking project is unrelated as well, this PR alone still checks the pull request out there; #23368 refuses that case.This splits the closed #18278 and carries its borrowed-read change with the same code. Its guard half, #20727, was closed in favour of #23368. This PR does not change which checkouts a guard accepts.
Verification
Linux x64, real github.com read with a read-only token.
zeit/ms#170is a real open pull request; that repository is nowvercel/ms. Projects:lender(first on the host, a clone of an unrelated repository) andapp(a clone ofvercel/ms). Revisions: main32882540fb, this head4438db4891, and this head merged locally with that main (015be2f96a, not pushed). Each run opens Pull requests at/pull-requests?projectId=<app>&selectedProjectId=<app>&selectedHost=github.com&repository=zeit%2Fms&number=170, then Check out, In a separate worktree.vp run dev:desktop): the route set and the clicks sent through the debugging port.I kept separate captures for web and Linux desktop so main, this head and the local merge can be compared.
Web, main
32882540fb: the draft opens inlender.Web, this head
4438db4891: the draft opens inappwith #170.Web, the merge
015be2f96a: the draft opens inappwith #170.Linux desktop, main
32882540fb: the draft opens inlender.Linux desktop, this head
4438db4891: the draft opens inapp.Linux desktop, the merge
015be2f96a: the draft opens inapp.Worktree listings and the unit run
Worktrees after Check out in the desktop runs (clean clones each run; the web runs agree):
vp test run src/pullRequest/PullRequestService.test.tsinapps/server. On015be2f96awith main'sPullRequestService.ts(this PR's tests, main's code):On
015be2f96a:Tests 122 passed (122). On4438db4891:Tests 118 passed (118).Earlier, against a local GitHub Enterprise stand-in at main
d756fed7aaand this head: a stack rebase that fails at a layer's push refreshes that pull request's read in both projects. A viewed-files mark made from the asking project can show in the lending project only after the 15 s viewed-files cache lifetime, as two checkouts of one repository already do on main.Not checked:
threadOutboxDelivery.ts), not the one a detail read returns.ssh.github.comor another SSH host (lender fallback, from the code).Generated with Claude Opus 5.5 in T3 Code Nightly