-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Clean up conditionals based on prior Ruby versions
Used standardrb in the process, so update the minimum Ruby version to 3.0 for this to work.
- Loading branch information
1 parent
211c088
commit 36bd065
Showing
7 changed files
with
16 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
ruby_version: "2.5" | ||
ruby_version: "3.0" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36bd065
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.
Was this intentionally released as a non-breaking change, and thus a "not-a-major" version bump?
Using the
...
operator, as noted in the git commit comment, is Ruby 3.0+ only. For Rails apps this isn't a huge deal, as they only deal with one version of Ruby at a time. For other libraries that depend on factory_bot this is awful (e.g. https://github.com/pboling/activerecord-transactionable/actions/runs/8169704061/job/22334293843). In that link the latest (broken) gem is installing fine on Ruby 2.5.I know there is a fair bit of disagreement over how SemVer is interpreted... and this is not serving the community very well.
The person who invented SemVer has recently written an opinion on this topic that I agree with:
https://tom.preston-werner.com/2022/05/23/major-version-numbers-are-not-sacred.html
I love the gem. Thanks for all you've done, but I hope this process can improve somehow!
36bd065
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.
Interesting points.
I think the real issue you have is this PR: #1612
In your proposal, any time we drop an EOL'ed Ruby, we'd bump the major?
36bd065
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 was fixed already in that PR, and by 6.4.6 release. 6.4.5 is always going to be sitting there ready to break my projects that support older Rubies, and I think that is demonstrative of one reason why a "major version" mentality around dropping old Rubies is beneficial.
So, yes, I'd propose that as a policy, a Ruby version drop only happens with a major version bump.
Perhaps it would have downsides to bump major versions frequently, but if we take
rake
as an example of a project that did a lot of major bumping - it doesn't seem to have incurred much wrath. :)I think it is useful to place high value on dropping major Ruby versions so that it is not a decision lightly made.
36bd065
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'm trying to figure out the situation, perhaps you can walk me through this.
I definitely understand not upgrading Ruby and not upgrading the libraries. That's what I do in my personal life. I understand keeping Ruby and the libraries up to date. That's what I do in my professional life.
But I don't understand keeping libraries up to date but using an EOL'ed Ruby. Why wouldn't you also upgrade Ruby?
36bd065
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 am not suggesting that we not upgrade Ruby at all, each library should do that according to their needs. RSpec still supports Ruby 1.8 and is one of the most popular gems ever. I write a lot of RSpec plugin gems, and I aim for Ruby version parity with RSpec. When RSpec drops old Rubies, I will for my RSpec plugins as well. Upgrading Ruby isn't really relevant here.
The issue is dropping support for old EOL'd Rubies (which I love to see!) without a major version bump (which I don't like to see).
I'm merely suggesting that it be policy going forward that dropping a minor version of Ruby be equated with a major version bump of the gem.
OK, but why, specifically?
The official recommendation of
rubygems
,bundler
, andSemVer
-following projects, is that dependencies be specified as:~> 1.0
, which means that patch updates, and minor udpates, will be pulled in. If a patch/minor update drops an EOL'd Ruby it will break my code unless I also drop the same Ruby support (not always immediately possible), or pin the version. On a large project there can be many blockers to upgrading Ruby.