container-storage-interface / spec

Container Storage Interface (CSI) Specification.
Apache License 2.0
1.34k stars 373 forks source link

pin golang version used by CI #542

Open jdef opened 1 year ago

jdef commented 1 year ago

When CI was migrated to github actions, the go version was pinned as a "min version" vs. "exact version" meaning that the version of Go used to produce generated code can shift unexpectedly - and result in unexpected differences at build time.

We should pin the exact Go version used to build.

humblec commented 1 year ago

@jdef considering the gh action use 1.19 , but as a package we have 1.18 in place https://github.com/container-storage-interface/spec/blob/master/go.mod#L3 , isnt this issue requesting to bump up the package declaration to 1.19 ? or you suggest to have 1.18 in CI which in parity with go mod?

jdef commented 1 year ago

Ideally the go.mod version would reflect the minimum that we support. So, yes, that's a factor to some degree. But we don't need to build with that version necessarily.

GitHub is building commits with 1.20 because we have "min 1.19" in the CI config.

I wrote this ticket because CI decided to start using 1.20 as soon as it was released. I'd argue that we want more control over that transition.

On Thu, Mar 9, 2023, 11:08 PM Humble Devassy Chirammal < @.***> wrote:

@jdef https://github.com/jdef considering the gh action use 1.19 , but as a package we have 1.18 in place https://github.com/container-storage-interface/spec/blob/master/go.mod#L3 , isnt this issue requesting to bump up the package declaration to 1.19 ?

— Reply to this email directly, view it on GitHub https://github.com/container-storage-interface/spec/issues/542#issuecomment-1463225501, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAR5KLHUUK6EKN3VP2C56D3W3KSNRANCNFSM6AAAAAAVV5BTME . You are receiving this because you were mentioned.Message ID: @.***>

humblec commented 1 year ago

one thing which I would suggest to use here is the matrix of versions, ie here in our case we will have a matrix of 1.18, 1.19 and 1.20. That would validate different versions in the CI.. let me file the PR..

jdef commented 1 year ago

A matrix will be problematic with respect to generated code: the pb.go will drift across Go versions.

Let's start by pinning a single version...

On Fri, Mar 10, 2023, 12:13 AM Humble Devassy Chirammal < @.***> wrote:

one thing which I would suggest to use here is the matrix of versions, ie here in our case we will have a matrix of 1.18, 1.19 and 1.20. That would validate different versions in the CI.. let me file the PR..

— Reply to this email directly, view it on GitHub https://github.com/container-storage-interface/spec/issues/542#issuecomment-1463286331, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAR5KLA7UXH4PF3FBWWIMKTW3KZ67ANCNFSM6AAAAAAVV5BTME . You are receiving this because you were mentioned.Message ID: @.***>