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-17.0] Bumps deps and use proper Go version in upgrade tests #15408

Merged
merged 6 commits into from
Mar 14, 2024

Conversation

frouioui
Copy link
Member

@frouioui frouioui commented Mar 5, 2024

Description

This is a follow-up of the changes made in #15407

Also contains the changes done in #15426

Signed-off-by: Florent Poinsard <[email protected]>
Copy link
Contributor

vitess-bot bot commented Mar 5, 2024

Review Checklist

Hello reviewers! 👋 Please follow this checklist when reviewing this Pull Request.

General

  • Ensure that the Pull Request has a descriptive title.
  • Ensure there is a link to an issue (except for internal cleanup and flaky test fixes), new features should have an RFC that documents use cases and test cases.

Tests

  • Bug fixes should have at least one unit or end-to-end test, enhancement and new features should have a sufficient number of tests.

Documentation

  • Apply the release notes (needs details) label if users need to know about this change.
  • New features should be documented.
  • There should be some code comments as to why things are implemented the way they are.
  • There should be a comment at the top of each new or modified test to explain what the test does.

New flags

  • Is this flag really necessary?
  • Flag names must be clear and intuitive, use dashes (-), and have a clear help text.

If a workflow is added or modified:

  • Each item in Jobs should be named in order to mark it as required.
  • If the workflow needs to be marked as required, the maintainer team must be notified.

Backward compatibility

  • Protobuf changes should be wire-compatible.
  • Changes to _vt tables and RPCs need to be backward compatible.
  • RPC changes should be compatible with vitess-operator
  • If a flag is removed, then it should also be removed from vitess-operator and arewefastyet, if used there.
  • vtctl command output order should be stable and awk-able.

@vitess-bot vitess-bot bot added NeedsBackportReason If backport labels have been applied to a PR, a justification is required NeedsDescriptionUpdate The description is not clear or comprehensive enough, and needs work NeedsIssue A linked issue is missing for this Pull Request NeedsWebsiteDocsUpdate What it says labels Mar 5, 2024
@frouioui frouioui added Component: General Changes throughout the code base Type: Dependencies Dependency updates go and removed NeedsDescriptionUpdate The description is not clear or comprehensive enough, and needs work NeedsWebsiteDocsUpdate What it says NeedsIssue A linked issue is missing for this Pull Request NeedsBackportReason If backport labels have been applied to a PR, a justification is required labels Mar 5, 2024
@github-actions github-actions bot added this to the v17.0.6 milestone Mar 5, 2024
Signed-off-by: Florent Poinsard <[email protected]>
@frouioui frouioui force-pushed the bump-upgrade-tests branch from d151635 to 244f0e5 Compare March 5, 2024 22:52
frouioui added 2 commits March 8, 2024 18:08
Signed-off-by: Florent Poinsard <[email protected]>
Signed-off-by: Florent Poinsard <[email protected]>
@systay systay mentioned this pull request Mar 13, 2024
22 tasks
@shlomi-noach
Copy link
Contributor

shlomi-noach commented Mar 13, 2024

This PR consistently fails Static Code Checks, Etc.:

go: downloading google.golang.org/protobuf v1.31.0
go: downloading github.com/mattn/go-runewidth v0.0.9
go: downloading github.com/matttproud/golang_protobuf_extensions v1.0.1
Error: ../../../go/pkg/mod/github.com/golangci/[email protected]/pkg/config/reader.go:8:2: package slices is not in GOROOT (/opt/hostedtoolcache/go/1.20.13/x64/src/slices)
note: imported by a module that requires go 1.21
Error: Process completed with exit code 1.

I tried downgrading the golangci-lint version to 1.52.2 (which is what is used right now in release-17.0). but that breaks git commit (?). Not sure how to go about it.

Signed-off-by: Florent Poinsard <[email protected]>
@deepthi
Copy link
Member

deepthi commented Mar 13, 2024

This PR consistently fails Static Code Checks, Etc.:

go: downloading google.golang.org/protobuf v1.31.0
go: downloading github.com/mattn/go-runewidth v0.0.9
go: downloading github.com/matttproud/golang_protobuf_extensions v1.0.1
Error: ../../../go/pkg/mod/github.com/golangci/[email protected]/pkg/config/reader.go:8:2: package slices is not in GOROOT (/opt/hostedtoolcache/go/1.20.13/x64/src/slices)
note: imported by a module that requires go 1.21
Error: Process completed with exit code 1.

I tried downgrading the golangci-lint version to 1.52.2 (which is what is used right now in release-17.0). but that breaks git commit (?). Not sure how to go about it.

Using #15413 as a reference, I believe things should work if we change just static_checks_etc.yml, but not the git commit hook. Is that what you tried @shlomi-noach?

@shlomi-noach
Copy link
Contributor

shlomi-noach commented Mar 13, 2024

Is that what you tried @shlomi-noach?

Yes, sorry. This was the change I made:

diff --git a/.github/workflows/static_checks_etc.yml b/.github/workflows/static_checks_etc.yml
index faa0c76e3d..a6b751f221 100644
--- a/.github/workflows/static_checks_etc.yml
+++ b/.github/workflows/static_checks_etc.yml
@@ -166,7 +166,7 @@ jobs:

       - name: Install golangci-lint
         if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.go_files == 'true'
-        run: go install github.com/golangci/golangci-lint/cmd/[email protected]
+        run: go install github.com/golangci/golangci-lint/cmd/[email protected]

       - name: Clean Env
         if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.go_files == 'true'

and this, to my surprise, made git commit nuke itself:

$ git commit -sm "downgrade golangci-lint" .github/workflows/static_checks_etc.yml
panic: runtime error: invalid memory address or nil pointer dereference [recovered]
	panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x2 addr=0x0 pc=0x104eed590]

goroutine 464 gp=0x14000813340 m=9 mp=0x14000600008 [running]:
panic({0x105061960?, 0x10521a9b0?})
	/opt/homebrew/Cellar/go/1.22.0/libexec/src/runtime/panic.go:779 +0x140 fp=0x14000866450 sp=0x140008663a0 pc=0x104da1d40
go/types.(*Checker).handleBailout(0x14000842200, 0x14000867b98)
	/opt/homebrew/Cellar/go/1.22.0/libexec/src/go/types/check.go:367 +0x9c fp=0x14000866470 sp=0x14000866450 pc=0x104eb514c
go/types.(*Checker).checkFiles.deferwrap1()
	/opt/homebrew/Cellar/go/1.22.0/libexec/src/go/types/check.go:392 +0x2c fp=0x14000866490 sp=0x14000866470 pc=0x104eb560c
panic({0x105061960?, 0x10521a9b0?})
	/opt/homebrew/Cellar/go/1.22.0/libexec/src/runtime/panic.go:770 +0x124 fp=0x14000866540 sp=0x14000866490 pc=0x104da1d24
runtime.panicmem(...)
	/opt/homebrew/Cellar/go/1.22.0/libexec/src/runtime/panic.go:261
runtime.sigpanic()
	/opt/homebrew/Cellar/go/1.22.0/libexec/src/runtime/signal_unix.go:881 +0x308 fp=0x140008665a0 sp=0x14000866540 pc=0x104dbbbc8
go/types.(*StdSizes).Sizeof(0x0, {0x1050a7f50, 0x10521dba0})
	/opt/homebrew/Cellar/go/1.22.0/libexec/src/go/types/sizes.go:228 +0x320 fp=0x14000866610 sp=0x140008665b0 pc=0x104eed590
go/types.Sizes.Sizeof-fm({0x1050a7f50?, 0x10521dba0?})
	<autogenerated>:1 +0x44 fp=0x14000866640 sp=0x14000866610 pc=0x104f0b6d4
go/types.(*Config).sizeof(...)
	/opt/homebrew/Cellar/go/1.22.0/libexec/src/go/types/sizes.go:333
go/types.representableConst.func1({0x1050a7f50?, 0x10521dba0?})
...

@deepthi
Copy link
Member

deepthi commented Mar 13, 2024

Noting that even the commit hook should probably be using a version of the linter that is compatible with go1.20 (which is what we have in go.mod).

@frouioui frouioui requested a review from GuptaManan100 as a code owner March 14, 2024 07:02
@shlomi-noach shlomi-noach merged commit 0bafd96 into vitessio:release-17.0 Mar 14, 2024
101 checks passed
@shlomi-noach shlomi-noach deleted the bump-upgrade-tests branch March 14, 2024 07:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: General Changes throughout the code base go Type: Dependencies Dependency updates
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants