Repository navigation
fix(pins): reconcile changed inputs, fail on unpinnable ones, keep URL attributes - #145
Merged
Merged
Conversation
Member
|
Does the new |
…L attributes - Record each pin's declared URL in a sidecar next to the lock (npins/flake-file-urls.tsv, nix/flake-file-urls.tsv, lon-flake-file-urls.tsv); a pin whose URL changed is removed and re-added, an unchanged one is left alone. - Collect failed pins instead of `|| true`, keep writing the rest, then name the failures on stderr and exit 1. - Parse the query string of git+/github:/gitlab:/sourcehut: URLs: ref= is the branch, rev= is pinned via each backend's revision flag, host= selects the gitlab server. Attrset inputs carry rev, host, dir, etc. into that query. dir=, narHash=, submodules=1, lfs=1 and a non-github.com github host fail loudly, naming the input.
vic
approved these changes
Oct 12, 2026
Member
|
Thanks |
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.
Summary
Fixes three defects in the shared pin engine from #143 (
modules/pins/queue.bash), which backswrite-npins,write-lonandwrite-niv.foo.urlleft the old source in place. The writer now records each pin's declared URL in a sidecar file next to the lock (npins/flake-file-urls.tsv,nix/flake-file-urls.tsv,lon-flake-file-urls.tsv). When a pin's URL changes, the writer removes it and adds it again. When the URL is unchanged, the pin and its locked revision are left alone. A pin that exists but has no sidecar entry, such as one from a lock written before this change, is kept as it is and recorded.add_url … || trueis gone. The writer collects the names that failed, still writes every other pin, then lists the failed names on stderr and exits 1. Thewith_branchdefault/main/master fallback still works.git+,github:,gitlab:andsourcehut:URLs is parsed.ref=sets the branch andrev=pins that revision (npins--at, lon-r, niv--rev).host=selects the server for gitlab and sourcehut.rev,host,dirand similar attributes in that query string.dir,narHash,submodules=1,lfs=1, and a github host other than github.com. Before this change they were silently dropped.Validation
New bootstrap tests in
dev/_bootstrap-tests.nix:test-{npins,lon,niv}-repin,test-npins-missing,test-{npins,lon,niv}-url-attrsandtest-npins-unrepresentable. All 8 fail on main and pass on this branch.test-npins-repinalso checks that an unchanged URL keeps a hand-edited revision, so the pin is not churned.nix-shell dev/bootstrap-tests.nix --run test-allpasses, apart from the niv tests in that run, which hit GitHub's unauthenticated API rate limit. Rerun withGITHUB_TOKENset, all niv tests pass.nix run ./dev#fmt -- --ciis clean.