Skip to content
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

Keycloak fixes and Quarkus FW bump to 1.4.0.Beta5 #1581

Merged

Conversation

michalvavrik
Copy link
Member

@michalvavrik michalvavrik commented Dec 19, 2023

Summary

Main goal of this PR is to fix OCP failures related to the fact that Keycloak auth server URL has changed in our FW: quarkus-qe/quarkus-test-framework#960

  • OpenShiftRhSsoOidcMtlsIT will require much more thinkering, at the very least I hit that config map name is created with illegal chars when resource is in nested directory. But I think it will be even more difficult, I'll address it later this week.
  • I don't want to address all that repeated stuff of KC commands till Tests with Keycloak container should not be started at Keycloak DEV mode #1580 is done
  • I also think some of these Keycloak starting commands are unnecessary at some of scenarios (I replaced one accidentally and it still works), let's address it when we get rid of start-dev because it all seems like a one big workaround for proper solution to me
  • OidcRestClientIT failure (both baremetal and OCP) goes down to the Fix primitive class handling in Serialisers quarkusio/quarkus#37788, I hope it's going to be merged today as that reviewer is active in other Quarkus PRs
  • new KC image does not accept args joined by space, we need to pass them one by one (which is correct way to do it anyway)

Please select the relevant options.

  • Bug fix (non-breaking change which fixes an issue)
  • Dependency update
  • Refactoring
  • Backport
  • New scenario (non-breaking change which adds functionality)
  • This change requires a documentation update
  • This change requires execution against OCP (use run tests phrase in comment)

Checklist:

  • Methods and classes used in PR scenarios are meaningful
  • Commits are well encapsulated and follow the best practices

@michalvavrik
Copy link
Member Author

run tests

@michalvavrik michalvavrik marked this pull request as draft December 19, 2023 00:23
@michalvavrik michalvavrik force-pushed the feature/fix-rh-sso-ocp-failures branch from 9bf6b00 to c9287da Compare December 19, 2023 09:51
@michalvavrik michalvavrik marked this pull request as ready for review December 19, 2023 09:52
@michalvavrik michalvavrik changed the title Keycloak fixes and Quarkus FW bump Keycloak fixes and Quarkus FW bump 1.4.0.Beta5 Dec 19, 2023
@michalvavrik michalvavrik changed the title Keycloak fixes and Quarkus FW bump 1.4.0.Beta5 Keycloak fixes and Quarkus FW bump to 1.4.0.Beta5 Dec 19, 2023
@michalvavrik
Copy link
Member Author

run tests

@michalvavrik
Copy link
Member Author

Remaining OCP / baremetal failures are failing also without this PR, therefore they are not result of this PR.

Copy link
Member

@jedla97 jedla97 left a comment

Choose a reason for hiding this comment

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

I looked at it. It's look good just two comments to clarify.

@@ -10,8 +14,8 @@
public class KeycloakAuthzSecurityReactiveIT extends BaseAuthzSecurityReactiveIT {

//TODO Remove workaround after Keycloak is fixed https://github.com/keycloak/keycloak/issues/9916
@KeycloakContainer(command = { "start-dev --import-realm --hostname-strict=false" })
static KeycloakService keycloak = new KeycloakService("/keycloak-realm.json", REALM_DEFAULT, "/realms")
@KeycloakContainer(command = { "start-dev", "--import-realm" })
Copy link
Member

Choose a reason for hiding this comment

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

Is there reason why --hostname-strict=false is removed when in other cases it stay.

Copy link
Member Author

Choose a reason for hiding this comment

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

yes, I wrote about this (vaguely) in the PR description, I changed it accidentally and it made no difference, so I suppose it doesn't really matter. If it doesn't cause test failure I don't think it needs to be there. Good catch, it was mistake. If it is somehow important for you, I'll change it in next PR when fixing mTLS.

Copy link
Member

Choose a reason for hiding this comment

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

If it's work I'm fine with it. Hope that this not cause the problem in future.

Copy link
Member Author

Choose a reason for hiding this comment

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

If it's work I'm fine with it. Hope that this not cause the problem in future.

IMO tests need to be idempotent, otherwise our job will become very dangerous

Copy link
Member Author

Choose a reason for hiding this comment

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

we will see other integration runs like Windows and Podman... I don't expect there should be difference.

@Container(image = "${rhsso.image}", expectedLog = "Http management interface listening", port = KEYCLOAK_PORT)
static KeycloakService keycloak = new KeycloakService(REALM_DEFAULT)
.withProperty("SSO_IMPORT_FILE", "resource::/keycloak-realm.json");
@KeycloakContainer(command = { "start-dev", "--import-realm" }, image = "${rhbk.image}")
Copy link
Member

Choose a reason for hiding this comment

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

Why some of the command KeycloakContainers contains contain more commands that these two. When they were the same with using Container.

Copy link
Member Author

Choose a reason for hiding this comment

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

I removed .withProperty("SSO_IMPORT_FILE", "resource::/keycloak-realm.json"); so I want to import it from command. I can't answer it in general, if you deem particular change wrong, please comment on the very change and I'll check.

Copy link
Member

Choose a reason for hiding this comment

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

Just that somewhere @Conatiner change to this

@KeycloakContainer(command = { "start-dev", "--import-realm", "--hostname-strict=false",
            "--features=token-exchange" }, image = "${rhbk.image}")

and somewhere to this

@KeycloakContainer(command = { "start-dev", "--import-realm" }, image = "${rhbk.image}")

But this was answered in other comment so now there is probably no need for some of these commands.
But as it was written in PR description let's solve these problem as the start-dev is solved.

Copy link
Member Author

Choose a reason for hiding this comment

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

just note - I won't pretend I couldn't make mistake, but this is how I worked:

  • if I remove import env var, I need to add --import-realm
  • If I change RHSSO for RHBK it is change from Wildfly to Quarkus based KC, so I followed what is done in that very project for non-OCP tests. so typically if there were --features=token-exchange for baremetal tests I just added it as well. I didn't try to think whether it needs to be in baremetal tests at the first place.

Copy link
Member

@jedla97 jedla97 left a comment

Choose a reason for hiding this comment

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

Comments were explained and the PR it's look fine.

@jedla97 jedla97 merged commit f6cbb3b into quarkus-qe:main Dec 19, 2023
5 of 9 checks passed
@michalvavrik michalvavrik deleted the feature/fix-rh-sso-ocp-failures branch December 19, 2023 12:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants