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
Feature request: deprecations #9
Comments
Hmm, interesting. It's almost like |
but yeah, if a component had a way of defining config_warnings method, it could introspect itself to see if any of the deprecated attributes are set, as well as deprecate itself if need be. not quite as nice as a simple |
Could do both; surface I reckon one could generate warnings on use of the deprecated setter/getter method, rather than based on what attributes ended up populated. I imagine renaming of attributes is a common case, so perhaps explicit support for deprecating older names would be handy, e.g. attribute :orientation, :formerly_known_as => :facing
component :position, :formerly_known_as => :pos do ... |
Ok, i got a start master...tigris:config_warnings However, I can't make components deprecate easily. They're always set to an empty class. |
Ever get anywhere with this, @tigris? |
Sorry @mdub - no further than in that branch. Unless I can make kubernetes know about ConfigMapper, I can't see myself extending on it much further :/ When will :k8s: get |
Yep, closing for now. |
It'd be super cool if I could just set
deprecated: true
on an attribute/component.Or alternatively set it to a "deprecation_message" rather than just a boolean.
But it'd be nice if you could do this at a component level, as well as individual attributes.
One would have to ask for these deprecations manually, after the config was loaded. E.g.
config.deprecations.each{|key, message| logger.warn("DEPRECATED: #{key} - #{message}") }
Since the config struct itself has no concept of a logger, or what might happen with deprecations, it simply needs the ability to mark a particular thing as deprecated, and a means to access all that info.
Let me know if you'd be interested in something like this at the global layer, otherwise I'll hack something for our specific needs.
The text was updated successfully, but these errors were encountered: