-
Notifications
You must be signed in to change notification settings - Fork 116
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
ConfigValue API #551
ConfigValue API #551
Conversation
Can one of the admins verify this patch? |
api/src/main/java/org/eclipse/microprofile/config/spi/ConfigValueConfigSource.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From this PR, I don't see why the interceptor and interceptor context should be in the spec. It is implementation details.
You mean the |
api/src/main/java/org/eclipse/microprofile/config/spi/ConfigValue.java
Outdated
Show resolved
Hide resolved
api/src/main/java/org/eclipse/microprofile/config/spi/ConfigValue.java
Outdated
Show resolved
Hide resolved
Per our discussions in the meeting on 16/04, I've done the following changes:
If we are happy with this, I'll proceed to complete the Spec and enhance the TCK. |
api/src/main/java/org/eclipse/microprofile/config/spi/ConfigValueSource.java
Outdated
Show resolved
Hide resolved
Depends on #553. |
api/src/main/java/org/eclipse/microprofile/config/spi/ConfigBuilder.java
Outdated
Show resolved
Hide resolved
api/src/main/java/org/eclipse/microprofile/config/spi/ConfigValueSource.java
Outdated
Show resolved
Hide resolved
api/src/main/java/org/eclipse/microprofile/config/spi/ConfigBuilder.java
Outdated
Show resolved
Hide resolved
Emily made most of the points I was about to make on the detail level. On the strategic evolution of the API I generally see the need for a more capable and convenient API. Use cases I encounter as "unsolved":
Use cases I see solved by the PR:
Given the above I can see how this PR can be the basis of an evolution towards the use cases I encounter as "unsolved" but it does not solve any of them yet. Thinking this forward I find the proposal made in this PR somewhat problematic. If sources already operate on the level of property value objects this moves conversion into sources or forces conversion to be bolted on through some form of wrapping or callback which I would find quite unsatisfactory as it either exposes "internals" in the public API or requires to extend the source implementation beyond the public API to implement the collaboration between the My suggestion is to keep |
None of these are use cases though the last directly implies a use case which is addressed by a different issue. Null-safe resolution already should be a reality. What do you see as missing here? What do you mean by "exception-less"? What conversion capabilities are you alluding to? What is the use case (i.e. what are you trying to do, as opposed to how do you imagine it being done)?
Don't worry, we're not in a rush to release. We have consciously tried to make this PR be incremental for the purpose of segmenting debate and preventing a situation where conversation is confused.
We discussed this already. The main reason Note that conversion is not (yet) part of the |
I was in the last week's discussion. After I reviewed the updated PR and had a further thought on this, I changed my mind and agreed with @jbee before I even read this above comment. My main concern is that it creates a lot of confusions with two classes live next to each other. Besides, it is ok to add methods to ConfigSource and update as we wish. We can just increate the major version for this package. |
@jbee when @radcortez adds another method |
I think it is probably better to break compatibility and make ConfigSource use ConfigValue in that case. |
@Emily-Jiang only partly. Default in combination with conversion is the use case. The one arising from |
Agree, adding methods to With conversion added to capabilities of The issue I have with |
I understand. On the other hand, we want implementors to implement the
I do think that
I'm ok to change |
Generally I support the thought of this being concepts that are dealing with another domain, the domain of configuration, and thus should not be involved with conversion. Without conversion though I'd also think the API is unreasonable inconvenient to use. While discussing conversion is a topic on its own I find it relevant here to the extend that it has to fit in with where values are coming from and what that implies for what you can do with them and what you can't or at least what gets tricky or dirty to implement. In that sense I feel the topic of conversion is relevant here.
In general this seems a reasonable thing to do. But given the very limited nature of the conversion MP config offers I'd think it makes for a rather poor general conversion standard. In context of configuration I can see how its limitations are a reasonable way but to lift this to a conversion standard would mean it has to become more capable at which point I'd wonder why such a standard would start from the conversion done in MP config as the hard parts are everything beyond the basic capabilities MP config has. |
Yes, a Conversion spec must offer way more and the one in Config is very limited. I don't say that it needs to start with Config, but we definitely need something. Other projects in MP like JWT also require conversions, so it is a waste that this problem is being tackled individually in each spec instead of globally. Then you end up with Conversion API's for JPA, JAXB, JsonB, Config, JWT, etc. Probably being too optimistic thinking that we can solve this issue :) Anyway, ideally, we should design our API's in a way that if we move forward with it, we are able to replace current Conversion mechanism with another one. Or we can just forget about it and do what we think is better for Config in particular. |
Both spec and TCKs need to be added. |
Ok, but what do we want to add in the spec? This doesn't really change anything spec related. just a couple of new API's. |
@radcortez This section needs to be updated to demonstrate the ConfigValue usage. Thoughts? |
Never thought about injection of |
api/src/main/java/org/eclipse/microprofile/config/ConfigValue.java
Outdated
Show resolved
Hide resolved
api/src/main/java/org/eclipse/microprofile/config/ConfigValue.java
Outdated
Show resolved
Hide resolved
api/src/main/java/org/eclipse/microprofile/config/ConfigValue.java
Outdated
Show resolved
Hide resolved
api/src/main/java/org/eclipse/microprofile/config/ConfigValue.java
Outdated
Show resolved
Hide resolved
api/src/main/java/org/eclipse/microprofile/config/ConfigValue.java
Outdated
Show resolved
Hide resolved
api/src/main/java/org/eclipse/microprofile/config/ConfigValue.java
Outdated
Show resolved
Hide resolved
api/src/main/java/org/eclipse/microprofile/config/ConfigValue.java
Outdated
Show resolved
Hide resolved
tck/src/main/java/org/eclipse/microprofile/config/tck/ConfigValueTest.java
Outdated
Show resolved
Hide resolved
@radcortez as promised, I have another review and logged some minor comments. Overall, it looks good. |
Thank you. I think I've addressed all of your comments. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @radcortez for keeping this going. Just the wrong year to correct and this should be good to go.
tck/src/main/java/org/eclipse/microprofile/config/tck/ConfigValueTest.java
Outdated
Show resolved
Hide resolved
Just rebased and squashed to make it more clean. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Thanks @radcortez !
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@radcortez I suddenly realised the TCK should also ensure the winning property config source name and value etc are populated. Can you add another config source with a lower priority for the same config property to test this contract?
They are tested here: I can another source anyway. |
Signed-off-by: Roberto Cortez <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @radcortez! LGTM!
@radcortez feel free to merge this PR! |
I believe @radcortez has address the feedback from @OndroMih and @struberg ! This PR has been open for a while without further feedback. I'm merging this PR because of @radcortez has not got permission to merge the PR as yet. |
Hi, @Emily-Jiang, @radcortez, I didn’t have time to review before you merged this but for the record I approve now. I had a look and it really reflects all my comments, thank you! |
Here is the initial proposal to support the ConfigValue API in MP Config.
Most likely, we need more detail in the spec, but I didn't want to be really extensive, since all of this is subject to change during revision.
Fixes issues:
#43
#312