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

[3.4] Backport bump to go 1.19.6 and golang.org/x/net to v0.7.0 #15333

Merged
merged 3 commits into from
Mar 3, 2023

Conversation

jmhbnz
Copy link
Member

@jmhbnz jmhbnz commented Feb 17, 2023

Golang 1.17 is out of support; and all active K8s branches (1.23 ~ 1.26) have already bumped to 1.19.

Additionally the x/net package has a CVE we need to address: https://pkg.go.dev/vuln/GO-2023-1571

Part of #15332

@ahrtr
Copy link
Member

ahrtr commented Feb 18, 2023

Note:

  1. You can ignore the Release's failure for now. It's because it's running against the latest code in branch release-3.4 instead of your dev branch.
  2. You need to run gofmt to format the source code.
  3. Usually 3.5's golang version should never < 3.4. So we should bump 3.5 firstly.

@jmhbnz
Copy link
Member Author

jmhbnz commented Feb 19, 2023

Note:

2. You need to run `gofmt` to format the source code.

I must be missing something when it comes to gofmt, on my branch if I ./test the tests execute successfully and I see 'gofmt' completed at Sun 19 Feb 2023 18:59:50 NZDT in the results. Even a gofmt -w *.go results in no new diff. Any ideas where I am going wrong?

@jmhbnz
Copy link
Member Author

jmhbnz commented Feb 19, 2023

@ahrtr I notice there are additional references to golang.org/x/net v0.4.0 in the subdirectory go.mod files i.e. for etcdctl. Would you like these to also be updated?

@ahrtr
Copy link
Member

ahrtr commented Feb 19, 2023

Even a gofmt -w *.go results in no new diff.

You need to make sure your local go version is 1.19.6 when you execute gofmt command.

@ahrtr I notice there are additional references to golang.org/x/net v0.4.0 in the subdirectory go.mod files i.e. for etcdctl. Would you like these to also be updated?

release-3.4 has only one top level go.mod file. I assume you are talking about release-3.5. Yes, we need to get all these updated. Please run the following commands something like below,

for module in server api pkg
do
    cd ${YOUR_ETCD_REPO_ROOT}/${module}
    go get golang.org/x/net@v0.7.0
    cd ${YOUR_ETCD_REPO_ROOT}
   ./scripts/fix.sh 
done

@jmhbnz
Copy link
Member Author

jmhbnz commented Feb 19, 2023

Even a gofmt -w *.go results in no new diff.

You need to make sure your local go version is 1.19.6 when you execute gofmt command.

Hmm this is weird, I am on 1.19.6. If I run the exact command that the github workflow is running I don't see any failure or diff?

Here is what I'm seeing for 3.4:

~  Documents  etcd   release-3.4  last: 0m 0s  go version
go version go1.19.6 linux/amd64

 ~  Documents  etcd   release-3.4  last: 0m 0s  GOARCH=amd64 PASSES='fmt bom dep' ./test
Running with TEST_CPUS: 1,2,4
Starting 'fmt' pass at Mon 20 Feb 2023 10:34:43 NZDT
'shellcheck' started at Mon 20 Feb 2023 10:34:43 NZDT
'shellcheck' completed at Mon 20 Feb 2023 10:34:43 NZDT
'markdown_you' started at Mon 20 Feb 2023 10:34:43 NZDT
'markdown_you' completed at Mon 20 Feb 2023 10:34:43 NZDT
'markdown_marker' started at Mon 20 Feb 2023 10:34:43 NZDT
Skipping marker...
'markdown_marker' completed at Mon 20 Feb 2023 10:34:43 NZDT
'goword' started at Mon 20 Feb 2023 10:34:43 NZDT
Skipping goword...
'goword' completed at Mon 20 Feb 2023 10:34:43 NZDT
'gofmt' started at Mon 20 Feb 2023 10:34:43 NZDT
'gofmt' completed at Mon 20 Feb 2023 10:34:43 NZDT
'govet' started at Mon 20 Feb 2023 10:34:43 NZDT
'govet' completed at Mon 20 Feb 2023 10:34:44 NZDT
'revive' started at Mon 20 Feb 2023 10:34:44 NZDT
Skipping revive...
'revive' completed at Mon 20 Feb 2023 10:34:44 NZDT
'license_header' started at Mon 20 Feb 2023 10:34:44 NZDT
'license_header' completed at Mon 20 Feb 2023 10:34:45 NZDT
'receiver_name' started at Mon 20 Feb 2023 10:34:45 NZDT
'receiver_name' completed at Mon 20 Feb 2023 10:34:45 NZDT
'commit_title' started at Mon 20 Feb 2023 10:34:45 NZDT
'commit_title' completed at Mon 20 Feb 2023 10:34:45 NZDT
Finished 'fmt' pass at Mon 20 Feb 2023 10:34:45 NZDT
Starting 'bom' pass at Mon 20 Feb 2023 10:34:45 NZDT
Finished 'bom' pass at Mon 20 Feb 2023 10:34:45 NZDT
Starting 'dep' pass at Mon 20 Feb 2023 10:34:45 NZDT
Checking package dependencies...
Finished 'dep' pass at Mon 20 Feb 2023 10:34:45 NZDT
Success


 ~  Documents  etcd   release-3.4  last: 0m 4s  git status
On branch release-3.4
Your branch is up to date with 'origin/release-3.4'.

nothing to commit, working tree clean

Let me know if you have any ideas on what else might be causing the failure in actions versus nothing in local 🙏🏻

@ahrtr I notice there are additional references to golang.org/x/net v0.4.0 in the subdirectory go.mod files i.e. for etcdctl. Would you like these to also be updated?

release-3.4 has only one top level go.mod file. I assume you are talking about release-3.5. Yes, we need to get all these updated. Please run the following commands something like below,

Apologies yes I was referring to 3.5, have pushed those changes in the other PR 👍🏻

@ahrtr
Copy link
Member

ahrtr commented Feb 19, 2023

Let me know if you have any ideas on what else might be causing the failure in actions versus nothing in local 🙏🏻

Please run command something like below (For release-3.5, you can execute ./scripts/fix.sh),

$gofmt -w .

Note that the file pkg/adt/interval_tree.go may be formatted very ugly, please refer to dd7d300 how I resolved it previously.

@ahrtr
Copy link
Member

ahrtr commented Feb 19, 2023

Note please also try to breakdown the changes into a couple of small commits. For example,

  1. bump golang version to 1.19.6
  2. bump golang.org/x/net to v0.7.0
  3. format the source code using 1.19.6 (At least this should be in a separate commit, as it will be a big change).

This comment applies to the PR for 3.5 as well.

Signed-off-by: James Blair <mail@jamesblair.net>
Signed-off-by: James Blair <mail@jamesblair.net>
Signed-off-by: James Blair <mail@jamesblair.net>
@jmhbnz jmhbnz marked this pull request as ready for review February 20, 2023 00:02
@ptabor ptabor merged commit 20eee55 into etcd-io:release-3.4 Mar 3, 2023
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.

4 participants