-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Devmode, Regression in 1.6.0: Cannot override property from profile via system property #10570
Comments
/cc @geoand |
Darn... We really need to clarify the behavior we want and if we settle that the current behavior is the appropriate one, we need to make sure we communicate it in the release as a breaking change. cc @radcortez @gsmet |
And BTW, thanks for reporting and making the case clystal clear |
Interesting, this is the behaviour that we implemented in SmallRye Config (a property overrides a profile based configuration with higher priority) and that lead to #10320. Let me have a closer look. |
FWIW, I have implemented the following workaround (via yaml, not sure this works with properties): "%dev":
quarkus:
http:
port: ${someproject.quarkus.http.port:2081} And then |
Ok, I think the issue relates with #10320 resolution. Quarkus before 1.6 prioritises properties from higher ordinals even if they are not part of the active profile. The implementation we have was also correct. What changed was the execution order between resolution of profiles / expansion, leading to the issue in #10320 where a property was being expanded and failing because there was no expanding property. We fixed this by looking only into the profile, but that was actually a wrong fix, because it now introduced the bug described here. I already have an idea on how to fix this. I'll send a PR shortly. |
Great, thanks! |
An additional detail: The profile / expansion order was changed, so we could avoid a circular dependency with a configuration like:\
This means that a property is expanded before picking the profile. For the case of #10320 it ended up introducing another issue where we require the ordinal to know which one to use. Since expansion happens first, it ended up failing because it couldn't expand the value, but it didn't matter anyway because the property would never be used. |
@geoand I have the fix in SmallRye Config, which requires to update the dependency (I can release a 1.8.1 just with this fix), but I can extend the interceptor in Quarkus and apply the fix there. Which one do you prefer? :) |
Given that we just released 1.6.0.Final, I think that we have time to go the proper route with the smallrye release. cc @gsmet |
Ok, I'll try to add some more tests in Quarkus itself to pick up these regressions. |
Sounds like a plan 👍 |
Yes as long as the SmallRye Config update is minimal, I'm fine with backporting it to 1.6.1.Final. |
@gsmet @geoand this is current milestone for SmallRye Config 1.8.2 to fix this issue: It has a couple of more fixes. Probably the biggest change is around the YAML Config Source to fix smallrye/smallrye-config#216 and #6297. Let me know if this is ok to release. |
I am on PTO for a couple days, but a quick look at the fixed issues look good to me |
Yeah, same here, I would say let's go with it. |
Ok, pushing a release. Sorry @geoand I missed to check you were on PTO :( |
No worries 😊
…On Thu, Jul 9, 2020, 19:34 Roberto Cortez ***@***.***> wrote:
Ok, pushing a release. Sorry @geoand <https://github.com/geoand> I missed
to check you were on PTO :(
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#10570 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABBMDP5SEARUJKUEDHS42EDR2XWRNANCNFSM4OUSK2LQ>
.
|
I've pushed the fix to SmallRye Config and updated Quarkus here: |
Describe the bug
Overriding a property that is defined in the
%dev
profile via system property (-D...
) does not work anymore.Expected behavior
System property must take precedence (as in 1.5.2 or lower)
Actual behavior
Profile in properties/yaml takes precedence.
To Reproduce
Steps to reproduce the behavior:
git switch devmode-port-override
cd getting-started
mvn clean verify
mvn quarkus:dev
starts on port 2081mvn quarkus:dev -Dquarkus.http.port=0
(or any other port) still starts on port 2081application.properties
mvn quarkus:dev -Dquarkus.http.port=0
starts with desired portConfiguration
%dev.quarkus.http.port=2081
Screenshots
n/a
Environment (please complete the following information):
uname -a
orver
:java -version
:mvnw --version
orgradlew --version
):Apache Maven 3.6.3
The text was updated successfully, but these errors were encountered: