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

[release/2.8] bump up golang version #3812

Closed

Conversation

wy65701436
Copy link
Collaborator

upgrade go version to v1.18.8

Signed-off-by: Wang Yan wangyan@vmware.com

@codecov-commenter
Copy link

Codecov Report

Base: 58.72% // Head: 58.71% // Decreases project coverage by -0.01% ⚠️

Coverage data is based on head (aec0dcc) compared to base (dc5b207).
Patch has no changes to coverable lines.

Additional details and impacted files
@@               Coverage Diff               @@
##           release/2.8    #3812      +/-   ##
===============================================
- Coverage        58.72%   58.71%   -0.02%     
===============================================
  Files              102      102              
  Lines             7104     7102       -2     
===============================================
- Hits              4172     4170       -2     
  Misses            2286     2286              
  Partials           646      646              
Impacted Files Coverage Δ
src/github.com/docker/distribution/context/http.go 62.79% <0.00%> (-0.57%) ⬇️
....com/docker/distribution/notifications/listener.go 48.42% <0.00%> (ø)
.../docker/distribution/registry/client/repository.go 55.68% <0.00%> (ø)
.../docker/distribution/registry/storage/blobstore.go 57.31% <0.00%> (ø)
...docker/distribution/registry/handlers/basicauth.go 100.00% <0.00%> (ø)
...r/distribution/registry/storage/linkedblobstore.go 66.66% <0.00%> (ø)
...tribution/registry/storage/blobwriter_resumable.go 50.00% <0.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@thaJeztah thaJeztah changed the title bump up golang version [release/2.8] bump up golang version Dec 2, 2022
Copy link
Member

@thaJeztah thaJeztah left a comment

Choose a reason for hiding this comment

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

just some quick comments (haven't looked at the code changes yet)

.github/workflows/ci.yml Outdated Show resolved Hide resolved
Dockerfile Outdated Show resolved Hide resolved
@wy65701436 wy65701436 force-pushed the 2.8-go-1.18.8 branch 3 times, most recently from f4822b4 to 994987c Compare December 2, 2022 12:54
Copy link
Member

@thaJeztah thaJeztah left a comment

Choose a reason for hiding this comment

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

Thanks! Looks like there's still some unrelated changes and changes not in main in here; I left comments inline

Comment on lines +282 to +284
if offset >= int64(len(f.data)) {
return 0, io.EOF
}
Copy link
Member

Choose a reason for hiding this comment

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

This looks like it's not directly related to the Go update, or if it's needed, should be in it's own commit (cherry-pick); coming from

Backporting that fix is good, but should not be stuffed in together with a go update (if it's a separate PR, we can also point to it in the release notes)

Copy link
Collaborator Author

@wy65701436 wy65701436 Dec 4, 2022

Choose a reason for hiding this comment

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

this must be in, otherwise one UT will panic as mentioned in #3614

Copy link
Member

Choose a reason for hiding this comment

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

For sure, the fix is good, but it's not directly related to go1.18? My issue is mainly that stuffing bug fixes into a commit that only mentions "update go version" hides them.

This makes it hard to find back fixes;

Copy link
Collaborator Author

@wy65701436 wy65701436 Dec 4, 2022

Choose a reason for hiding this comment

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

This is not directly related to Go 1.18, but without this change, UT would have failed.

If I first try to pick a fix, like #3815, there are some faults on Go 1.16 that I don't think are worth investigating.

Copy link
Member

Choose a reason for hiding this comment

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

@wy65701436 do you want to rebase now that we've merged #3815

for cnt := range ctlg.Repositories {
entries[cnt] = ctlg.Repositories[cnt]
}
copy(entries, ctlg.Repositories)
Copy link
Member

Choose a reason for hiding this comment

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

This looks unrelated as well; looks like it was part of fbdfd1a; which is

Not sure if we want to backport that as a whole (it seems rather large), but if we want, should be separate.

Copy link
Collaborator Author

@wy65701436 wy65701436 Dec 4, 2022

Choose a reason for hiding this comment

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

copy(entries, ctlg.Repositories) is to fix a goci-lint failure, it must be in.

Copy link
Member

Choose a reason for hiding this comment

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

My approach for these is usually to update golangci-lint first, and any changes related to updated linters together with that update (same PR, depending on the number of fixes needed, same commit). This makes it transparent that updates were needed due to stricter linters.

Golang updates (besides the go install / @version changes, and in some cases replacing deprecated functions) should not require changes to the code; if they do, Go broke their Go 1 compatibility contract, which should be reported. Keeping the changes related to the Go update itself together, shows "this is what was needed to update go" (which should be "only update the version")

Copy link
Collaborator Author

@wy65701436 wy65701436 Dec 4, 2022

Choose a reason for hiding this comment

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

So, in general, you would want us to fix all the prerequisites for the go upgrade, and then have this pr focus only on the go version upgrade.

i understand, but, it's not easy to decouple the fix for golangci-lint from the version upgrade of go, because there is some correlation between the versions of go and golangci-lint. Put all these changes together because they are what is needed for the upgraded version from the point of view of code changes.

releases/v2.8.1.toml Outdated Show resolved Hide resolved
// used if the registry is run after a go get based install.
// used if the registry is run after a go install based install.
Copy link
Member

Choose a reason for hiding this comment

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

Looks like we didn't update this in the main branch; we should do it there as well;
https://github.com/distribution/distribution/blob/92d136e113cf34fcfd5f0c21fadf6eac2f39e803/version/version.sh#LL20

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

will raise pr on main later.

script/validate/dco Outdated Show resolved Hide resolved
BUILDING.md Outdated Show resolved Hide resolved
BUILDING.md Outdated Show resolved Hide resolved
if strings.HasPrefix(keyStr, "vars.") {
keyStr = strings.TrimPrefix(keyStr, "vars.")
}

if v, ok := ctx.vars[keyStr]; ok {
if v, ok := ctx.vars[strings.TrimPrefix(keyStr, "vars.")]; ok {
Copy link
Member

Choose a reason for hiding this comment

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

This change is unrelated, and looks to be part of 3b391d3;

I suggest reverting this; if we want the other changes, we should backport it as a whole and having this partial change will complicate that (result in merge conflicts)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

again, it's to fix a goci-lint failure.

upgrade go version to v1.18.8

Signed-off-by: Wang Yan <wangyan@vmware.com>
@milosgajdos
Copy link
Member

Ping @thaJeztah

@thaJeztah
Copy link
Member

I had a look at the changes included in this PR, and where they came from; opened an alternative with those changes applied / cherry-picked separately (separate commits), and rebased this PR on top to check for the diff; see #3903

@milosgajdos
Copy link
Member

Closing, #3908 switched 2.8.X to Go 1.19

@milosgajdos milosgajdos closed this May 9, 2023
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.

None yet

4 participants