-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
Replace ApplicationIndexBuildItem with CombinedIndexBuildItem where it makes sense #8001
Conversation
Let’s not rush this thing in. We need to be very careful about it as we did the opposite change in various places a few months ago. |
I'd like to clarify though whether it makes sense or not pretty much asap. |
@mkouba any chance you could have a look at that one? IIRC, one issue is that |
@gsmet |
@@ -89,7 +87,7 @@ void setup(CombinedIndexBuildItem combinedIndex, | |||
boolean needsValidation = ClassConfigPropertiesUtil.addProducerMethodForClassConfigProperties( | |||
deploymentClassLoader.getClassLoader(), classInfo, producerClassCreator, | |||
configPropertiesMetadata.getPrefix(), configPropertiesMetadata.getNamingStrategy(), | |||
applicationIndex.getIndex(), configProperties); |
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.
@geoand do you remember the reason why class-based @ConfigProperties
requied the ApplicationIndexBuildItem
? I think it's safe to use the CombinedIndexBuildItem
here...
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.
Yeah, it's probably just an oversight on my part
Right, that's what this change is about. |
@@ -109,7 +107,7 @@ void build(CombinedIndexBuildItem index, | |||
MetamodelInfo<EntityModel<EntityField>> modelInfo = modelEnhancer.getModelInfo(); | |||
if (modelInfo.hasEntities()) { | |||
PanacheFieldAccessEnhancer panacheFieldAccessEnhancer = new PanacheFieldAccessEnhancer(modelInfo); | |||
for (ClassInfo classInfo : applicationIndex.getIndex().getKnownClasses()) { | |||
for (ClassInfo classInfo : index.getIndex().getKnownClasses()) { |
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.
@FroMage modelClasses
are built from the CombinedIndexBuildItem
so it should be safe to use it here as well, or?
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.
That would probably solve the bug where people access entities outside the root application, but might be costly since we still don't have any way to index users of specific classes.
@mkouba how about this?
This allows to pickup beans from all the application archives instead of just from the root one. |
@aloubyansky ArC is using a special index build in the BeanArchiveProcessor and it does pick up classes from all app archives. |
Ok, the change I pasted does fix the issue though. So it's just not a proper index then. |
This did work
Thanks. |
c889a72
to
d60adec
Compare
@aloubyansky Hm, I don't think we should use the On the other hand, it may not be needed after the class loading changes... @stuartwdouglas Any idea? |
The issue I'm fixing is a use-case of io.quarkus.arc.test.remove.RemoveFwkBeansTest but when UnusedBean is not in the root app archive. Would that be a completely test? |
Looks like it broke the TS. I'll keep looking into it. |
…rch for resources in all the application archives instead of only in the root where it makes sense
d60adec
to
403bf6c
Compare
I rolled that one back. |
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.
Got approval from various people on Zulip.
Let's merge it early.
.. and search for resources in all the application archives instead of only in the root one
I am not sure whether it all makes sense. I'm doing some refactoring and these changes did help.