Skip to content
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

(PA-7091) Add support for Ruby 3.2 and 3.3 #262

Merged
merged 2 commits into from
Jan 17, 2025
Merged

(PA-7091) Add support for Ruby 3.2 and 3.3 #262

merged 2 commits into from
Jan 17, 2025

Conversation

joshcooper
Copy link
Contributor

@joshcooper joshcooper commented Jan 16, 2025

The inifile gem has not been updated in 10+ years and does not run on Ruby 3.2 because it relies on String#taint. There is a o-inifile gem, but it has the same taint problem.

So vendor the MIT licensed inifile code into beaker-puppet and update it for Ruby 3.2. According to https://fossa.com/blog/open-source-licenses-101-mit-license/ in order to copy and/or modify the code we need to:

  1. Provide the original copyright notice
  2. A copy of the license itself

I've included both of those in inifile.rb

rubocop is failing because of an incompatibility with rubocop-factory_bot and rubocop-rspec_rails, see puppetlabs/dependency_checker#72 (comment) for an example. That issue is fixed in #263

@joshcooper joshcooper marked this pull request as ready for review January 17, 2025 00:40
@joshcooper joshcooper requested a review from a team as a code owner January 17, 2025 00:40
@@ -11,7 +11,7 @@ Gem::Specification.new do |s|
s.description = 'For use for the Beaker acceptance testing tool'
s.license = 'Apache-2.0'

s.required_ruby_version = '>= 2.7', '< 3.2'
s.required_ruby_version = '>= 2.7', '< 3.3'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What are the issues with using Ruby >= 3.3? Is it just that we're not testing against those versions?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah yeah good point, I didn't think to add that. Updated.

Ruby 3.2 introduced two breaking changes:
* String#taint was removed entirely
* Fixnum was removed in favor of Integer

Updates the gemspec to allow 3.2 - 3.3

Update workflow to test on the new versions
@mhashizume mhashizume merged commit 482b83b into main Jan 17, 2025
7 of 8 checks passed
@mhashizume mhashizume deleted the inifile branch January 17, 2025 18:07
@joshcooper joshcooper mentioned this pull request Jan 17, 2025
@joshcooper joshcooper changed the title (PA-7091) Vendor inifile in beaker-puppet (PA-7091) Add support for Ruby 3.2 and 3.3 Jan 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants