-
Notifications
You must be signed in to change notification settings - Fork 69
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
Bringing domain-name on par with the rest of the optional configurations #707
Bringing domain-name on par with the rest of the optional configurations #707
Conversation
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.
Awesome, thanks!
I tested from the
everything works fine. |
@duchamk Can you please attach a reproducer including your entire application.properties? |
59d057b
to
0480927
Compare
@duchamk It seems that due to naming conventions, there are some conflicts between the values of the parent configuration, and the named configurations. It's fairly complicated to fix, so after discussing with @geoand we resorted to using "dummy" defaults in the embedded models, and filtering the value selection in the code by comparing them with the default Dummy value. I made some minor corrections by leaving as much of the code intact at this point, until a better solution comes into play. @duchamk, can you please check the new configuration and see if this works as expected? |
Thanks for taking this up! |
import io.smallrye.config.WithDefault; | ||
import io.smallrye.config.WithDefaults; | ||
import io.smallrye.config.WithParentName; | ||
import io.smallrye.config.*; |
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.
Please don't use star imports (which the IDE tends to add automatically).
return deepDomainName | ||
.filter(v -> !ConfigConstants.DUMMY_VALUE.equals(v)) | ||
.or(new Supplier<Optional<String>>() { | ||
@Override | ||
public Optional<String> get() { | ||
return domainName(); | ||
} | ||
}); |
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.
If would love it if we avoided lambas and just used imperative code here:)
|
No changes, same as before. |
Can you please rebase this onto |
@duchamk can you attach the sample you are using that shows the problematic behavior? Thanks |
I will can do it after 14.07, I'm on vacation now. |
No problem, in that case we'll merge this for the time being |
@csotiriou can you rebase please? |
7e46f71
to
1f5bc97
Compare
Just made the rebase. From what we have been discussing with @geoand , there are some conflicts in the namings of the configuration properties, which - if the next version wants to keep backwards compatibility with properties - is non-trivial and dangerous to try to solve. Those conflicts are the cause of the behaviour you are experiencing, @duchamk From what I can gather from george, there may be a possible fix in the future, but it's somewhat dangerous to try to squeeze it right now into what we have. |
I actually don't think there are any conflicts with your latest fix |
handled embedded configurations conflict with the parent configurations. visibility change fixing imports formatting
1f5bc97
to
401b02b
Compare
@geoand |
Thanks |
Which exactly is the problematic part you are seeing in that sample? |
For configuration in application.properties:
RAG, embedding and chat work properly, the domain is entered correctly.
then the domain stops substituting. |
I tried your sample using
Am I missing something? |
Addition to #698, this brings the
domainName()
configuration property to feature parity with similar properties, like deploymentName.