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

Support Ruby 3.2.2 #492

Merged
merged 3 commits into from
Jul 4, 2023
Merged

Support Ruby 3.2.2 #492

merged 3 commits into from
Jul 4, 2023

Conversation

crazytonyli
Copy link
Contributor

@crazytonyli crazytonyli commented Jun 13, 2023

What does it do?

Ruby 3.2.2 support has been addressed in previous PRs (#493, #497, and #504). This PR updates the CI checks to ensure this library continues to be compatible with Ruby 3.2.2.

The "required ruby version" settings in the gemspec file stays unchanged—the library should stay compatible with 2.7.4.

I have updated the "Build and Test" CI step to run with both Ruby 3.2.2 and 2.7.4. Since there are no ruby source code changes in this PR, tests using Ruby 2.7.4 all passed as expected. However, there are some test failures when using Ruby 3.2.2. I'll look into those later.

I have also configured the rubocop to use 2.7 as the oldest Ruby version, so that it won't report issues like "please use this new Ruby syntax and API".

Checklist before requesting a review

  • Run bundle exec rubocop to test for code style violations and recommendations
  • Add Unit Tests (aka specs/*_spec.rb) if applicable
  • Run bundle exec rspec to run the whole test suite and ensure all your tests pass
  • Make sure you added an entry in the CHANGELOG.md file to describe your changes under the appropriate existing ### subsection of the existing ## Trunk section.
  • If applicable, add an entry in the MIGRATION.md file to describe how the changes will affect the migration from the previous major version and what the clients will need to change and consider.

@crazytonyli crazytonyli force-pushed the use-ruby-3.2.2 branch 2 times, most recently from 9ac6628 to 0ccdec5 Compare July 4, 2023 04:47
@crazytonyli crazytonyli marked this pull request as ready for review July 4, 2023 05:11
@crazytonyli crazytonyli requested a review from a team July 4, 2023 05:12
Comment on lines +52 to +56
matrix:
setup:
ruby:
- 2.7.4
- 3.2.2
Copy link
Contributor

Choose a reason for hiding this comment

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

👌

@@ -6,6 +6,7 @@ require:
# Enable new cops when we update rubocop to a newer version
AllCops:
NewCops: enable
TargetRubyVersion: 2.7
Copy link
Contributor

Choose a reason for hiding this comment

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

Why not make rubocop enforce Ruby 3 rules right away? 🤔

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That means we'll have to change the code to use Ruby 3 syntax or API to address the new rubocop issues. I don't think we should use Ruby 3 right now, because the apps are still using 2.7. Once a new release-toolkit is released (which contains all the fixes for the Ruby 3 compatibility), I'll try to upgrade a few apps to use Ruby 3. If all go well, we can then changing this library to require Ruby 3 and above. That's when we can drop 2.7 and let rubocop enforce Ruby 3 rules.

@crazytonyli
Copy link
Contributor Author

The "build-and-test" status check shows as "Pending" because it's replaced by two "build and test" jobs. I'll merge this PR now and will update the branch protection rule to use the two new build-and-test status checks.

@crazytonyli crazytonyli merged commit 57b7b64 into trunk Jul 4, 2023
8 checks passed
@crazytonyli crazytonyli deleted the use-ruby-3.2.2 branch July 4, 2023 23:28
@crazytonyli crazytonyli mentioned this pull request Jul 4, 2023
5 tasks
@iangmaia iangmaia mentioned this pull request Oct 5, 2023
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants