-
Notifications
You must be signed in to change notification settings - Fork 25
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
Expression MP mode #354
base: main
Are you sure you want to change the base?
Expression MP mode #354
Conversation
@dmlloyd let me know if you are ok with this new mode. |
We would never use this mode, would we? |
Well, until we find a better alternative, this would be my proposal based on our discussions: We would add this new flag to the list of flags that SR Config already uses: |
Wouldn't it be better to just not comply with the MP config spec in this regard? It's clearly wrong. People using |
No, this mode supports both styles; you can use one or the other to escape an expression.
I believe the situation is pretty much the same. It does remove the current workaround in SR Config (so it is the same) and allows you to use Is it the ideal world? I agree it isn't, but we discussed other directions which cause a greater impact. I'm pretty sure we can change the MP spec, but until then we need to rely on subpar implementations, unfortunately. |
I disagree; we did discuss impact but in this case I think the greater consideration is the long-term effect. The impact of switching to a consistent solution is short-term. Once everyone has adapted to the new reality, it will be a stable solution always with no new bug reports. The impact of switching to an inconsistent solution is long-term. As people discover problems, we add more exceptional cases to cover them, and then as people discover problems with those, we add yet more exceptional cases. The code gets more complex, and compatibility becomes more and more difficult. |
I'm fine to remove the MP escape But I do think that the
While documented, I would say most users are unaware of this and only look for it when they need to escape an actual expression. This leads to hard-to-debug problems, especially with passwords, because you get a wrong password problem and have no idea why. |
It cannot be context aware though. Otherwise you have an ambiguous parsing rule for |
This is to say, we need to solve the password issue some other way IMO. |
My proposal is to be
Ok, what are the options? |
We could have a |
Well, you know that it is pretty much impossible to force users to do that :) With the new So, considering a value as |
Yes, the original value must be changed no matter what if it has an unintended expression string or an unintended escape in it. |
Then I feel it is not going to improve the situation. I would like to avoid users having to jump through additional hoops to get what they expect. Modifying the value with an additional escape, quoting scheme, or literal is pretty much the same situation. It may improve how the issue is resolved but will not help identify the problem. |
Adds a new Expression mode to support MP escape
\$
and keeps compatibility with$$
escape only in the presence of an expression, allowing to escape$${exp}
, but keepingexp$$exp
as a plain literal.This allows the removal of the SR Config workaround:
This also allows the removal of the workaround for MP Config:
https://github.com/smallrye/smallrye-config/blob/d447b0c346e39a09c6d07c7d5ce8186bd4154037/implementation/src/main/java/io/smallrye/config/ExpressionConfigSourceInterceptor.java#L102-L123