Stop mutating shared ParsedPersistenceXmlDescriptor in build steps - #51628
Open
Pepo48 wants to merge 1 commit into
Open
Stop mutating shared ParsedPersistenceXmlDescriptor in build steps#51628Pepo48 wants to merge 1 commit into
Pepo48 wants to merge 1 commit into
Conversation
Closes keycloak#47482 Signed-off-by: Peter Zaoral <pzaoral@redhat.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Warning
Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.
Stops mutating the shared ParsedPersistenceXmlDescriptor during Quarkus build steps by switching entity registration to Quarkus’ JPA model contribution mechanism (closes #47482).
Changes:
- Introduces
JpaModelPersistenceUnitContributionBuildItemto contribute entities instead of mutating the parsed persistence unit descriptor. - Refactors default PU entity discovery to collect entities and emit a contribution build item.
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+637
to
+652
| List<String> additionalEntities = new ArrayList<>(); | ||
| for (AnnotationInstance annotation : annotations) { | ||
| AnnotationTarget target = annotation.target(); | ||
| String targetName = target.asClass().name().toString(); | ||
|
|
||
| if (!userManagedEntities.contains(targetName) | ||
| && (!targetName.startsWith("org.keycloak") || targetName.startsWith("org.keycloak.testsuite"))) { | ||
| descriptor.addClasses(targetName); | ||
| additionalEntities.add(targetName); | ||
| } | ||
| } | ||
|
|
||
| if (!additionalEntities.isEmpty()) { | ||
| jpaModelPuContributions.produce(new JpaModelPersistenceUnitContributionBuildItem( | ||
| descriptor.getName(), descriptor.getPersistenceUnitRootUrl(), | ||
| additionalEntities, Collections.emptyList())); | ||
| } |
Contributor
Author
There was a problem hiding this comment.
Not valid - it doesn't account for the constructor's defensive copy into a TreeSet.
shawkins
enabled auto-merge (squash)
August 11, 2026 16:42
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #47482