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

Enable users to determine 'winning' source for a value - where is it coming from? #312

Closed
hutchig opened this issue Jan 26, 2018 · 7 comments
Labels
use case 💡 An issue which illustrates a desired use case for the specification
Milestone

Comments

@hutchig
Copy link
Member

hutchig commented Jan 26, 2018

When working with the issue described in #310. Resolving the cause of the problem took longer as it was not initially obvious that a environment variable was being overridden by a system property of the same name.

Should a 'source' of a value be identified by something in the API or by implementation specific debug/trace? (Or the latter making use of the former.)

@Emily-Jiang
Copy link
Member

It is useful to find out which source serves the config. I think it can be down but not tie with a dedicated method. config.wrap() as discussed #84 might be a good fit for this. Any other useful details can be logged there. We can provide a noop impl for this. The implementor can choose what do you want to provide in this method. One good suggestion is to provide the info noted in this issue.

@Emily-Jiang
Copy link
Member

@gunnarmorling what do you think? Is this a good use case?

@jmesnil
Copy link
Contributor

jmesnil commented Jan 31, 2018

We had a similar discussion in the ConfigJSR eclipse/ConfigJSR#10.

I think that the mp-config implementation should have tools to help resolve/analyze the configuration that is provided to the application.
However such tools can be built on top of the current API by separate tool or by the application itself

@dmlloyd
Copy link
Contributor

dmlloyd commented Sep 12, 2019

Note that the immutability discussion in #432 and the caching discussion in #370 are directly relevant here. If the configuration is immutable, then a method could be provided which returns the ConfigSource for a key independently of accessing its value, with the understanding that the ConfigSource would not change between querying the key and retrieving the value. If the configuration is mutable, then there would need to be a way to atomically get the value and the source - and furthermore, if a Converter is in play which does validation, the location would have to be made available separately, before the converter has a chance to throw an exception.

@Emily-Jiang
Copy link
Member

#43 should be able to figure out which configsource a particular config is coming from. By the way, I don't think the immutability has something to do with this one as the config_ordinal is static and newly added configure source will not be discovered after app starts.

@dmlloyd
Copy link
Contributor

dmlloyd commented Feb 13, 2020

#43 should be able to figure out which configsource a particular config is coming from. By the way, I don't think the immutability has something to do with this one as the config_ordinal is static and newly added configure source will not be discovered after app starts.

It does. What I said above applies to the implementation option of a method which provides the ConfigSource of a given configuration key independently of accessing its value. If a config source can change, then a configuration key can disappear in the time between when a value is read and when the originating configuration source of that value is queried, and this has nothing to do with config ordinals.

This was referenced Feb 28, 2020
@dmlloyd dmlloyd added use case 💡 An issue which illustrates a desired use case for the specification and removed enhancement labels Mar 4, 2020
@radcortez
Copy link
Contributor

This is now possible with #551.

@radcortez radcortez added this to the MP Config 2.0 milestone Jun 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
use case 💡 An issue which illustrates a desired use case for the specification
Projects
None yet
Development

No branches or pull requests

5 participants