You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Helidon MP Config is not correctly handling per property overriding precedence when config profiles (spec) are used. Note that this is not a change from the MP Config 3.0 spec -- just a clarification.
The proper behavior is that a profile-specific property only overrides the vanilla property per config source. Therefore if I specify the vanilla property in a config source with a high ordinal, it should trump any profile specific property from a config source at a lower ordinal. Our implementation appears to always place a higher precedence on the profile-specific property. Looks like this is the problematic code:
barchetta
changed the title
4.x: MP Config does not correctly handling per property overriding precedence with config profiles
4.x: MP Config does not correctly handling per property overriding with config profiles
May 9, 2024
Environment Details
Problem Description
Helidon MP Config is not correctly handling per property overriding precedence when config profiles (spec) are used. Note that this is not a change from the MP Config 3.0 spec -- just a clarification.
The proper behavior is that a profile-specific property only overrides the vanilla property per config source. Therefore if I specify the vanilla property in a config source with a high ordinal, it should trump any profile specific property from a config source at a lower ordinal. Our implementation appears to always place a higher precedence on the profile-specific property. Looks like this is the problematic code:
helidon/config/config-mp/src/main/java/io/helidon/config/mp/MpConfigImpl.java
Line 114 in a905313
helidon/config/config-mp/src/main/java/io/helidon/config/mp/MpConfigImpl.java
Line 133 in a905313
Steps to reproduce
You can run the MP Config 3.1 TCK. See #8724. Or
microprofile-config.properties
:%dev.app.greeting=Yo
java -Dmp.config.profile=dev -Dapp.greeting=Hola -jar target/quickstart-mp.jar
curl -X GET http://localhost:8080/greet
You'll see the application returns the property from the
dev
profile which is incorrect:According to the spec (and the 3.1 TCKs) it should return the value from the system property (
Hola
) since that ConfigSource has a higher ordinal.The text was updated successfully, but these errors were encountered: