-
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
Completely disable all relevant build steps of extensions (except FeatureBuildItem production) when their "enabled" configuration switch is set to false #26966
Conversation
/cc @brunobat, @ebullient, @jmartisk, @radcortez |
...ent/src/main/java/io/quarkus/micrometer/deployment/MicrometerConfigUnremovableProcessor.java
Outdated
Show resolved
Hide resolved
Can't say I'm excited about this particular one. For me, it's important to know that the feature has actually be detected by Quarkus even if not active. |
We'll have to make up our minds then, because other extensions (Micrometer, ...) hide the feature when they are disabled: Lines 86 to 89 in 8816386
For context, here's the log message we're talking about:
We can argue whether it's clear that "installed" doesn't mean "enabled". Personally I find the distinction too confusing and I would hide the extensions when they are disabled, but in the end I don't really care either way, as long as we're consistent across Quarkus. FWIW, we also use quarkus/core/deployment/src/main/java/io/quarkus/deployment/steps/MainClassBuildStep.java Lines 257 to 264 in c09cf50
Not sure what to think about that. We probably wouldn't want to have two extensions providing the same feature even if one is disabled? EDIT: Though that could be useful for users who end up having two (incompatible) extensions in the classpath that provide the same feature... Two alternative implementations with a common API maybe, but integrating with different technologies/environments? I don't know... |
Well I don't know about Micrometer but the purpose of this message has always been to inform about the features detected by Quarkus. We can decide to change that. But... my personal opinion is that it's not a good idea. Knowing that an extension has actually been detected is an important piece of information and why we have this line in the log.
I think this is probably something that predates capabilities. But it's still a good thing in my opinion as having 2 features with the same name would be confusing. |
8fd0b8d
to
7821b5e
Compare
f9fa839
to
0c869e7
Compare
…figuration I.e. don't enable SSL.
I.e. don't add reflective classes in native mode, ...
0c869e7
to
a7a1590
Compare
Hey @sberyozkin, bump :) Any opinion on this change for the |
@yrodiere I'm really happy to see this change happening. It would help a lot Keycloak and open the doors to lot of improvements. For instance, quarkiverse/quarkus-vault#12 (comment). AFAIK, this PR should help with that. As per the security extensions, I would leave it to @sberyozkin. But I don't see an issue for |
@yrodiere I guess the changes here are not yet allowing disabling build steps conditionally, right? For instance, Keycloak is basically a Quarkus extension and we would like to conditionally disable build steps depending on the user configuration when running re-augmentation. |
I'm not sure it will, since this PR only disables a few build steps when the (existing) As to disabling extensions at runtime, which I think was mentioned in the issue you linked, that's still not possible, unfortunately. But maybe |
This PR doesn't change anything regarding that, no.
That was already possible, I think? Just use Recently I added |
Yeah, using a condition to a Can I expect that when a class is using |
Btw, also related to what we are looking for #22122. |
No, reflection will still happen. Conditions are evaluated after I don't know if your suggestion can be implemented either: I'm not too familiar with this code, and there's so many levels of callbacks in this code that it's hard to say what's going on for sure :) But someone obviously made the choice to delay evaluation of conditions, and I'm guessing there's a reason for that. Maybe it would be better to open a dedicated issue to discuss that. |
@yrodiere Sure, thanks for your input. This change is still valuable and we should be looking at how adapt to it. |
@yrodiere I think we should pursue with this before we end up with conflicts. |
No answer, so I'll assume it's good to go. Thanks everyone! Merging |
... I'll let CI run first though :-) |
In particular, when such an extension is disabled:
Don't display the feature in logs on startup=> changed following comments, see conversation below.EDIT: Also, regardless of whether the extension is enabled or not, always display the feature in logs on startup.
Creating this PR as draft, because it's based on #26965 , which must be merged first.=> DoneI separated this PR from #26965 because #26965 doesn't alter the behavior of any extension, while this PR does (but for the better, IMO).