-
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
Quarkus 1.6.0.Final does not resolve profile-scoped variables correctly in the configuration #10643
Comments
cc @radcortez |
Checking. |
Hey @dmlloyd, just want to check something with you. This is happening because our interceptor Expression expansion does not reevaluate the entire chain, so to resolve the profile (if exists) in the expression. We had that discussion, about having a way to reevaluate the chain, or just proceed to the next interceptor and we decided to just proceed. In this case, we would need to reevaluate the chain. In fact, if we look into the old We were calling an explicit What do you think? Should we add the capability to reevaluate the entire chain, so profiles can also be resolved in expressions? |
Possibly. But in this particular case, would it not make more sense to put the profile interceptor later in the chain than the expression interceptor? |
That may be also a possibility. In that case, configurations like:
Will fall into a recursion and won't work. Which they didn't anyway in Quarkus 1.5, so maybe this isn't a big deal and we assume that a profile lookup on the same property is not supported. |
The interception mechanism was meant to solve these recursion issues, so it would be nice to do this "right" and order the interceptors to get the desired behavior. |
Yes, but in one case you want to resolve an expansion with a profile, so you need the order to be Expand -> Profile, and in the other you want to resolve the profile and then expand, so you need Profile -> Expand. BTW the case were you get the recursion if you reorder the interceptors, is when you point a profile property to the main property (with the same name). Regular cases work just fine. So maybe it doesn't make much sense to set a |
@radcortez, forgive me if I break into your conversation. Of course it does not make any sense at all to set a I just want to point out the case I used in the issue is not this.
|
I don't think that's true. There doesn't seem to be any reason or use case to justify doing profile mapping first, since you get the same result from the perspective of the expression expander. In fact there's a good reason to put it towards the end of the chain: no other interceptor really needs any awareness of profiles.
|
@evisentin no worries, feel free to provide any feedback :) Yes, we understand the reported use case. I was just discussing about some other possible implications. Considering the example cases:
Currently, Case B works and Case A doesn't, because order is Profile resolution first and then Expansion. If we change the order, Expansion first and then Profile, Case A now works, but Case B stops working, which is fine by me. If we want to have Case A and B to work together, we would need the ability to reevaluate the chain, like described here: #10643 (comment) |
I do not believe this is true (though I guess you meant the expression to be |
Ops, I've messed something up on the Case B sample. It should look like this:
In this case: Expand |
OK, yeah that case was always expected to fail AFAICT, for the same reason that |
Yes, there is no way around foo=${foo}, but for %dev.foo=${foo} it may be different since they can be considered two properties. Anyway, not much point to continue the discussion around this. Let's just assume that this is not supported and I'll fix the interceptor order in SmallRye Config. Thanks @dmlloyd ! |
Pushed a fix to SmallRye Config and Quarkus update here: #10615 |
the following configuration does not work on Quarkus 1.6.0.Final:
when I use
mvn quarkus:dev
the service picks the wrong port: 8081 ( it ignores the %dev profile and resolves the wrong version of 'my.application.http.port' ),while it works perfectly with Quarkus 1.5.2.Final
This configuration, on the other hand, works fine with both versions
The text was updated successfully, but these errors were encountered: