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 compatibility fixes to support a future dry-configurable 0.13.0 release (for 0.19 series for releases) #186

Conversation

timriley
Copy link
Member

@timriley timriley commented Aug 21, 2021

This PR includes 2 changes:

  • Use ruby2_keywords for our override of dry-configurable's setting method, to make sure it will still work to delegate to the original when provided "real" keyword arguments in newer Rubies
  • Update a setting in the logging plugin to provide a "real" hash literal (i.e. enclosed in curly braces) rather than rely on Ruby's implicit conversion of keyword args to a hash literal

With these changes in place, the dry-system test suite passes against both dry-configurable 0.12.1 (the latest released version) as well as the master branch (intended for release as 0.13.0), on both Ruby versions 3.0.1 and 2.7.3.

To prepare for the upcoming dry-configurable release (which is being planned for at dry-rb/dry-configurable#120), we need to:

  1. Review and merge this PR
  2. Port these specific changes into the master branch too
  3. Make an 0.19.2 release of dry-system with these changes included
  4. Update any dry-rb gems currently depending on dry-system to require at least version 0.19.2 (maybe this is not needed, since we could just have documentation that encourages users to upgrade dry-system as a transitive dependency?)
  5. Complete the dry-configurable testing process and release 0.13.0

While we still have this override method in place, we need to have it work for both current and upcoming versions of dry-configurable. Using ruby2_keywords for this ensures this works even when we're passing "real" keyword arguments for different params signatures in Ruby 3.0 and beyond.
Provide an explicit hash literal for the default value (i.e. by adding curly braces) rather than depending on Ruby's implicit "convert keyword arguments to a hash" behavior, which will not work when the dry-configurable `setting` method changes to accept proper keyword arguments in a future release.
@timriley
Copy link
Member Author

@solnic @flash-gordon Are you happy for me to merge this and release it as 0.19.2?

@timriley timriley merged commit f4f6c36 into release-0.19 Aug 23, 2021
@timriley timriley deleted the fix-configurable-setting-override-for-future-api-changes-0.19 branch August 23, 2021 10:44
@timriley timriley changed the title Make compatibility fixes to support a future dry-configurable 0.13.0 release Make compatibility fixes to support a future dry-configurable 0.13.0 release (for 0.18 series for releases) Aug 23, 2021
@timriley timriley changed the title Make compatibility fixes to support a future dry-configurable 0.13.0 release (for 0.18 series for releases) Make compatibility fixes to support a future dry-configurable 0.13.0 release (for 0.19 series for releases) Aug 23, 2021
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