Skip to content

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

Open
shawkins wants to merge 2 commits intokeycloak:mainfrom
shawkins:iss48340
Open

fix: updates to create a java admin client build#48343
shawkins wants to merge 2 commits intokeycloak: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

Copy link
Copy Markdown
Member

@michalvavrik michalvavrik left a comment

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.

Comment thread integration/admin-client/src/main/java/org/keycloak/admin/client/Keycloak.java Outdated
Signed-off-by: Steve Hawkins <[email protected]>
Copy link
Copy Markdown

@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
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 [email protected]/sun.management.ThreadImpl.dumpThreads0(Native Method)
	at [email protected]/sun.management.ThreadImpl.dumpAllThreads(ThreadImpl.java:505)
	at [email protected]/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

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

3 participants