Giter VIP home page Giter VIP logo

Comments (7)

ahrtr avatar ahrtr commented on July 4, 2024 1

We should follow the same rule to manage go version for all repositories under etcd-io. Note we only require users to depend on a minor version supported by golang team, i.e. 1.21, but we don't force users to depend on a patch version, i.e. 1.21.10.

from etcd.

MadhavJivrajani avatar MadhavJivrajani commented on July 4, 2024

One problem is that if a dependency sets a higher go or toolchain version, then when running scripts/fix.sh will automatically update the go & toolchain version in our go.mod files.

We are trying to be more careful about this situation in Kubernetes (ref: kubernetes/kubernetes#123744).

One thing we should keep in mind here also is that if dependabot bumps the go directive of the root go.mod and we don't reflect that change in the .go-version file then it could be problematic for reasons similar to kubernetes/kubernetes#123744, if that happens, we are in a situation where:

  • We build with a go version that is in .go-version, because the release GH action uses that as source of truth.
  • However, if the go directive in go.mod is newer, go will default the values of GODEBUG based on the value of the go directive (see https://go.dev/doc/godebug). This will alter the runtime behaviour because the user might expect behaviour similar to whatever the go directive is, but the actual behaviour is that of .go-version.

In Kubernetes we added a pre-submit check to catch such accidental bumps if they occur: kubernetes/kube-openapi#467

from etcd.

ahrtr avatar ahrtr commented on July 4, 2024

In Kubernetes we added a pre-submit check to catch such accidental bumps if they occur: kubernetes/kube-openapi#467

Thanks @MadhavJivrajani

I think we should do similar check for all etcd branches: including release-3.4, release-3.4 and main.

The other potential enhancement is to automatically populate the go versions for the go and toolchain lines in all go.mod (and go.sum) files based on the .go-version file.

from etcd.

MadhavJivrajani avatar MadhavJivrajani commented on July 4, 2024

I have some ideas on how we can go about doing this. Will create a PR and we can discuss there!

from etcd.

ahrtr avatar ahrtr commented on July 4, 2024

Followups:

from etcd.

ahrtr avatar ahrtr commented on July 4, 2024

I think we also need to backport the changes to both 3.5 and 3.4

from etcd.

ivanvc avatar ivanvc commented on July 4, 2024

Cross-posting and quoting my comment from #17876 (comment):

This implementation is great (referring to #17876) and simplifies what would be tedious if done by hand. We recently had the Go version updated by a new contributor, and I believe it wasn't very clear to him how to update the toolchain in the different go.mod files (refer to: #17975 (comment)). I think we would benefit from documenting this somewhere in the repository.
A potential improvement regarding documentation would be to document how to update the Go version. In the main branch with this new script, I think it's as easy as updating the value in .go-version and running make fix after 🎉

from etcd.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.