-
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
Switch Hibernate ORM/Reactive/Envers extensions to @ConfigMapping #38731
Conversation
/cc @gsmet (hibernate-orm) |
@WithDefault("_AUD") | ||
Optional<String> auditTableSuffix(); |
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.
Yes it's very weird to have defaults on Optional
properties, but as you can see that was already the case before. I didn't want to go into that rabbit hole for this PR, since my changes are unrelated.
This comment has been minimized.
This comment has been minimized.
Hey @zakkak , looks like native image size drifted off again... is that a new problem, or one that should be solved after a rebase? I'm really not sure why this PR would trigger this, so I assume it's also affecting main...
|
Except if |
Still, +200 methods with reflection enabled? We don't have that many enums in that config. Unless it also enables reflection on every single method of every single configuration interface? Let's see if @radcortez (hey!) notices something wrong in this PR or in the reflection-enabling code, and if not I'll just raise the baseline. |
FWIW The actual difference (between this PR and
The rest of the difference is carried over from previous changes that resulted in differences < 3%. It still seems quite a lot. |
Just noticed this code was taken from a "quarkus-spring" extension, which isn't relevant here. I'll need to find the full list of methods enabled for reflection, before and after this PR. Then we can start asking ourselves if the new ones really are necessary. |
If I remember correctly, we enable reflection on every mapping method because of Bean Validation. Most extensions don't use it, so maybe we can be smarter and only register the BVal annotations methods. Anyway, let me confirm if this is the case and adjust. |
Hum... BTW, we are looking into the wrong code. That code is from the old quarkus/core/deployment/src/main/java/io/quarkus/deployment/configuration/ConfigMappingUtils.java Lines 87 to 119 in 1d65999
It even has a comment about BVal, which confirms my initial thoughts. |
FWIW, there is a build item with all the Bean Validation annotations we detected. So we could probably check if a method has a Bean Validation annotation. |
Right; see my previous comment.
I think the BV extension already registers the interfaces for reflection. And I'd expect it to register the implementations as well, it's completely its responsibility. |
For me the ConfigMapping optimization problem is orthogonal to this PR. Given the size of it and the possibility of conflicts, I would prefer we raise the threshold for now (in a separate commit) and that we create an issue with a reference to this commit, that we would revert once the problem is fixed. If by chance, we significantly improve things, we could even lower the thresholds. |
…ration It was taken into account in ExtensionAnnotationProcessor, but not in ConfigDocItemFinder. Don't ask me what the difference is, or why there are two places where we parse such annotations, but I know we did end up with supposedly "ignored" config properties in the generated asciidoc.
Numbers for version 23.1 updated from numbers reported by the build here: quarkusio#38731 (comment) Numbers for version 23.0 simply incremented by the difference reported by Foivos here: quarkusio#38731 (comment)
Mappings are in Jandex, and there is a build item that carries the mapping information. We even use that in BVal, to start its own validator (to avoid circular dependencies). In the initial implementations, I've probably added the full registration preemptively, because I knew it was going to be needed and didn't think about optimizations :) |
db431ab
to
3a21516
Compare
Right. I added a commit to update the thresholds. Let's merge if the build passes now. |
I've looked, and here I've changed to register the methods: https://github.com/quarkusio/quarkus/pull/12501/files#diff-26708186baae4b2358b51f3bc3c5731740eff57a0a63fb3a150d15183e817f55R214 Looking into the commit, it seems I added it to allow returning the mapping directly in a REST resource with Jackson. That is probably not required anymore. Let me remove that and see what fails and adjust. |
FWIW to do this you can extract the
|
If you're adding reflection solely for Bean Validation requirements, then you can drop it. |
Status for workflow
|
Fixes #38321 (I checked manually)
Three reasons for this change:
@ConfigItem
stuff is more or less deprecated. At least it's not supposed to evolve anymore.@ConfigMapping
.