basho / cuttlefish

never lose your childlike sense of wonder baby cuttlefish, promise me?
Apache License 2.0
205 stars 124 forks source link

How to handle 'redefined' variables #68

Closed Licenser closed 10 years ago

Licenser commented 10 years ago

So this is a bit related to #67, when having some variable shadowing it should be possible in what way it does so. I can see two scenarios:

totally replace the variable

When I define my.setting before (with a higher priority) and use translate or alias to riak_core.something then the riak_core.something from riak_core.schema will never show in the config and even if added be simply ignore (or a warning printed that it's a unknown setting)

defaulting/simplification

Example take the code in #67 for example, there the data_dir in there would be a default for bitcask.data_dir etc. So it would be neat if bitcask.data_dir, would not be present in the generated .config, but if added explictly would overwrite the 'default' provided by data_dir

joedevivo commented 10 years ago

Did you mean 67 instead of 64 in that last paragraph?

Licenser commented 10 years ago

totally, updated the orignial message.

joedevivo commented 10 years ago

It was built with the "totally replace" semantic in mind. That's why the alphanumeric order of the schema file names is so inmportant in reltool.config.

The idea being that if you want to include the bitcask schema, but want to override a specific setting, you could include that one mapping in your own app's schema.

joedevivo commented 10 years ago

Hey @Licenser, I just added the ability to partially overwrite mappings. Take a look at #78

Licenser commented 10 years ago

looks neat!

joedevivo commented 10 years ago

closing this issue, the merge property for mappings covers this. correct me if that's wrong.