-
Notifications
You must be signed in to change notification settings - Fork 265
chore: Bump go version to 1.22 and update dependencies - (#685) #686
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
base: main
Are you sure you want to change the base?
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #686 +/- ##
==========================================
- Coverage 83.21% 78.54% -4.67%
==========================================
Files 28 41 +13
Lines 3413 4051 +638
==========================================
+ Hits 2840 3182 +342
- Misses 458 753 +295
- Partials 115 116 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
.github/workflows/test.yml
Outdated
@@ -8,7 +8,7 @@ jobs: | |||
test: | |||
strategy: | |||
matrix: | |||
go-version: [ 1.16.x, 1.17.x, oldstable, stable ] # Lowest supported and current stable versions. | |||
go-version: [ 1.22.x, 1.23.x, 1.24.x, oldstable, stable ] # Lowest supported and current stable versions. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1.23
and 1.24
are already here as oldstable
and stable
.
I think we can migrate to a list like [<min_supported>, oldstable, stable]
, which would target the newest versions as main ones, but also will force backwards compatibility for users that lag behind.
I agree go1.16
feels too old to support, although I would not be terribly surprised to still find enterprise godog
users still stuck at 1.16.
Let's bump minimal supported version to 1.18 (3 years old now), wdyt?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @vearutop
Noted for 1.23
and 1.24
, I will remove them
About the minimum version, supporting only the 2 last versions can be hard as it changes every 6 months. So I put 1.22
as the 1.25
will come out "soon" (as I don't think a new version of godog will be out before), like this we have the 4 last versions covered.
Talking about 1.18
, I understand your comment, but I prefer to keep things updated as much as possible. It's a good practice to keep their stack updated, so if enterprises want to use the new version, they will have to update their version. I will completly understand if there was a LTS version, but it's not the case.
Also I want to avoid the case where someone need to downgrade their version to be able to use a tool. (I had this case multiple times recently) So that's why it was for me a good compromise.
After if it's the project direction (to support the 6 last versions), I don't have any issue about it, and we will need to be documented to not forget about it later. ^^
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is indeed a good practice to keep tech stack up to date, however it is not always feasible for large long-living projects. Forcing such users into an upgrade is a mild violation of backwards compatibility. It may still be an okay price to pay, given there are substantial advantages and clear justification.
For example, https://github.com/rs/zerolog/blob/master/go.mod still requires go1.15
, even though this library receives regular updates. That's a friendly attitude towards users.
Also I want to avoid the case where someone need to downgrade their version to be able to use a tool. (I had this case multiple times recently) So that's why it was for me a good compromise.
Could you share some context why the downgrade was needed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Another aspect to consider is that Godog is an unfunded opensource project. The most important resource it has are its maintainers and contributors. Keeping the required go version somewhat recent lowers the barrier to entry for those - nobody likes working on really old stuff.
So I would suggest striking a balance. For example, the minimum required Go version could be the oldest support major Go release. That will impact users that don't keep their stack up to date. But unless they're paying for the privilege or are an active participants in the project, I don't see why that should be a problem for the participants in the Godog project.
Forcing such users into an upgrade is a mild violation of backwards compatibility. It may still be an okay price to pay, given there are substantial advantages and clear justification.
Godog is currently on major version 0, so following Semver that would allow for any breaking changes at any moment. Users should expect breaking changes inside this major. If Godog were at v1, then changing the required go version would be a breaking change that should result in a new major release.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For example, https://github.com/rs/zerolog/blob/master/go.mod still requires go1.15, even though this library receives regular updates. That's a friendly attitude towards users.
I completly understand, but on the other hand, being late on the versioning makes your code at risk. Golang have CVE in the primary packages which are fixed in later versions. Also they add new features which can be helpful, so you can't take advantage of it
So clearly it's a project directive and a choice to make ^^ I don't want to force something, that's why I asked on discord , I'm open to discuss about it here and why I want to document it once decided ^^
Could you share some context why the downgrade was needed?
Yes sure. If you have two libraries using a third one, and the third one is in "0.x.x", so you can have breaking changes in the same major version. If one of these two libraries is not updated, I might still use the old version of it and downgrade the other one.
So clearly it's an edge case for the majority. (I work with a lot of 0.x.x direct and indirect dependencies, which can explain why I encounter this issue)
Godog currently only have one dependency with a "0.x.x" version, so it should be fine ^^ But if we improve the project, add other dependencies... it can happend while this project is in "0.x.x"
And once again, if we want to keep an older version, no issues by my side. We just need someone to confirm the direction that we want to keep ^^
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me. Small nitpick about format strings.
internal/formatters/fmt_progress.go
Outdated
@@ -42,7 +42,7 @@ func (f *Progress) Summary() { | |||
left := math.Mod(float64(*f.Steps), float64(f.StepsPerRow)) | |||
if left != 0 { | |||
if *f.Steps > f.StepsPerRow { | |||
fmt.Fprintf(f.out, s(f.StepsPerRow-int(left))+fmt.Sprintf(" %d\n", *f.Steps)) | |||
fmt.Fprintf(f.out, "%s", s(f.StepsPerRow-int(left))+fmt.Sprintf(" %d\n", *f.Steps)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it make sense to replace the string concatenation with a format string like %s %d\n
here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes it does, I will do the change
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note: This file has been added to test correctly the case where godog package has been vendored. As I need to stub some variables from the builder
package, I needed to create a dedicated test file for it. Otherwise, I can't access these variables. (The other test file being in the builder_test
package.)
codecov/project is not happy on code that I haven't added... ^^" Is it normal ? |
go.mod
Outdated
@@ -1,18 +1,28 @@ | |||
module github.com/cucumber/godog | |||
|
|||
go 1.16 | |||
go 1.22 | |||
|
|||
require ( | |||
github.com/cucumber/gherkin/go/v26 v26.2.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this is equivalent to the changes here: #677
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch, I will do the update
🤔 What's changed?
Golang version has been updated to 1.22, breaking changes have been fixed, dependencies have been updated.
⚡️ What's your motivation?
Fixes #685
🏷️ What kind of change is this?
📋 Checklist: