+
Skip to content

Require setting DB kind for additional datasources #41087

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 10, 2025

Closes #41161

@shawkins Could you please check it? Thanks!

@mabartos mabartos force-pushed the requireDbKindForDatasources branch from 0de3c1a to f51691a Compare July 15, 2025 11:20
@mabartos mabartos requested a review from shawkins July 15, 2025 11:21
@mabartos mabartos marked this pull request as ready for review July 15, 2025 11:21
@mabartos mabartos requested review from a team as code owners July 15, 2025 11:21
Copy link
Contributor

@shawkins shawkins left a comment

Choose a reason for hiding this comment

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

Looks good, just a thought about the datasource name.

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

@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.account.AccountRestServiceTest#listApplicationsWithoutPermission

Keycloak CI - Java Distribution IT (windows-latest - temurin - 17)

org.openqa.selenium.TimeoutException: 
java.net.SocketTimeoutException: Read timed out
Build info: version: '4.28.1', revision: '73f5ad48a2'
System info: os.name: 'Windows Server 2022', os.arch: 'amd64', os.version: '10.0', java.version: '17.0.15'
Driver info: driver.version: HtmlUnitDriver
...

Report flaky test

org.keycloak.testsuite.account.AccountRestServiceTest#testUpdateProfileWithRegistrationEmailAsUsername

Keycloak CI - Java Distribution IT (windows-latest - temurin - 17)

org.openqa.selenium.TimeoutException: 
java.net.SocketTimeoutException: Read timed out
Build info: version: '4.28.1', revision: '73f5ad48a2'
System info: os.name: 'Windows Server 2022', os.arch: 'amd64', os.version: '10.0', java.version: '17.0.15'
Driver info: driver.version: HtmlUnitDriver
...

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

@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.RoleInvalidationClusterTest#crudWithFailover

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

Closes keycloak#41161

Signed-off-by: Martin Bartoš <mabartos@redhat.com>
@mabartos mabartos force-pushed the requireDbKindForDatasources branch from 7db64cc to 88268a1 Compare July 18, 2025 09:15
@mabartos mabartos requested a review from shawkins July 18, 2025 12:11
.filter(dbKind -> Configuration.getKcConfigValue(dbKind).getValue() == null) // not provided
.toList();

if (!notSetPersistenceUnitsDBKinds.isEmpty()) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Just to make sure, we're okay with this level of a breaking change? We talked previously about how persistence.xml is supported, but the use of quarkus properties still isn't, so this is grey area.

cc @vmuzikar

Copy link
Contributor Author

@mabartos mabartos Jul 18, 2025

Choose a reason for hiding this comment

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

@shawkins What about to ask for the quarkus.datasource."<datasource>".db-kind instead of kc.db-kind-<datasource> as we could fetch values from the quarkus.properties? In that case, we could still support both variants.

But in that case, we would not know anything about the wildcard name and we would not be able to advertise more properties such as JDBC URL to Quarkus used here: #41026

I'll think about it if we have some better alternatives.

Copy link
Contributor

Choose a reason for hiding this comment

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

But in that case, we would not know anything about the wildcard name

Our current logic presumes quoting and will associate the corresponding quoted quarkus property with the keycloak property. But I believe the smallrye handling does not do quoting normalizations, so if they leave the name of the datasource unquoted we won't find it.

@vmuzikar
Copy link
Contributor

I'd like to take a look at this early this week.

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.

Require setting DB kind for additional datasources
3 participants
点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载