upstream-sync: adopt our own PR, and open the home-manager one - #4265
Merged
Conversation
Opening the first PR through this machinery found a bug in it. A PR opened
by `upstream-pr --open` by hand never reaches the sync loop, so the status
file does not know about it. On the next run the fuzzy duplicate search
found that very PR, called it a competitor, and left `pr: null` with the
patch recorded as blocked by itself.
"Have we already sent this?" and "did someone else propose this?" are
different questions, so ask the first one directly: `gh pr list --head
<branch>` on our own branch, before the search. The head repo owner is
checked in the tool, because `gh pr list --head` matches on the bare branch
name and silently returns nothing for `owner:branch`, and without the owner
check a stranger's same-named branch would be adopted as ours. The
regression test pins the live failure.
home-manager is now opted in to unattended contribution. That gate said
"out pending review: nobody has checked our commits against their
conventions", so this change is that review, done against a real
submission:
- Subject was 61 characters against their documented 50, and five body
lines exceeded 72. Fixed in the fork, message only, tree byte-identical.
The intent key follows the subject, so it moved with it.
- Dropped a `Refs #3689` trailer pointing at a repo
their reviewers cannot open. That context lives in the registry now.
- Their treefmt reports both changed files clean.
- tests/modules/files passes on the patched tree, target-conflict
included, which is the collision path this patch rewrites.
- Our base was 45 commits behind master and both touched files had moved,
so the first submission conflicted. Rebasing produced one conflict, and
resolving it took upstream's own fix (deeb6b7e, unintended subshell
expansion in a backup message) into the block we had moved into a
function. We would otherwise have reintroduced that bug.
nix-community/home-manager#9718 is open and not a draft, with all seven of
their checks green.
Assisted-by: Claude Opus 4.5 via Claude Code
Contributor
|
Required workers must start within 120 minutes after GitHub marks them ready. Once assigned, each has 120 seconds for setup, then 2400 seconds for validation, then 10 seconds for cleanup. Add the Routine validation applies. |
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.
Opening the first PR through this machinery found a bug in it, and reviewing home-manager for the opt-in gate found four things in our patch.
The tool called its own new PR someone else's duplicate
upstream-pr --openrun by hand opens the PR without going through the sync loop, so the status file never learns of it. On the nextupstream-syncthe fuzzy duplicate search found that very PR, reported it as a competitor, and leftpr: nullwith the patch recorded as blocked by itself."Have we already sent this?" and "did someone else propose this?" are different questions. The first is now asked directly, before the search, with
gh pr list --head <branch>on our own branch. The head repo owner is checked in the tool, becausegh pr list --headmatches on the bare branch name and silently returns nothing forowner:branch; without the owner check a stranger's same-named branch would be adopted as ours. The live failure is pinned as a regression test.home-manager is opted in, and this change is the review that earned it
The gate said "out pending review: nobody has checked our commits against their conventions". Doing that check found:
Refs indexable-inc/index#3689trailer pointing at a repo their reviewers cannot open. Dropped; that context is in the registry now.tests/modules/filespasses on the patched tree,target-conflictincluded, which is the collision path this patch rewrites.Result
nix-community/home-manager#9718 is open and not a draft, with all seven of their checks green.
Known gap: the fork's
ix-patchedbranch still sits on the old base, so it and the PR have diverged. Rebasing the maintained branch changes what workstation configs consuming it get, so it is a deliberate act rather than something to slip into this change.Assisted-by: Claude Opus 4.5 via Claude Code
Note
Adopt existing fork PRs in upstream-sync instead of treating them as duplicates
gh::find_oursin gh.rs to query GitHub for open PRs whose head branch and owner match our fork, returning the newest match as a trackedPr.handle_patchin main.rs to callfind_oursbefore the duplicate check; if a matching PR is found, it is adopted and refreshed rather than left withpr: null.autoContributein fork-packages.nix and renames the patch key to"files: batch link creation and target checks"(shortened subject)."files: batch symlink creation and target checks in activation"must update to the shortened key.Macroscope summarized de3f4cb.