8000 fix: updates to create a java admin client build by shawkins · Pull Request #48343 · keycloak/keycloak · GitHub
[go: up one dir, main page]

Skip to content

fix: updates to create a java admin client build - #48343

Merged
vmuzikar merged 2 commits into
keycloak:mainfrom
shawkins:iss48340
Apr 24, 2026
Merged

vmuzikar merged 2 commits into
keycloak:mainfrom
shawkins:iss48340

Conversation

@shawkins
Copy link
Copy Markdown
Contributor

I see the intent behind the ClientsWrapper class, but I don't think we're ready yet to commit to an api like that as it obsures the versioning and is a different realm paradigm than the existing methods.

For now I'd propose opening up the proxy method, as that won't unnecessarily expose anything that we wish to change later with the understanding that the client v2 interfaces aren't yet considered supported (I'm not sure if / where that needs documented).

Comparing with the fabric8 logic you have both methods, such as client.apps().statefulsets() - specifically for v1 statefulsetets, or you can also do client.resources(StatefulSets.class) for the general api.

Another set of changes is to set a lower source compatiblity level. The admin client is using 8, but setting the admin api v2 interfaces to v2 to 11 seems sufficient to have things compile, so I'd start there instead.

As noted in other issues, we still have to make it clearer how we're differentiating between admin api v2 (the new url structure) from the resource specific versions clients v2, v3, etc. - or even if the latter is still a good idea :) cc @michalvavrik

Related to that, our api structuring is not correct. Having a general "ClientsApi clients(String version)" endpoint means that we'll only ever have things that conform to the ClientsApi (v2) contract. It's not even possible to have a truly breaking change.

After this pr, I have changes for the admin client repo that will add the v2 classes.

closes: #48340

closes: keycloak#48340

Signed-off-by: Steve Hawkins <shawkins@redhat.com>
@michalvavrik michalvavrik left a comment
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I am fine with changes. One comment regarding a dead dependency in admin-client pom.

Signed-off-by: Steve Hawkins <shawkins@redhat.com>
@keycloak-github-bot keycloak-github-bot Bot left a comment
Copy link
Copy Markdown

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
Copy Markdown

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.authz.PolicyEvaluationTest#

Keycloak CI - Base IT (3)

org.opentest4j.AssertionFailedError: expected: <PERMIT> but was: <null>
	at org.junit.jupiter.api.AssertionFailureBuilder.build(AssertionFailureBuilder.java:151)
	at org.junit.jupiter.api.AssertionFailureBuilder.buildAndThrow(AssertionFailureBuilder.java:132)
	at org.junit.jupiter.api.AssertEquals.failNotEqual(AssertEquals.java:197)
	at org.junit.jupiter.api.AssertEquals.assertEquals(AssertEquals.java:182)
...
org.opentest4j.AssertionFailedError: expected: <PERMIT> but was: <null>
	at org.junit.jupiter.api.AssertionFailureBuilder.build(AssertionFailureBuilder.java:151)
	at org.junit.jupiter.api.AssertionFailureBuilder.buildAndThrow(AssertionFailureBuilder.java:132)
	at org.junit.jupiter.api.AssertEquals.failNotEqual(AssertEquals.java:197)
	at org.junit.jupiter.api.AssertEquals.assertEquals(AssertEquals.java:182)
...
org.opentest4j.AssertionFailedError: expected: <PERMIT> but was: <null>
	at org.junit.jupiter.api.AssertionFailureBuilder.build(AssertionFailureBuilder.java:151)
	at org.junit.jupiter.api.AssertionFailureBuilder.buildAndThrow(AssertionFailureBuilder.java:132)
	at org.junit.jupiter.api.AssertEquals.failNotEqual(AssertEquals.java:197)
	at org.junit.jupiter.api.AssertEquals.assertEquals(AssertEquals.java:182)
...

Report flaky test

org.keycloak.testsuite.model.singleUseObject.SingleUseObjectModelTest#testCluster

Keycloak CI - Store Model Tests

java.lang.AssertionError: 
threads didn't terminate in time: [main (RUNNABLE):
	at java.management@25.0.2/sun.management.ThreadImpl.dumpThreads0(Native Method)
	at java.management@25.0.2/sun.management.ThreadImpl.dumpAllThreads(ThreadImpl.java:505)
	at java.management@25.0.2/sun.management.ThreadImpl.dumpAllThreads(ThreadImpl.java:493)
...

Report flaky test

org.keycloak.testsuite.model.user.UserModelTest#testAddRemoveUserConcurrent

Keycloak CI - Store Model Tests

org.opentest4j.MultipleFailuresError: 
Multiple Failures (2 failures)
	java.lang.NullPointerException: Cannot invoke "org.keycloak.models.KeycloakSessionFactory.create()" because "factory" is null
	org.infinispan.commons.IllegalLifecycleStateException: ISPN000323: realms is in 'TERMINATED' state and so it does not accept new invocations. Either restart it or recreate the cache container.
	Suppressed: java.lang.NullPointerException: Cannot invoke "org.keycloak.models.KeycloakSessionFactory.create()" because "factory" is null
...

Report flaky test

org.keycloak.testsuite.model.user.UserModelTest#testAddRemoveUser

Keycloak CI - Store Model Tests

org.opentest4j.MultipleFailuresError: 
Multiple Failures (2 failures)
	java.lang.NullPointerException: Cannot invoke "org.keycloak.models.KeycloakSessionFactory.create()" because "factory" is null
	java.lang.NullPointerException: Null keys are not supported!
	Suppressed: java.lang.NullPointerException: Cannot invoke "org.keycloak.models.KeycloakSessionFactory.create()" because "factory" is null
...

Report flaky test

@vmuzikar vmuzikar left a comment
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This looks good. We can later (when we resolve the issues around Java versions) add a dedicated clientV2 method (or something like that) to the root of admin client to avoid using the proxy method.

@vmuzikar
vmuzikar merged commit 0ab0e47 into keycloak:main Apr 24, 2026
90 checks passed
@stianst stianst mentioned this pull request Jun 1, 2026
sashyo pushed a commit to tide-foundation/keycloak-IGA that referenced this pull request Jul 20, 2026
* fix: updates to create a java admin client build

closes: keycloak#48340

Signed-off-by: Steve Hawkins <shawkins@redhat.com>

* addressing review comments

Signed-off-by: Steve Hawkins <shawkins@redhat.com>

---------

Signed-off-by: Steve Hawkins <shawkins@redhat.com>
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.

Release a version of the java admin client that supports client admin api v2

4 participants

0