Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dependency: bump dependabot dependencies #15862

Merged
merged 3 commits into from
May 11, 2023
Merged

Conversation

pchan
Copy link
Contributor

@pchan pchan commented May 9, 2023

Please read https://github.com/etcd-io/etcd/blob/main/CONTRIBUTING.md#contribution-flow.

I have manually bumped the following direct dependencies. Only the first one below has been raised by dependabot. The rest were raised as indirect dependencies.

  1. bump golang.org/x/sys from 0.7.0 to 0.8.0
  2. bump golang.org/x/sync from 0.1.0 to 0.2.0
  3. bump golang.org/x/net from 0.9.0 to 0.10.0

A lot of dependencies in tools/mod are indirect dependencies so haven't bumped them.

cc: @ahrtr @jmhbnz

Signed-off-by: Prasad Chandrasekaran <prasadc@vmware.com>
Copy link
Member

@jmhbnz jmhbnz left a comment

Choose a reason for hiding this comment

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

LGTM - Thanks for taking care of dependencies this week @pchan 🙏🏻

@ahrtr
Copy link
Member

ahrtr commented May 9, 2023

When we bump a dependency of mixed case, in which some modules directly while others indirectly depend on a dependency, we should try to bump the dependency for all modules, no matter it's direct or indirect dependency.

Let's use golang.org/x/sys as an example in this PR, you bumped it to 0.8.0 for part of the modules. Some modules (e.g. ago.etcd.io/etcd/api/v3 ) are still depending on the old version 0.7.0.

Copy link
Member

@ahrtr ahrtr left a comment

Choose a reason for hiding this comment

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

Please try to ensure all modules depend on the same version of each dependency.

@ahrtr
Copy link
Member

ahrtr commented May 11, 2023

ping @pchan

Please try to get this PR done this week, as there will be another round of dependency bumping next week.

pchan added 2 commits May 11, 2023 18:00
Signed-off-by: Prasad Chandrasekaran <prasadc@vmware.com>
Signed-off-by: Prasad Chandrasekaran <prasadc@vmware.com>
@pchan
Copy link
Contributor Author

pchan commented May 11, 2023

When we bump a dependency of mixed case, in which some modules directly while others indirectly depend on a dependency, we should try to bump the dependency for all modules, no matter it's direct or indirect dependency.

When I went through the indirect section (link) of the guide, I got the impression that we will have to update indirect dependencies only via upgrading direct dependencies. This would have involved analysing dependency graph etc. But all I had to do was to use go get package@version to upgrade indirect dependencies just like direct ones. For folks who are new, I can drop a line in the guide highlighting this.

Copy link
Member

@chaochn47 chaochn47 left a comment

Choose a reason for hiding this comment

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

LGTM.

Should indirect dependencies specified in tools/go.mod be upgraded? For example github.com/zmap/zlint/v3. From the guidance, looks like not. It's not a big issue though.

@ahrtr
Copy link
Member

ahrtr commented May 11, 2023

When I went through the indirect section (link) of the guide, I got the impression that we will have to update indirect dependencies only via upgrading direct dependencies.

No matter direct or indirect dependency, once we decide to bump it, we follow the same guide below,

Copy link
Member

@ahrtr ahrtr left a comment

Choose a reason for hiding this comment

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

LGTM

Thanks @pchan

@ahrtr
Copy link
Member

ahrtr commented May 11, 2023

Should indirect dependencies specified in tools/go.mod be upgraded? For example github.com/zmap/zlint/v3. From the guidance, looks like not. It's not a big issue though.

Correct. I will let it in this time, but please try to follow #indirect-dependencies.

@ahrtr ahrtr merged commit 67ec1a4 into etcd-io:main May 11, 2023
@pchan
Copy link
Contributor Author

pchan commented May 12, 2023 via email

@pchan
Copy link
Contributor Author

pchan commented May 12, 2023

Correct. I will let it in this time, but please try to follow #indirect-dependencies.

Can you please be specific on which indirect dependency was left out. The commit db07ec9 addresses the zmap/zlint one. I had added it as a separate commit.

Every dependabot PR marked as complete in #15862 (comment) can be closed

@ahrtr
Copy link
Member

ahrtr commented May 12, 2023

Note that github.com/zmap/zlint/v3 is directly depended on by https://github.com/cloudflare/cfssl, the better way is to push cfssl to bump zlint, and afterwards etcd bumps new cfssl version.

FYI.

@fuweid
Copy link
Member

fuweid commented May 12, 2023

@ahrtr Thanks for taking this follow-up!

@pchan
Copy link
Contributor Author

pchan commented May 12, 2023

Note that github.com/zmap/zlint/v3 is directly depended on by https://github.com/cloudflare/cfssl, the better way is to push cfssl to bump zlint, and afterwards etcd bumps new cfssl version.

FYI.

Thanks for the context. To find the direct dependency, I ran the go mod why command [1]. It lists cfssl but also go.etcd.io/etcd/tools/v3. For golang.org/x/sys in tools/mod I see other listings [2]. Do you have any specific mechanism to idenitfy the direct dependency unambiguously ?

[1]

~: go mod why -m github.com/zmap/zlint/v3
# github.com/zmap/zlint/v3
go.etcd.io/etcd/tools/v3
github.com/cloudflare/cfssl/cmd/cfssl
github.com/cloudflare/cfssl/cli
github.com/cloudflare/cfssl/config
github.com/zmap/zlint/v3

[2]

go mod why -m golang.org/x/sys
# golang.org/x/sys
go.etcd.io/etcd/tools/v3
github.com/gordonklaus/ineffassign
golang.org/x/tools/go/packages
golang.org/x/sys/execabs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants