Git Product home page Git Product logo

Comments (10)

VikiAnn avatar VikiAnn commented on June 12, 2024 4

Apologies if this isn't the right place for this, but my team's hanami app uses a lot of the dry and rom stuff, and we're getting a lot of deprecation warnings from various dry and rom gems about the default argument. Initially we thought that meant we needed to make changes to our code, but upon investigation it looks like the majority come from the dry/rom family.

I've pasted the deprecation output below, as you can see there's a little bit of our hanami app related to the warnings, and some hanami code, but the majority seem to be in dry or rom code. Are there plans to address this?

/Users/viki/.gem/ruby/2.7.4/gems/dry-schema-1.7.0/lib/dry/schema/config.rb:17:in `<module:Schema>' [dry-configurable] default value as positional argument to settings is deprecated and will be removed in the next major version
Provide a `default:` keyword argument instead

/Users/viki/.gem/ruby/2.7.4/gems/dry-schema-1.7.0/lib/dry/schema/config.rb:17:in `<module:Schema>' [dry-configurable] default value as positional argument to settings is deprecated and will be removed in the next major version
Provide a `default:` keyword argument instead

/Users/viki/.gem/ruby/2.7.4/gems/dry-configurable-0.13.0/lib/dry/configurable/dsl.rb:28:in `initialize' [dry-configurable] default value as positional argument to settings is deprecated and will be removed in the next major version
Provide a `default:` keyword argument instead

/Users/viki/.gem/ruby/2.7.4/gems/dry-configurable-0.13.0/lib/dry/configurable/dsl.rb:28:in `initialize' [dry-configurable] default value as positional argument to settings is deprecated and will be removed in the next major version
Provide a `default:` keyword argument instead

/Users/viki/.gem/ruby/2.7.4/gems/dry-configurable-0.13.0/lib/dry/configurable/dsl.rb:28:in `initialize' [dry-configurable] passing a constructor as a block is deprecated and will be removed in the next major version
Provide a `constructor:` keyword argument instead

/Users/viki/.gem/ruby/2.7.4/gems/dry-configurable-0.13.0/lib/dry/configurable/dsl.rb:28:in `initialize' [dry-configurable] default value as positional argument to settings is deprecated and will be removed in the next major version
Provide a `default:` keyword argument instead

/Users/viki/.gem/ruby/2.7.4/gems/dry-configurable-0.13.0/lib/dry/configurable/dsl.rb:28:in `initialize' [dry-configurable] default value as positional argument to settings is deprecated and will be removed in the next major version
Provide a `default:` keyword argument instead

/Users/viki/.gem/ruby/2.7.4/gems/dry-schema-1.7.0/lib/dry/schema/config.rb:17:in `<module:Schema>' [dry-configurable] default value as positional argument to settings is deprecated and will be removed in the next major version
Provide a `default:` keyword argument instead

/Users/viki/.gem/ruby/2.7.4/gems/dry-validation-1.6.0/lib/dry/validation/config.rb:13:in `<module:Validation>' [dry-configurable] default value as positional argument to settings is deprecated and will be removed in the next major version
Provide a `default:` keyword argument instead

/Users/viki/.gem/ruby/2.7.4/gems/dry-validation-1.6.0/lib/dry/validation/config.rb:13:in `<module:Validation>' [dry-configurable] passing a constructor as a block is deprecated and will be removed in the next major version
Provide a `constructor:` keyword argument instead

/Users/viki/.gem/ruby/2.7.4/gems/dry-schema-1.7.0/lib/dry/schema/messages/abstract.rb:17:in `<module:Messages>' [dry-configurable] default value as positional argument to settings is deprecated and will be removed in the next major version
Provide a `default:` keyword argument instead

/Users/viki/.gem/ruby/2.7.4/gems/dry-schema-1.7.0/lib/dry/schema/messages/abstract.rb:17:in `<module:Messages>' [dry-configurable] default value as positional argument to settings is deprecated and will be removed in the next major version
Provide a `default:` keyword argument instead

/Users/viki/.gem/ruby/2.7.4/gems/dry-schema-1.7.0/lib/dry/schema/messages/abstract.rb:17:in `<module:Messages>' [dry-configurable] default value as positional argument to settings is deprecated and will be removed in the next major version
Provide a `default:` keyword argument instead

/Users/viki/.gem/ruby/2.7.4/gems/dry-schema-1.7.0/lib/dry/schema/messages/abstract.rb:17:in `<module:Messages>' [dry-configurable] default value as positional argument to settings is deprecated and will be removed in the next major version
Provide a `default:` keyword argument instead

/Users/viki/.gem/ruby/2.7.4/gems/dry-schema-1.7.0/lib/dry/schema/messages/abstract.rb:17:in `<module:Messages>' [dry-configurable] default value as positional argument to settings is deprecated and will be removed in the next major version
Provide a `default:` keyword argument instead

/Users/viki/.gem/ruby/2.7.4/gems/dry-schema-1.7.0/lib/dry/schema/messages/abstract.rb:17:in `<module:Messages>' [dry-configurable] default value as positional argument to settings is deprecated and will be removed in the next major version
Provide a `default:` keyword argument instead

/Users/viki/.gem/ruby/2.7.4/gems/dry-schema-1.7.0/lib/dry/schema/messages/abstract.rb:17:in `<module:Messages>' [dry-configurable] default value as positional argument to settings is deprecated and will be removed in the next major version
Provide a `default:` keyword argument instead

/Users/viki/.gem/ruby/2.7.4/gems/dry-schema-1.7.0/lib/dry/schema/messages/abstract.rb:17:in `<module:Messages>' [dry-configurable] default value as positional argument to settings is deprecated and will be removed in the next major version
Provide a `default:` keyword argument instead

/Users/viki/.gem/ruby/2.7.4/gems/dry-schema-1.7.0/lib/dry/schema/messages/abstract.rb:17:in `<module:Messages>' [dry-configurable] default value as positional argument to settings is deprecated and will be removed in the next major version
Provide a `default:` keyword argument instead

/Users/viki/.gem/ruby/2.7.4/gems/dry-schema-1.7.0/lib/dry/schema/processor.rb:24:in `<module:Schema>' [dry-configurable] default value as positional argument to settings is deprecated and will be removed in the next major version
Provide a `default:` keyword argument instead

/Users/viki/.gem/ruby/2.7.4/gems/dry-schema-1.7.0/lib/dry/schema/processor.rb:24:in `<module:Schema>' [dry-configurable] default value as positional argument to settings is deprecated and will be removed in the next major version
Provide a `default:` keyword argument instead

/Users/viki/.gem/ruby/2.7.4/gems/dry-system-0.19.0/lib/dry/system/config/component_dir.rb:7:in `<module:Config>' [dry-configurable] default value as positional argument to settings is deprecated and will be removed in the next major version
Provide a `default:` keyword argument instead

/Users/viki/.gem/ruby/2.7.4/gems/dry-system-0.19.0/lib/dry/system/config/component_dir.rb:7:in `<module:Config>' [dry-configurable] default value as positional argument to settings is deprecated and will be removed in the next major version
Provide a `default:` keyword argument instead

/Users/viki/.gem/ruby/2.7.4/gems/dry-system-0.19.0/lib/dry/system/config/component_dir.rb:7:in `<module:Config>' [dry-configurable] default value as positional argument to settings is deprecated and will be removed in the next major version
Provide a `default:` keyword argument instead

/Users/viki/.gem/ruby/2.7.4/gems/dry-system-0.19.0/lib/dry/system/config/component_dir.rb:7:in `<module:Config>' [dry-configurable] default value as positional argument to settings is deprecated and will be removed in the next major version
Provide a `default:` keyword argument instead

/Users/viki/.gem/ruby/2.7.4/gems/dry-system-0.19.0/lib/dry/system/container.rb:70:in `<module:System>' [dry-configurable] default value as positional argument to settings is deprecated and will be removed in the next major version
Provide a `default:` keyword argument instead

/Users/viki/.gem/ruby/2.7.4/gems/dry-system-0.19.0/lib/dry/system/container.rb:70:in `<module:System>' [dry-configurable] passing a constructor as a block is deprecated and will be removed in the next major version
Provide a `constructor:` keyword argument instead

/Users/viki/.gem/ruby/2.7.4/gems/dry-system-0.19.0/lib/dry/system/container.rb:70:in `<module:System>' [dry-configurable] default value as positional argument to settings is deprecated and will be removed in the next major version
Provide a `default:` keyword argument instead

/Users/viki/.gem/ruby/2.7.4/gems/dry-system-0.19.0/lib/dry/system/container.rb:70:in `<module:System>' [dry-configurable] default value as positional argument to settings is deprecated and will be removed in the next major version
Provide a `default:` keyword argument instead

/Users/viki/.gem/ruby/2.7.4/gems/dry-system-0.19.0/lib/dry/system/container.rb:70:in `<module:System>' [dry-configurable] default value as positional argument to settings is deprecated and will be removed in the next major version
Provide a `default:` keyword argument instead

/Users/viki/.gem/ruby/2.7.4/gems/dry-system-0.19.0/lib/dry/system/container.rb:70:in `<module:System>' [dry-configurable] default value as positional argument to settings is deprecated and will be removed in the next major version
Provide a `default:` keyword argument instead

/Users/viki/.gem/ruby/2.7.4/gems/dry-system-0.19.0/lib/dry/system/container.rb:70:in `<module:System>' [dry-configurable] default value as positional argument to settings is deprecated and will be removed in the next major version
Provide a `default:` keyword argument instead

/Users/viki/.gem/ruby/2.7.4/gems/dry-system-0.19.0/lib/dry/system/container.rb:70:in `<module:System>' [dry-configurable] default value as positional argument to settings is deprecated and will be removed in the next major version
Provide a `default:` keyword argument instead

/Users/viki/.gem/ruby/2.7.4/gems/dry-system-0.19.0/lib/dry/system/container.rb:70:in `<module:System>' [dry-configurable] default value as positional argument to settings is deprecated and will be removed in the next major version
Provide a `default:` keyword argument instead

/Users/viki/.gem/ruby/2.7.4/gems/dry-system-0.19.0/lib/dry/system/container.rb:70:in `<module:System>' [dry-configurable] default value as positional argument to settings is deprecated and will be removed in the next major version
Provide a `default:` keyword argument instead

/Users/viki/.gem/ruby/2.7.4/gems/dry-system-0.19.0/lib/dry/system/container.rb:70:in `<module:System>' [dry-configurable] default value as positional argument to settings is deprecated and will be removed in the next major version
Provide a `default:` keyword argument instead

/Users/viki/.gem/ruby/2.7.4/gems/dry-system-0.19.0/lib/dry/system/container.rb:70:in `<module:System>' [dry-configurable] default value as positional argument to settings is deprecated and will be removed in the next major version
Provide a `default:` keyword argument instead

/Users/viki/.gem/ruby/2.7.4/gems/dry-system-0.19.0/lib/dry/system/container.rb:70:in `<module:System>' [dry-configurable] passing a constructor as a block is deprecated and will be removed in the next major version
Provide a `constructor:` keyword argument instead

/Users/viki/.gem/ruby/2.7.4/gems/dry-system-0.19.0/lib/dry/system/plugins/logging.rb:14:in `block in extended' [dry-configurable] default value as positional argument to settings is deprecated and will be removed in the next major version
Provide a `default:` keyword argument instead

/Users/viki/.gem/ruby/2.7.4/gems/dry-system-0.19.0/lib/dry/system/plugins/logging.rb:16:in `block in extended' [dry-configurable] default value as positional argument to settings is deprecated and will be removed in the next major version
Provide a `default:` keyword argument instead

/Users/viki/.gem/ruby/2.7.4/gems/dry-system-0.19.0/lib/dry/system/plugins/logging.rb:21:in `block in extended' [dry-configurable] default value as positional argument to settings is deprecated and will be removed in the next major version
Provide a `default:` keyword argument instead

/Users/viki/src/broadlume/tatami/lib/blunder.rb:16:in `extend' [dry-configurable] default value as positional argument to settings is deprecated and will be removed in the next major version
Provide a `default:` keyword argument instead

/Users/viki/src/broadlume/tatami/lib/blunder.rb:16:in `extend' [dry-configurable] default value as positional argument to settings is deprecated and will be removed in the next major version
Provide a `default:` keyword argument instead

/Users/viki/src/broadlume/tatami/lib/blunder.rb:17:in `extend' [dry-configurable] default value as positional argument to settings is deprecated and will be removed in the next major version
Provide a `default:` keyword argument instead

/Users/viki/.gem/ruby/2.7.4/gems/rom-http-0.8.0/lib/rom/http/dataset.rb:24:in `<module:HTTP>' [dry-configurable] default value as positional argument to settings is deprecated and will be removed in the next major version
Provide a `default:` keyword argument instead

/Users/viki/.gem/ruby/2.7.4/gems/dry-configurable-0.13.0/lib/dry/configurable/dsl.rb:28:in `initialize' [dry-configurable] default value as positional argument to settings is deprecated and will be removed in the next major version
Provide a `default:` keyword argument instead

/Users/viki/.gem/ruby/2.7.4/gems/dry-configurable-0.13.0/lib/dry/configurable/dsl.rb:28:in `initialize' [dry-configurable] default value as positional argument to settings is deprecated and will be removed in the next major version
Provide a `default:` keyword argument instead

/Users/viki/.gem/ruby/2.7.4/gems/dry-configurable-0.13.0/lib/dry/configurable/dsl.rb:28:in `initialize' [dry-configurable] default value as positional argument to settings is deprecated and will be removed in the next major version
Provide a `default:` keyword argument instead

/Users/viki/.gem/ruby/2.7.4/gems/hanami-events-cloud_pubsub-3.3.0/lib/hanami/events/cloud_pubsub.rb:15:in `<module:Events>' [dry-configurable] default value as positional argument to settings is deprecated and will be removed in the next major version
Provide a `default:` keyword argument instead

/Users/viki/.gem/ruby/2.7.4/gems/hanami-events-cloud_pubsub-3.3.0/lib/hanami/events/cloud_pubsub.rb:15:in `<module:Events>' [dry-configurable] default value as positional argument to settings is deprecated and will be removed in the next major version
Provide a `default:` keyword argument instead

/Users/viki/.gem/ruby/2.7.4/gems/hanami-events-cloud_pubsub-3.3.0/lib/hanami/events/cloud_pubsub.rb:15:in `<module:Events>' [dry-configurable] default value as positional argument to settings is deprecated and will be removed in the next major version
Provide a `default:` keyword argument instead

/Users/viki/.gem/ruby/2.7.4/gems/hanami-events-cloud_pubsub-3.3.0/lib/hanami/events/cloud_pubsub.rb:15:in `<module:Events>' [dry-configurable] default value as positional argument to settings is deprecated and will be removed in the next major version
Provide a `default:` keyword argument instead

/Users/viki/.gem/ruby/2.7.4/gems/hanami-events-cloud_pubsub-3.3.0/lib/hanami/events/cloud_pubsub.rb:15:in `<module:Events>' [dry-configurable] default value as positional argument to settings is deprecated and will be removed in the next major version
Provide a `default:` keyword argument instead

/Users/viki/.gem/ruby/2.7.4/gems/hanami-events-cloud_pubsub-3.3.0/lib/hanami/events/cloud_pubsub.rb:15:in `<module:Events>' [dry-configurable] default value as positional argument to settings is deprecated and will be removed in the next major version
Provide a `default:` keyword argument instead

/Users/viki/.gem/ruby/2.7.4/gems/hanami-events-cloud_pubsub-3.3.0/lib/hanami/events/cloud_pubsub.rb:15:in `<module:Events>' [dry-configurable] default value as positional argument to settings is deprecated and will be removed in the next major version
Provide a `default:` keyword argument instead

/Users/viki/.gem/ruby/2.7.4/gems/hanami-events-cloud_pubsub-3.3.0/lib/hanami/events/cloud_pubsub.rb:15:in `<module:Events>' [dry-configurable] default value as positional argument to settings is deprecated and will be removed in the next major version
Provide a `default:` keyword argument instead

/Users/viki/.gem/ruby/2.7.4/gems/hanami-events-cloud_pubsub-3.3.0/lib/hanami/events/cloud_pubsub.rb:15:in `<module:Events>' [dry-configurable] default value as positional argument to settings is deprecated and will be removed in the next major version
Provide a `default:` keyword argument instead

/Users/viki/.gem/ruby/2.7.4/gems/dry-configurable-0.13.0/lib/dry/configurable/dsl.rb:28:in `initialize' [dry-configurable] default value as positional argument to settings is deprecated and will be removed in the next major version
Provide a `default:` keyword argument instead

/Users/viki/.gem/ruby/2.7.4/gems/dry-configurable-0.13.0/lib/dry/configurable/dsl.rb:28:in `initialize' [dry-configurable] default value as positional argument to settings is deprecated and will be removed in the next major version
Provide a `default:` keyword argument instead

/Users/viki/.gem/ruby/2.7.4/gems/dry-configurable-0.13.0/lib/dry/configurable/dsl.rb:28:in `initialize' [dry-configurable] default value as positional argument to settings is deprecated and will be removed in the next major version
Provide a `default:` keyword argument instead

/Users/viki/.gem/ruby/2.7.4/gems/dry-configurable-0.13.0/lib/dry/configurable/dsl.rb:28:in `initialize' [dry-configurable] default value as positional argument to settings is deprecated and will be removed in the next major version
Provide a `default:` keyword argument instead

from dry-configurable.

waiting-for-dev avatar waiting-for-dev commented on June 12, 2024 1

@timriley, to complete the process, once dry-configurable v0.13 has been released we should add it into the gemspec file in hanami/hanami, as it's now on its Gemfile:

https://github.com/hanami/hanami/blob/b449ef1ebaaf3e1056f5c1e882ddb326586c2811/Gemfile#L20

from dry-configurable.

timriley avatar timriley commented on June 12, 2024

@solnic Regarding the comment you left here:

The same case as with dry-validation - I think it'd be good to make it work with both versions of dry-configurable.

Given that the approach you tried for dry-validation won't work for dry-schema, because of its use of nested settings (where we can't actually provide a localised patch for the setting method), should we reconsider our approach?

Given that the changes for the next dry-configurable release are broadly backwards compatible (I think there might be just one issue with hashes provided as defaults, which I can dig into more if we decide to go down this path), and with deprecation warnings being printed for the previous style of supplied arguments to setting, could we contemplate just releasing the new dry-configurable, and then bumping the required minimum dry-configurable version across new releases of all the other gems that depend on it?

from dry-configurable.

timriley avatar timriley commented on June 12, 2024

/cc @flash-gordon on the above too

from dry-configurable.

timriley avatar timriley commented on June 12, 2024

Here's a single test encompassing the bug with our (supposedly) backwards-compatible-but-deprecated support for default values provided as the second positional argument to setting: #121

It works with Ruby 3.0 but fails in 2.6 and 2.7. If we can find a way to sort that out, the I think I'd be confident to go ahead with the release and versioning approach I've described above.

from dry-configurable.

timriley avatar timriley commented on June 12, 2024

#121 is now a full-blown fix and, once that is reviewed and merged, I think we can be confident about the following as the release process:

  1. Do another round of testing of the main/master branch of each of the dependent gems on both (a) the current version and (b) the master branch of dry-configurable. If they work without any changes required
  2. Do another round of testing of the "upgrade dry-configurable" PRs (linked in the top description) and make sure they all work on the master branch of of dry-configurable
  3. Release dry-configurable 0.13.0
  4. Release all the dependent gems with new >= 0.13.0 version constraints against dry-configurable and using the new setting API

And once we do the latter, even if users pull the latest dry-configurable as a transitive dependency, it shouldn’t break any of their apps because we’ve now covered all the backwards compatibility cases. Worst thing will be that they see a bunch of deprecation warnings and will need to upgrade their setting definitions to silence them (and we can make sure the dry-configurable CHANGELOG makes it really clear what they need to do).

from dry-configurable.

timriley avatar timriley commented on June 12, 2024

@solnic @flash-gordon — let me know if you're good with the above?

from dry-configurable.

timriley avatar timriley commented on June 12, 2024

@solnic Is there any rom stuff I need to be testing at this point, or since dry-configurable is being newly introduced there, we don't need to worry about any compatibility issues?

from dry-configurable.

timriley avatar timriley commented on June 12, 2024

Hi @VikiAnn — we shipped the following dry-rb gem releases to use the latest dry-configurable 0.13.0 API:

  • dry-container 0.9.0
  • dry-system 0.19.2
  • dry-system 0.20.0
  • dry-monitor 0.5.0
  • dry-schema 1.8.0
  • dry-validation 1.7.0

If you upgrade to those versions, you should see any deprecation warnings originating from dry-rb gems going away.

As for warnings from other gems, you may need to work with their maintainers to get them in place.

If you need to temporarily silence these warnings while you wait for upstream adjustments, you might also find the https://github.com/jeremyevans/ruby-warning gem handy.

Thanks!

from dry-configurable.

timriley avatar timriley commented on June 12, 2024

Marking this issue as closed now since we've made the 0.13.0 release a while ago and all in-ecosystem changes have been handled.

from dry-configurable.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.