test-kitchen / kitchen-ec2

A Test Kitchen Driver for Amazon EC2
Other
221 stars 202 forks source link

Ruby 3.1 syntax has been introduced #616

Closed cmparkinson closed 12 months ago

cmparkinson commented 12 months ago

:ghost: Brief Description

PR https://github.com/test-kitchen/kitchen-ec2/pull/610 introduced hash literal value omission, which is a Ruby >= 3.1 syntax change and has broken the gem for all earlier Ruby versions. The gemspec still specifies Ruby >= 2.7, which no longer holds true. If this change was intended, it should probably have come with a major version bump to adhere to semver.

Version

3.17.1

Steps to Reproduce

Use the gem in a ruby version prior to 3.1.

Expected Result

The gem should work.

Actual Result

SyntaxError is raised.

cmparkinson commented 12 months ago

@damacus Was the TargetRubyVersion bump here intentional? The autocorrections have broken the gem for earlier Ruby versions.

damacus commented 12 months ago

Hey @cmparkinson, yes it was intentional.

I've followed the current EOL Ruby policy. What version of Ruby are you using and how are you installing it?

cmparkinson commented 12 months ago

Thanks for the quick response!

The gem is being installed by Bundler. We have a few older automated tests that are still running on Ruby versions < 3.0 (and completely EOL - I don't expect support there), however Ruby 3.0 is still supported and will continue to receive security updates until its expected EOL date of 2024-03-31. https://www.ruby-lang.org/en/downloads/branches/

This isn't a huge problem for me - I can easily pin kitchen-ec2 to 3.17.0 until we've completed our Ruby version upgrades - but if you're open to suggestions, I have a couple:

  1. The minimum required Ruby version in the gemspec should be updated to reflect reality. That will prevent Bundler/RubyGems from trying to install the gem on unsupported Ruby versions.
  2. There should be a major version bump to the gem to protect anyone that has this gem constrained to ~> 3.0; breaking changes shouldn't be introduced as minor or patch versions.
damacus commented 12 months ago

Thanks for spotting the lack of an upgraded version there. I bumped a few libraries over the past week and obviously forgot this one. I'll do another release shortly 👍🏼

cmparkinson commented 12 months ago

Thanks @damacus! Closing this issue.