Repository navigation
Operator CRD with generated ServerConfiguration from refactored config - #11929
Conversation
There was a problem hiding this comment.
@andreaTP Nice job, I like this approach! 👍 Although I fought a bit with my IDE to make it index the generated class.
Added a few comments but mostly just suggestions for polishing.
The remaining issue we have to tackle is how to handle the exceptions in a nice way – how to make some propety hidden from Quarkus or the Operator.
cc7d17e to
7649588
Compare
There was a problem hiding this comment.
I guess this is also another example of how we should be obtaining all available options from the server configuration?
There was a problem hiding this comment.
Correct, and it can/will be used by the following modules.
I aim to get this first "example" in, and to bulk move the encoding of all the options in a follow-up PR to help with reviews and split up work.
There was a problem hiding this comment.
Can't we replace this class and Option now we have similar types in from the new module?
There was a problem hiding this comment.
We can replace some of this, unfortunately, looks like SPIs configuration is still not covered:
In this PR I took out the docs bit to be able to perform the change incrementally (i.e. with subsequent non-breaking PRs)
E.g. the docs sub-module will rely on the new configuration only after we move all the configuration keys to the new encoding.
There was a problem hiding this comment.
Although we don't have yet a proper support for exposing SPI configuration options, the new module should be able to provide them similarly to what you did to HttpOptions.
The difference here is that these options are dynamic as they come from whatever provider is installed on the server. In the future, and that is related to the extension story, it should also resolve options from custom providers.
If you want, I can look at this closer and try to come up with something to support this.
|
@andreaTP Nice work, looks like you are in the right direction :) Looks like we can also refactor the
|
There was a problem hiding this comment.
Absolutely the right direction, thanks for that 👍 👍
One thing I'd still love to see (in a further step) is validations in this package. Imo the general validation rules are not dependant on the runtime - they depend on the (way less often changed) standards, e.g. "what is a valid range for a port"? could be answered the same for wildfly, quarkus and pretty much every httpserver out there. As a result, this package should imo be the place to define the validations, e.g. Option defining a Predicate/Function, and perhaps to not impose delays a way to skip the validations in favor of better startup times, bc. they are known to be working.
This would then also enable e.g. the possibility to write an IDE plugin that checks your configuration files for validity even before starting up.
But as said: Nice step in the right direction 👍 rest is for the future.
|
@pedroigor I'll look into the further refactoring you proposed, seems good to me! @DGuhr I agree on the "validation" bits, but this change is going to be invasive enough without them, will follow up as soon as this encoding is more stable (I already have a pretty good idea on how to do it 🙂 ). Thanks for the feedback everyone! |
|
@pedroigor I have attempted to follow your suggestions:
Unfortunately found out that the
Now |
|
@pedroigor @vmuzikar @DGuhr ready for the next round of review, please consider that this is not the "final" PR and more cleanup will be done in the follow-up PRs to bring the task to completion. 🙏 The goal here is to get the "infrastructure setup" for the new configuration in place, along with one example property already ported over. |
There was a problem hiding this comment.
@andreaTP Thanks for the update, really nice work! :)
Added a few comments. Mainly just nitpics to make the compiler happy and/or to align with best practices. The only thing that's blocking merge from my PoV, is the added dependency on commons-text.
There was a problem hiding this comment.
Again, just a nitpick. My IDE is complaining about using Optional as a field and for a good reason actually.
There was a problem hiding this comment.
not sure what to do here, I changed everything to Optional because of a previous comment on this PR ...
There was a problem hiding this comment.
I see. I assume you are referring to this: #11929 (comment) (CC @DGuhr).
I'm not fussy on it, we could leave it as is. Just from my PoV the point in the mentioned article:
The class is definitively not intended for use as a property
as well as a note in the official docs:
Optional is primarily intended for use as a method return type where there is a clear need to represent "no result,"
are clear to me that it should not be used as field types.
There was a problem hiding this comment.
Personally, I have mixed feelings about it, maybe we can briefly discuss this point in 2/3 weeks and decide what to do with it.
There was a problem hiding this comment.
Just out of curiosity. Can't we install the Maven plugin and operator in a single step? It'd provide a better UX, IMHO.
There was a problem hiding this comment.
I will check, in general, for local development, we need to install the maven-plugin once and iterate with the operator build.
There was a problem hiding this comment.
I did a quick test (mvn clean install in operator module with local mvn repo cleaned of any traces of the Operator) and seemed to work fine. Maven seems smart enough to build the plugin dependency first.
|
@vmuzikar can you please double-check that I have answered/followed your comments? |
|
apparently some of those changes have broken the build, will fix it by EOD. |
There was a problem hiding this comment.
@andreaTP Thanks for the update. LGTM, just found a bug in the camel case method, I believe.
it might already be "good enough" as an iteration and we can fix things on top at a later stage, wdyt?
+1, we just need to agree on the follow-up steps (if there are any) :)
|
I finished fixing the open points, and squashed the commits. This should be ready for a final round @pedroigor @vmuzikar |
There was a problem hiding this comment.
@andreaTP Thank you for the update!
Just for the visibility, the last thing I'd like to align on is this: #11929 (comment).
|
@vmuzikar removed the redundant |
Sorry, if I was not clear. I meant methods like I would say that formatting is a must for this new module. |
|
@pedroigor I have attempted to move those and this is the result:
In general, I believe that this PR is already big enough, do you agree to tackle this improvement separately? Do you wanna open a new Issue for it? |
|
@vmuzikar needed to rebase because of conflicts, would you mind to re-approve? |
It should be fine to borrow that code from SmallRye and have it on our side. But yeah, you have a good baseline, I'll look at these points later and collaborate with some changes. |
There was a problem hiding this comment.
Although we don't have yet a proper support for exposing SPI configuration options, the new module should be able to provide them similarly to what you did to HttpOptions.
The difference here is that these options are dynamic as they come from whatever provider is installed on the server. In the future, and that is related to the extension story, it should also resolve options from custom providers.
If you want, I can look at this closer and try to come up with something to support this.
Initial work to resolve: #10866
A possible plan to get this to
mainwould be:serverConfigin a third follow up PR