feat(lock): wippy.lock.local overlay for local replacement overrides#461
Open
skhaz wants to merge 3 commits into
Open
feat(lock): wippy.lock.local overlay for local replacement overrides#461skhaz wants to merge 3 commits into
skhaz wants to merge 3 commits into
Conversation
Why: module replacements only lived in the tracked wippy.lock, so local development against sibling checkouts leaked machine-local paths into commits and broke contributors whose checkout layout differed. What: lock.New now reads a sibling "<lockpath>.local" overlay that carries only replacements (strict decode; non-replacement keys are rejected, an empty overlay is tolerated). Overlay entries merge over the tracked lock and win by "from". GetReplacement, GetReplacements and GetModuleLoadPaths return the effective view; a new GetTrackedReplacements exposes the base-only set. Write and the mutators stay base-only, so overlay content is never persisted. Validate checks the effective replacement paths.
Why: update regenerates the canonical wippy.lock; consuming the effective (overlay-merged) replacements would copy developer-local overrides back into the tracked lock and scan their sources into the resolved graph. What: switch the five replacement consumers in the full and targeted update flows to GetTrackedReplacements so the overlay never influences or leaks into the regenerated lock. The targeted skip check keeps the effective view, since it only decides whether to hub-update a locally overridden module, never what to persist.
Why: the overlay is meant to stay local; without a default ignore rule developers would commit machine-local replacement paths. What: wippy init idempotently ensures the .gitignore next to the lock file lists wippy.lock.local, creating the file when absent and appending the entry on its own line when missing.
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.
Why
Module
replacements:only lived in the trackedwippy.lock, so local development against sibling checkouts forced editing the committed lock:replacement path ... does not existand had to fork the lock;What
A gitignored
wippy.lock.localoverlay next towippy.lockthat carries onlyreplacements:. Per module, overlay entries win over the tracked lock. Honored byinstall,update, andrun; its content is never written back into the tracked lock.lock.Newreads a sibling<lockpath>.localoverlay (strict decode — non-replacement keys rejected; empty overlay tolerated). Overlay entries merge over the tracked lock and win byfrom.GetReplacement,GetReplacements,GetModuleLoadPaths) uses the effective view;Writeand the mutators stay base-only, so nothing overlay-derived is persisted. A newGetTrackedReplacementsexposes the base-only set.updateusesGetTrackedReplacementsat its five replacement consumers, so the overlay never leaks into the regenerated lock.runneeds no flag — the overlay is discovered automatically next to the resolved lock.wippy initidempotently addswippy.lock.localto.gitignore.Testing
go test -racegreen acrossboot/...+cmd/...(24 packages);golangci-lintclean; gremlins mutation 91% (lone survivor is an equivalent capacity-hint mutant).wippybinary: