]> Cypherpunks repositories - gostls13.git/commit
cmd/go: check that expected Origin fields are present to reuse module info
authorBryan C. Mills <bcmills@google.com>
Thu, 16 Nov 2023 19:11:18 +0000 (14:11 -0500)
committerGopher Robot <gobot@golang.org>
Fri, 17 Nov 2023 21:25:34 +0000 (21:25 +0000)
commitbb8a96fa547985168241eea72ee2bec15e749eff
tree40839a254dcf03e66b8efe2ab104e743dad13a71
parent3ff5632d63b820fbcbb4b69e47ec586d59bf5ea5
cmd/go: check that expected Origin fields are present to reuse module info

When 'go list' or 'go mod download' uses a proxy to resolve a version
query like "@latest", it may have origin metadata about the resolved
version but not about the inputs that would be needed to resolve the
same query without using the proxy.

We shouldn't just redact the incomplete information, because it might
be useful independent of the -reuse flag. Instead, we examine the
query to decide which origin information it ought to need, and avoid
reusing it if that information isn't included.

Fixes #61423.

Change-Id: Ibeaa46ebba284beee285cbb1898e271e5a5b257b
Cq-Include-Trybots: luci.golang.try:gotip-linux-amd64-longtest,gotip-windows-amd64-longtest
Reviewed-on: https://go-review.googlesource.com/c/go/+/543155
Reviewed-by: Michael Matloob <matloob@golang.org>
Commit-Queue: Bryan Mills <bcmills@google.com>
Auto-Submit: Bryan Mills <bcmills@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
src/cmd/go/internal/modfetch/codehost/codehost.go
src/cmd/go/internal/modload/build.go
src/cmd/go/internal/modload/query.go
src/cmd/go/testdata/script/mod_list_issue61423.txt [new file with mode: 0644]