Skip to content

[NET-6741] make: Add target for updating dependencies across all modules#449

Merged
zalimeni merged 1 commit into
mainfrom
zalimeni/net-6741-add-make-target-dependency-update-modules
Feb 21, 2024
Merged

[NET-6741] make: Add target for updating dependencies across all modules#449
zalimeni merged 1 commit into
mainfrom
zalimeni/net-6741-add-make-target-dependency-update-modules

Conversation

@zalimeni
Copy link
Copy Markdown
Member

To enable more consistent and error-proof dependency management, add a Make target that will set a dependency version across all submodules that require it.

Replicates hashicorp/consul#19785 in consul-dataplane.

This really just ensures the main go.mod stays in sync w/ int tests for now, but could help more in the future.

How I've tested this PR

Example run:

❯ make go-mod-get DEP_VERSION=github.com/hashicorp/go-hclog@v1.5.0
--> Running go get github.com/hashicorp/go-hclog@v1.5.0 (.)
go: upgraded github.com/hashicorp/go-hclog v1.2.2 => v1.5.0
--> Running go mod tidy (.)
--> Running go get github.com/hashicorp/go-hclog@v1.5.0 (./integration-tests)
go: upgraded github.com/hashicorp/go-hclog v1.2.2 => v1.5.0
--> Running go mod tidy (./integration-tests)

❯ git status
On branch zalimeni/net-6741-add-make-target-dependency-update-modules
Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git restore <file>..." to discard changes in working directory)
	modified:   go.mod
	modified:   go.sum
	modified:   integration-tests/go.mod
	modified:   integration-tests/go.sum

To enable more consistent and error-proof dependency management, add a
Make target that will set a dependency version across all submodules
that require it.

Also runs `go mod tidy`. This first ensures the dependency addition is
reverted if the module in question does not require it; it also ensures
that any additional cleanup needed in `go.mod`/`go.sum` is applied.
@zalimeni zalimeni added pr/no-changelog This PR does not introduce a user-facing change that should be reflected in the changelog backport/1.1 Changes are backported to 1.1 backport/1.2 backport/1.4 Changes are backported to 1.4 labels Feb 21, 2024
@zalimeni zalimeni requested a review from curtbushko February 21, 2024 17:01
@zalimeni zalimeni requested a review from a team as a code owner February 21, 2024 17:01
@zalimeni zalimeni enabled auto-merge (squash) February 21, 2024 17:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport/1.1 Changes are backported to 1.1 backport/1.4 Changes are backported to 1.4 pr/no-changelog This PR does not introduce a user-facing change that should be reflected in the changelog

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants