Repository navigation
Conversation
Use the native module sorter for checksum unions so smoke fixtures and Go tooling retain the same ordering across minor versions. Cover deduplication, go.mod suffixes and malformed entries.
Sync can raise a member's requirements while their go.mod checksums are recorded only in other workspace sum files, which breaks standalone builds of that member. With replacement stubs present, each member now downloads its final graph with GOWORK off after sync. Sync has already resolved every member graph on its own, so the member's own replacements are the complete context. Cover the standalone readonly load and binding restoration when a member download fails. Go itself rejects `go get` and `go work sync` for a member whose requirements resolve only through workfile replacements, so that case expects the resolution failure with every binding restored.
ashtonian
marked this pull request as ready for review
November 5, 2026 00:45
v-markhallen
reviewed
Nov 6, 2026
| content = SharedHelpers.run_helper_subprocess( | ||
| command: NativeHelpers.helper_path, | ||
| function: "restoreReplacedRequirements", | ||
| args: { original_content: original, updated_content: File.read(path), replaced_modules: replaced_modules } |
Contributor
There was a problem hiding this comment.
Could we scope the protected replacements to the member they apply to? With api/go.mod replacing rsc.io/quote v1.5.1 locally and worker/go.mod using it from the registry, this restores the worker's requirement to v1.5.1 after go get rsc.io/quote@v1.5.2 succeeds. Please add a regression that keeps the registry-backed member's update.
This branch has not been deployed
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.
Workspace updates fail when member manifests replace a module with a local path outside the checkout, such as a sibling repository: the workspace path never used the single-module stub lifecycle, and members that reach one target through different relative paths produced conflicting replacements. Parser metadata commands also rewrote the first matching path text, which could be a comment rather than the replacement.
Closes #16821.
Changes
ReplaceStubberis the one replacement lifecycle for parsing and updating. It resolves each external target's identity across the module, the workfile and everyused member, points every binding at one shared stub withgo mod edit/go work edit, and restores the original bindings before returning files or propagating a tooling failure. In-repository replacements stay live; the stub root is temporary and removed. Existing module-relativestub_pathscallers keep working.// indirect, comments) and keeps original requirements an incomplete graph would prune, while keeping public version changes.go.sumandgo.work.sumkeep the union of original and new entries, ordered withx/mod/module.Sort. Checksum reads and writes stay inside the checkout.go work synccan raise a member's requirements while theirgo.modchecksums are recorded only in other workspace sum files, which breaks standalone builds of that member. A stubbed workspace update now runsgo mod downloadin each member withGOWORK=offafter sync. Sync has already resolved every member graph on its own, so each member's own replacements are the complete context.go.workpreservation is unchanged.Go itself cannot update a member whose requirements resolve only through a workfile
replace: with every source present,go getandgo work syncboth fail. The updater reports that resolution failure, with every binding restored, rather than producing an update the toolchain cannot reproduce.Validation
Run in the current
dependabot-updater-gomodimage against this branch's tree:manifestpackage passesgo test,go test -raceandgo vet. The workspace local-replacement,ReplaceStubberandGoModManifestspecs pass (83 examples), as do the affected parser cases and the existing single-module path-replace regressions. RuboCop reports no offenses in the changed files.replace,go getandgo work syncfail.go getandgo work syncpass. A standaloneGOWORK=off go list -mod=readonly -m allthen fails on a missinggo.modchecksum, and passes aftergo mod download.replace.PathDependenciesNotReachable.go list -deps -test ./...in the mode its CI builds it. The root and five members load standalone withGOWORK=off -mod=readonly, and all seven load in the workspace.go.modchecksums.The real-workspace replay uses dependabot/cli#693, a separate fix for the CLI's empty
blocked-versionsresponse, so the updater's existing fallback runs. This is local mounted-source evidence, not hosted rollout.