Repository navigation
[update-checkout] Support cross-repo PRs for repositories pinned to a tag - #93019
Open
jakepetroules wants to merge 1 commit into
Open
jakepetroules wants to merge 1 commit into
jakepetroules wants to merge 1 commit into
Conversation
… tag When a cross-repo PR is requested, update-checkout uses the repository's entry in the branch scheme as the PR's base branch, and checks whether the PR merge ref is stale with `git ls-remote --exit-code --heads origin refs/heads/<base>`. A scheme can pin a repository to a tag or commit instead of a branch (e.g. swift-subprocess is pinned to the `1.0.0` tag on main), in which case that command exits with status 2 and update-checkout fails, so a toolchain can't be built with a PR for such a repository. If the scheme entry is not a branch on the remote, there is no base branch to check staleness against or to merge, so use the PR merge ref as GitHub computed it against the PR's actual base branch.
jakepetroules
requested review from
etcwilde,
justice-adams-apple and
shahmishal
as code owners
October 7, 2026 01:39
Contributor
Author
|
@swift-ci test |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Cross-repo PR testing fails for any repository that the branch scheme pins to a tag instead of a branch. For example,
@swift-ci Please Build Toolchain …with a swift-subprocess PR fails on every platform, becausemainpins swift-subprocess to the1.0.0tag:(from #93014)
get_pr_branchtreats the repository's scheme entry as the PR's base branch, and checks whether the PR merge ref is stale againstrefs/heads/<entry>. When the entry is a tag (or a commit), there is no such branch, sols-remote --exit-codeexits with 2 and update-checkout aborts.A tag or commit pin says nothing about which branch the PR targets. So when the scheme entry isn't a branch on the remote, update-checkout now skips the staleness check and the re-merge, and uses the PR merge ref as GitHub computed it against the PR's actual base branch. Other
ls-remotefailures are still raised. Behavior for branch pins is unchanged.Testing:
test_checkout_pr_merge_ref_for_repo_pinned_to_tagandtest_checkout_stale_pr_merge_ref_for_repo_pinned_to_tag. Both failed with the error above before this change.utils/update_checkout/run_tests.pypass.