Skip to content

add --additional-autoupdateable-dependencies option#468

Open
majewsky wants to merge 1 commit intomainfrom
autoupdate-deps-sidechannel
Open

add --additional-autoupdateable-dependencies option#468
majewsky wants to merge 1 commit intomainfrom
autoupdate-deps-sidechannel

Conversation

@majewsky
Copy link
Contributor

In order to further reduce the amount of work from having to approve the same dependency update multiple times, I would like to have the go-makefile-maker pipeline consider go.mod files of our library repos (e.g. go-bits and gophercloud-sapcc). This would allow external dependency updates that were vetted there to automatically bubble through even into repos that do not depend on those libraries directly.

In order to further reduce the amount of work from having to approve the
same dependency update multiple times, I would like to have the
go-makefile-maker pipeline consider go.mod files of our library repos
(e.g. go-bits and gophercloud-sapcc). This would allow external
dependency updates that were vetted there to automatically bubble
through even into repos that do not depend on those libraries directly.
@majewsky majewsky requested a review from a team as a code owner March 13, 2026 15:38
@github-actions
Copy link
Contributor

Merging this branch will not change overall coverage

Impacted Packages Coverage Δ 🤖
github.com/sapcc/go-makefile-maker 0.00% (ø)
github.com/sapcc/go-makefile-maker/internal/golang 0.00% (ø)

Coverage by file

Changed files (no unit tests)

Changed File Coverage Δ Total Covered Missed 🤖
github.com/sapcc/go-makefile-maker/internal/golang/update-deps.go 0.00% (ø) 51 (+27) 0 51 (+27)
github.com/sapcc/go-makefile-maker/main.go 0.00% (ø) 0 0 0

Please note that the "Total", "Covered", and "Missed" counts above refer to code statements instead of lines of code. The value in brackets refers to the test coverage of that file in the old version of the code.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new CLI option intended to widen Go dependency autoupdate eligibility by considering dependency versions from other repositories’ go.mod files (so “already vetted elsewhere” updates can propagate automatically).

Changes:

  • Adds --additional-autoupdateable-dependencies flag and threads runtime autoupdate config into the updater.
  • Extends the Go dependency autoupdate logic to parse additional go.mod files and selectively upgrade shared modules to newer versions found there.
  • Updates README documentation for the expanded autoupdate behavior.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 6 comments.

File Description
main.go Adds new CLI flag and passes runtime autoupdate configuration into the Go updater.
internal/golang/update-deps.go Implements “approved-by-other-go.mod” version comparisons and module upgrades.
README.md Documents the two autoupdate mechanisms (regex-based and additional go.mod-based).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

@@ -75,7 +77,7 @@ func main() {

if flags.AutoupdateDeps && cfg.Golang.AutoupdateableDepsRx != "" {
ShowHelp bool
}
pflag.BoolVar(&flags.AutoupdateDeps, "autoupdate-deps", false, "autoupdate dependencies matching the golang.autoupdateableDeps config option (if any)")
pflag.BoolVar(&flags.AutoupdateDeps, "autoupdate-deps", false, "try to autoupdate dependencies matched by the golang.autoupdateableDeps config option or the --approved-dependency-sets switch (if any)")
Comment on lines 28 to 29
// AutoupdateDependencies will run `go get -u $MODULEPATH@latest` for each
// direct dependency matching `cfg.AutoupdateableDepsRx`.
return None[string]()
}

// update dependencies matched by any of the ApprovedDependencySets
continue
}
if semver.Compare(ourVersion, req.Mod.Version) < 0 {
must.Succeed(runGo("get", "-u", req.Mod.Path+"@"+req.Mod.Version))
Comment on lines +256 to +259
Autoupdates can be configured in two ways:
- If `golang.autoupdateableDeps` is filled with a [regular expression](https://pkg.go.dev/regexp/syntax), all module dependencies matching that regex are upgraded using `go get -u $MODULE@latest`.
This is intended for internal dependencies that have already gone through approval processes as the code was developed.
- If `--additional-autoupdateable-dependencies /path/to/other/go.mod` is given, any dependencies shared by both our `go.mod` and the provided other `go.mod` file will be upgraded to the version in the other file (using `go get -u $MODULE@$VERSION`) if that version is newer.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants