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

Make Spree::MigrationHelpers Ruby 3.0 compatible #5072

Conversation

RyanofWoods
Copy link
Contributor

@RyanofWoods RyanofWoods commented May 8, 2023

Summary

Due to the separation of positional and keyword arguments in Ruby 3.0, the options default value of a hash can no longer be coerced into keyword arguments. Using double splat avoids this by only allowing optional arguments as keywords.

Checklist

Check out our PR guidelines for more details.

The following are mandatory for all PRs:

The following are not always needed:

  • 📖 I have updated the README to account for my changes.
  • 📑 I have documented new code with YARD.
  • 🛣️ I have opened a PR to update the guides.
  • ✅ I have added automated tests to cover my changes.
  • 📸 I have attached screenshots to demo visual changes.

@github-actions github-actions bot added the changelog:solidus_core Changes to the solidus_core gem label May 8, 2023
@RyanofWoods RyanofWoods force-pushed the ryanofwoods/make-migration-helper-ruby-3-compatible branch 2 times, most recently from a731995 to 5ad08b6 Compare May 24, 2023 03:36
@RyanofWoods RyanofWoods marked this pull request as ready for review May 24, 2023 03:54
@RyanofWoods RyanofWoods requested a review from a team as a code owner May 24, 2023 03:54
@RyanofWoods
Copy link
Contributor Author

@kennyadsl previously discussed on Slack, that we might want to remove this logic from Solidus as it's not used by Solidus.

I agree with the idea that stores should be responsible for maintaining their own migration logic.

WDYT? Should I make a new PR to deprecate the module and its methods?

Copy link
Member

@kennyadsl kennyadsl left a comment

Choose a reason for hiding this comment

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

Thanks @RyanofWoods! I'm good as is, but I left a suggestion. 🙏

core/spec/lib/spree/migration_helpers_spec.rb Show resolved Hide resolved
core/spec/lib/spree/migration_helpers_spec.rb Outdated Show resolved Hide resolved
Due to the separation of positional and keyword arguments in Ruby 3.0,
the options default value of a hash cannot be coerced into keyword
arguments.
@RyanofWoods RyanofWoods force-pushed the ryanofwoods/make-migration-helper-ruby-3-compatible branch from 5ad08b6 to 3568af9 Compare May 24, 2023 08:32
@RyanofWoods
Copy link
Contributor Author

Please backlog to supported versions: v3.4, v3.3 and v3.2. Though note, this will mean v3.1 which is now unsupported will have a breaking change as this is the Solidus version where Ruby 3.0 became supported.

@kennyadsl
Copy link
Member

@RyanofWoods we could backport this change to the 3.1 branch in GH (people could still reference to it) without releasing a new version.

@kennyadsl kennyadsl added backport-v3.2 backport-v3.3 Backport this pull-request to v3.3 backport-v3.4 Backport this pull-request to v3.4 backport-v4.0 Backport this pull-request to v4.0 labels May 24, 2023
@github-actions
Copy link

💚 All backports created successfully

Status Branch Result
v3.2
v3.1
v3.3
v3.4
v4.0

Questions ?

Please refer to the Backport tool documentation and see the Github Action logs for details

waiting-for-dev added a commit that referenced this pull request May 26, 2023
[v3.4] Merge pull request #5072 from nebulab/ryanofwoods/make-migration-helper-ruby-3-compatible
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-v3.3 Backport this pull-request to v3.3 backport-v3.4 Backport this pull-request to v3.4 backport-v4.0 Backport this pull-request to v4.0 changelog:solidus_core Changes to the solidus_core gem
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants