3 ms·
Ask HN: Bulk updating of GO module dependencies?
Consider: A CD/CI system knows the URLs of N GO repos, because programmers have enrolled them.
One of the repos, n, just got a PR submitted. So now it's time for the CD/CI to build and run tests etc.. If all that is successful, we'd like to effect the following:
For every library or program which depends on repo `n` either directly or indirectly run "go mod update" until done.
The hard part is doing so until "done" because updating mod files will often lead to a cascade of such updates which are order dependent. Ex: we know repo n changed by assumption: a PR was approved. Now further suppose we have this dependency chain:
* Repo o depends on n
* Repo p depends on o
* Repo q depends on n
Clearly we want to update o, p, q. However, for the case of p we want to update it only after we update o.
Now don't get me wrong ... one can do `go mod graph` and go for it ... my question: is this a solved problem with a best practice?
- verdverm 5y agoFor Go modules, does this order matter? Or another way, for MVS, does the order matter? What happens when p comes before o? What are the differences between major and minor version updates?
- scrubs 5y agoIs there a command that elicits or demonstrates MVS. This page is good explaining what MVS is: https://research.swtch.com/vgo-mvs https://research.swtch.com/vgo-mvs Same with less detail (see bottom of page): https://encore.dev/guide/go.mod https://encore.dev/guide/go.mod
- verdverm 5y agoI suspect that it does not matter, because eventually you end up with the full list to decide MVS from. No proof on hand though I've implemented a generic (language independent) here https://github.com/hofstadter-io/hof/blob/_dev/lib/mod/modder/modder_vendor.go https://github.com/hofstadter-io/hof/blob/_dev/lib/mod/modde...
- scrubs 5y agoIn part to answer my own questions from https://golang.org/doc/modules/gomod-ref https://golang.org/doc/modules/gomod-ref We read: * ... * ... * A list of minimum versions of other modules required by the current module. * ... Meaning after running `go mod tidy` go.mod has that MVS build dependency list.