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

Upgrade to Ruby 3.3.0 and Implement GA Ruby Version Matrix Testing #148

Open
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

oroth8
Copy link

@oroth8 oroth8 commented May 2, 2024

Items Addressed

  • updates gem's ruby version from 2.6.5 to 3.3.0
  • fixes ruby languages from migrating to > 3.2.x
  • adds a ruby version matrix testing github action
  • updates 'actionpack', '>= 7.1.3.2'
  • updates gem version to 5.0.0
  • adds spec.required_ruby_version = '>= 3.2.0' to acknowledge backward compatibility limit

@oroth8 oroth8 changed the title Ruby Version Matrix Testing Github Action Upgrade to Ruby 3.3.0 and Implement GA Ruby Version Matrix Testing May 2, 2024
@oroth8 oroth8 self-assigned this May 2, 2024
@oroth8 oroth8 marked this pull request as ready for review May 2, 2024 22:24
@oroth8 oroth8 requested a review from chawes13 as a code owner May 2, 2024 22:24
@oroth8 oroth8 requested a review from inveterateliterate May 2, 2024 22:24
Copy link
Contributor

@chawes13 chawes13 left a comment

Choose a reason for hiding this comment

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

Thanks for creating this PR! In the future, can you open up an issue first? Thanks 🙂

decanter (4.0.4)
actionpack (>= 4.2.10)
decanter (5.0.0)
actionpack (>= 7.1.3.2)
Copy link
Contributor

Choose a reason for hiding this comment

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

Does this change essentially restrict the usage of Decanter v5 to apps with Rails 7 and above?

strategy:
fail-fast: false
matrix:
ruby: ["3.2.0", "3.2.2", "3.3.0"]
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there a way to specify "all patch versions greater than 3.2.0"? Or better yet, "all latest stable releases greater than X"? Or will we need to update this as and when new releases have come out?

strategy:
fail-fast: false
matrix:
ruby: ["3.2.0", "3.2.2", "3.3.0"]
Copy link
Contributor

Choose a reason for hiding this comment

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

What's the rationale for testing 3.2.2 in addition to 3.2.0? Optimistically, a patch release should only contain backwards-compatible bug fixes. Also, the Ruby site says 3.2.4 is the latest stable, so maybe 3.2.2 is already outdated if we are sticking with testing all patched versions?
Image 2024-05-24 at 4 14 58 PM

Comment on lines +63 to +64
raise(ArgumentError, "#{name}: Unknown log_unhandled_keys value #{mode}") unless [true,
false].include? mode
Copy link
Contributor

Choose a reason for hiding this comment

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

This is an interesting change. I haven't seen formatting like this before. Did this happen as a result of some local formatting tool that you have running on save?
Image 2024-05-24 at 4 19 22 PM

Comment on lines +132 to +136
handlers.keys.flatten.uniq -
keys_to_ignore -
handlers.values
.select { |handler| handler[:type] != :input }
.map { |handler| "#{handler[:name]}_attributes".to_sym }
Copy link
Contributor

Choose a reason for hiding this comment

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

Are these changes required in the move from Ruby 2 -> 3?


This version contains major updates including the upgrade to Ruby version 3.3.0. Ensure your environment is compatible with this Ruby version before proceeding.

## Major Changes
Copy link
Contributor

Choose a reason for hiding this comment

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

Does this also need to include Rails 7? Or am I misunderstanding the consequences of the actionpack upgrade?


## Major Changes

1. **Ruby Version Update**: Decanter now requires Ruby 3.3.0. This update brings several language improvements and performance enhancements. You must ensure that your environment is running Ruby 3.3.0 or higher. Update your Ruby version using your Ruby version manager (e.g., RVM, rbenv):
Copy link
Contributor

Choose a reason for hiding this comment

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

Do you have a link to the summary of improvements & performance enhancements? That'd be nice to include if you've got one handy!

Comment on lines +11 to +13
2. **Deprecated Features**: Review any deprecated Ruby methods or features that may affect your project and adjust accordingly. Refer to the [official Ruby 3.3.0 release notes](https://www.ruby-lang.org/en/news/2023/02/24/ruby-3-3-0-released/) for detailed information on deprecations and changes.

3. **Testing and Compatibility**: After updating Ruby, run your test suite and check for any deprecations or failures. Update your gemfile to specify the Ruby version:
Copy link
Contributor

Choose a reason for hiding this comment

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

TBH I don't think we need to separate these out into different steps. They're all part of upgrading to Ruby. The migration guide is how to migrate Decanter, not Ruby 3.3.0. If there's anything specific to how Decanter is used with the new language updates, that'd be good content for this guide. It's fair to call the steps to upgrade to Ruby 3.3.0 out of the scope of this guide.

Comment on lines +15 to +21
## Migration Tips

- Backup your current project before making significant version changes.
- Test your application thoroughly after the migration.
- Consider using a continuous integration (CI) environment to run your tests against multiple Ruby versions if you support them.

By following this guide, you should be able to successfully migrate your project to use Decanter v5.0.0 with Ruby 3.3.0.
Copy link
Contributor

Choose a reason for hiding this comment

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

Again, feels out of scope of this gem migration guide.

Copy link
Contributor

Choose a reason for hiding this comment

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

Are these all formatting / linting changes or were there changes that you needed to make that were broken after the upgrade?

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.

Fix Spec Warning: "when the unhandled keys are ignored - does not raise an error" risks false positives
2 participants