8000 Upgrade to the Quarkus 3.24.2 version by mabartos · Pull Request #40867 · keycloak/keycloak · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Upgrade to the Quarkus 3.24.2 version #40867

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

mabartos
Copy link
Contributor
@mabartos mabartos commented Jul 2, 2025

Closes #40592

  • Upgrade to Hibernate 7 (we could run some benchmarks)
  • JDBC drivers update
  • Removing some unnecessary dev dependencies. Some cannot be removed:
    Screenshot From 2025-07-02 16-24-19

Closes keycloak#40592

Signed-off-by: Martin Bartoš <mabartos@redhat.com>
@keycloak-github-bot
Copy link

Unreported flaky test detected

If the flaky tests below are affected by the changes, please review and update the changes accordingly. Otherwise, a maintainer should report the flaky tests prior to merging the PR.

org.keycloak.testsuite.cluster.SessionFailoverClusterTest#sessionFailover

Keycloak CI - Clustering IT

java.lang.RuntimeException: java.lang.IllegalStateException: Keycloak unexpectedly died :(
	at org.keycloak.testsuite.arquillian.containers.KeycloakQuarkusServerDeployableContainer.start(KeycloakQuarkusServerDeployableContainer.java:71)
	at org.jboss.arquillian.container.impl.ContainerImpl.start(ContainerImpl.java:185)
	at org.jboss.arquillian.container.impl.client.container.ContainerLifecycleController$8.perform(ContainerLifecycleController.java:137)
	at org.jboss.arquillian.container.impl.client.container.ContainerLifecycleController$8.perform(ContainerLifecycleController.java:133)
...

Report flaky test

Copy link
@keycloak-github-bot keycloak-github-bot bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unreported flaky test detected, please review

@mabartos
Copy link
Contributor Author
mabartos commented Jul 4, 2025

Failures to Operator seem related to: #40932

@mabartos mabartos marked this pull request as ready for review July 4, 2025 14:04
@mabartos mabartos requested review from a team as code owners July 4, 2025 14:04
Copy link
Contributor Author
@mabartos mabartos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added some comments for better review of these changes.

Changes of the JpaUtils can only be verified when running Keycloak on Undertow as it is used with the DefaultJpaConnectionProviderFactory which is replaced with QuarkusJpaConnectionProviderFactory for Keycloak on Quarkus. For Quarkus, we already know the persistence units gather in the KeycloakProcessor.

@yrodiere May I ask you for a brief review of the Hibernate 7 changes for the PersistenceXmlParser? I see that you did some changes on the Quarkus side, so it'd be great if you could check this. Thank you very much!

@vmuzikar @shawkins Could you please check this? Thanks!

Comment on lines -61 to +73
List<ParsedPersistenceXmlDescriptor> persistenceUnits = new ArrayList<>(PersistenceXmlParser.locatePersistenceUnits(properties));
PersistenceXmlParser parser = PersistenceXmlParser.create(properties);
List<URL> urls = parser.getClassLoaderService().locateResources("META-INF/persistence.xml");

persistenceUnits.add(PersistenceXmlParser.locateIndividualPersistenceUnit(JpaUtils.class.getClassLoader().getResource("default-persistence.xml")));
List<ParsedPersistenceXmlDescriptor> persistenceUnits = urls.isEmpty() ? new ArrayList<>() : transformPersistenceUnits(parser.parse(urls).values());
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mimic the behavior of the PersistenceXmlParser#locatePersistenceUnits with the new approach for locating all these persistence.xml resources - inspired by the HibernateOrmProcessor#parsePersistenceXmlDescriptors in Quarkus.

@@ -56,11 +61,22 @@ public static String getTableNameForNativeQuery(String tableName, EntityManager
return (schema==null) ? tableName : dialect.openQuote() + schema + dialect.closeQuote() + "." + tableName;
}

private static List<ParsedPersistenceXmlDescriptor> transformPersistenceUnits(Collection<PersistenceUnitDescriptor> descriptors) {
return descriptors.stream().map(descriptor -> (ParsedPersistenceXmlDescriptor) descriptor).collect(Collectors.toList());
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Persistence unit descriptor is always ParsedPersistenceXmlDescriptor when parsed from the persistence XML -> see https://github.com/hibernate/hibernate-orm/blob/7.0.5/hibernate-core/src/main/java/org/hibernate/jpa/boot/spi/PersistenceXmlParser.java#L181


persistenceUnits.add(PersistenceXmlParser.locateIndividualPersistenceUnit(JpaUtils.class.getClassLoader().getResource("default-persistence.xml")));
List<ParsedPersistenceXmlDescriptor> persistenceUnits = urls.isEmpty() ? new ArrayList<>() : transformPersistenceUnits(parser.parse(urls).values());
ParsedPersistenceXmlDescriptor defaultPersistenceUnit = transformPersistenceUnits(parser.parse(Collections.singletonList(JpaUtils.class.getClassLoader().getResource("default-persistence.xml")), txType)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wrap as a singletonList to be able to use the custom NoSuchElementException specified below. List.of() might potentially throw NPE, and we would not have the exact information about the failure.

I can share the reasoning if necessary.

ParsedPersistenceXmlDescriptor descriptor = PersistenceXmlParser.locateIndividualPersistenceUnit(
Thread.currentThread().getContextClassLoader().getResource("default-persistence.xml"));
PersistenceXmlParser parser = PersistenceXmlParser.create();
PersistenceUnitDescriptor descriptor = parser.parse(Collections.singletonList(parser.getClassLoaderService().locateResource("default-persistence.xml")))
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as described for the JPAUtils.

@mabartos mabartos requested review from shawkins and vmuzikar July 7, 2025 10:36
Copy link
Contributor
@vmuzikar vmuzikar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mabartos Thank you for the changes, LGTM.

But let's wait for @yrodiere's blessing as well before we merge.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Upgrade to the Quarkus 3.24.2 version
2 participants
0