8000 Aligns the logic in the welcome resources by shawkins · Pull Request #23259 · keycloak/keycloak · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Aligns the logic in the welcome resources #23259

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

Merged
merged 2 commits into from
Sep 28, 2023
Merged

Conversation

shawkins
Copy link
Contributor

Assumes the following:

  • KeycloakApplication.BOOTSTRAP_ADMIN_USER is not necessary. The WelcomeResource can localize the tracking using the same logic that was done for the QuarkusWelcomeResource
  • Changes made to the QuarkusWelcomeResource are applicable to the WelcomeResource, this includes adding underlying exceptions to rethrown exceptions, change to how headers are accessed, etc.
  • The only real change to QuarkusWelcomeResource is the use of the logger instance instead of the Quarkus Log for logging null themes, but this shouldn't matter

closes #23243

Copy link
Contributor
@pedroigor pedroigor left a comment

Choose a reason for hiding this comment

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

@shawkins Nice! Looking forward to try to remove the QuarkusWelcomeResource altogether :)

throw new WebApplicationException(e, Response.Status.INTERNAL_SERVER_ERROR);
}
@Override
protected String getAdminCreationMessage() {
8000 Copy link
Contributor

Choose a reason for hiding this comment

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

I think we can change the message on WelcomeResource and remove more code from this class. The message from WelcomeResource does not make sense anymore.

Copy link
@ghost ghost 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

@ghost
Copy link
ghost commented Sep 14, 2023

Unreported flaky test detected

If the below 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.ui.account2.UpdateEmailTest#updateUserInfoWithRegistrationEnabled

Keycloak CI - Account Console IT (firefox)

org.awaitility.core.ConditionTimeoutException: Assertion condition defined as a org.keycloak.testsuite.util.URLAssert URL expected to begin with: https://localhost:8543/auth/realms/test/protocol/openid-connect/auth ; actual URL: https://localhost:8543/auth/realms/test/account/#/personal-info within 10 seconds.
	at org.awaitility.core.ConditionAwaiter.await(ConditionAwaiter.java:167)
	at org.awaitility.core.AssertionCondition.await(AssertionCondition.java:119)
	at org.awaitility.core.AssertionCondition.await(AssertionCondition.java:31)
	at org.awaitility.core.ConditionFactory.until(ConditionFactory.java:985)
...

Report flaky test

org.keycloak.testsuite.ui.account2.UpdateEmailTest#updateEmailSucceeds

Keycloak CI - Account Console IT (firefox)

org.awaitility.core.ConditionTimeoutException: Assertion condition defined as a org.keycloak.testsuite.util.URLAssert URL expected to begin with: https://localhost:8543/auth/realms/test/protocol/openid-connect/auth ; actual URL: https://localhost:8543/auth/realms/test/account/#/personal-info within 10 seconds.
	at org.awaitility.core.ConditionAwaiter.await(ConditionAwaiter.java:167)
	at org.awaitility.core.AssertionCondition.await(AssertionCondition.java:119)
	at org.awaitility.core.AssertionCondition.await(AssertionCondition.java:31)
	at org.awaitility.core.ConditionFactory.until(ConditionFactory.java:985)
...

Report flaky test

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.

Thanks @shawkins.

LGTM but +1 to @pedroigor's comment around leveraging our Hostname SPI.
The changes were just pushed ;)

vmuzikar
vmuzikar previously approved these changes Sep 15, 2023
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.

LGTM.

@ghost
Copy link
ghost commented Sep 15, 2023

Unreported flaky test detected

If the below 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.forms.VerifyProfileTest#testAttributeRequiredForDefaultScope

Keycloak CI - Forms IT (chrome)

java.lang.IllegalArgumentException: No enum constant org.keycloak.testsuite.pages.AppPage.RequestType.
	at java.base/java.lang.Enum.valueOf(Enum.java:273)
	at org.keycloak.testsuite.pages.AppPage$RequestType.valueOf(AppPage.java:56)
	at org.keycloak.testsuite.pages.AppPage.getRequestType(AppPage.java:49)
	at jdk.internal.reflect.GeneratedMethodAccessor552.invoke(Unknown Source)
...

Report flaky test

Copy link
@ghost ghost 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

@vmuzikar
Copy link
Contributor

@pedroigor Do you want to give it another look? :)

@pedroigor
Copy link
Contributor

@shawkins Could you please rebase? LGTM.

@shawkins
8000
Copy link
Contributor Author

@pedroigor squashed and rebased

vmuzikar
vmuzikar previously approved these changes Sep 25, 2023
Copy link
Contributor
@pedroigor pedroigor left a comment

Choose a reason for hiding this comment

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

@shawkins Just found an issue when running your changes. Please, see the comment.

Basically, when accessing the local admin URL with an IP other than localhost the link in the page is built using the host as the scheme. I'm not 100% sure how to test this in our test suite as we need to resolve to a IP other than localhost.

Copy link
Contributor
@pedroigor pedroigor left a comment

Choose a reason for hiding this comment

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

@shawkins Thanks!

shawkins and others added 2 commits September 28, 2023 08:30
as a result the quarkus one can be removed

closes keycloak#23243
…tname/DefaultHostnameProvider.java

Co-authored-by: Pedro Igor <pigor.craveiro@gmail.com>
Copy link
@ghost ghost 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

@ghost
Copy link
ghost commented Sep 28, 2023

Unreported flaky test detected

If the below 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.webauthn.account.WebAuthnTransportLocaleTest#localizationTransportUSB

Keycloak CI - WebAuthn IT (chrome)

java.lang.AssertionError: Expected OIDCLogin but was  (https://localhost:8543/auth/realms/test/protocol/openid-connect/auth?client_id=account-console&redirect_uri=https%3A%2F%2Flocalhost%3A8543%2Fauth%2Frealms%2Ftest%2Faccount%2F%23%2Fsecurity%2Fsigningin&state=f94ca8aa-f884-4b79-88f0-e87ce185970f&response_mode=fragment&response_type=code&scope=openid&nonce=3999b083-21ab-4463-8bfa-464bfbc4b865&code_challenge=DcZ_zMHgtDPu8CxCSjDH-5s6vY4aawhKZSolD6fXFko&code_challenge_method=S256)
	at org.junit.Assert.fail(Assert.java:89)
	at org.junit.Assert.assertTrue(Assert.java:42)
	at org.keycloak.testsuite.page.AbstractPage.assertCurrent(AbstractPage.java:110)
	at jdk.internal.reflect.GeneratedMethodAccessor628.invoke(Unknown Source)
...

Report flaky test

@pedroigor pedroigor merged commit b07391b into keycloak:main Sep 28, 2023
Copy link
@ghost ghost 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

@ghost
Copy link
ghost commented Sep 28, 2023

Unreported flaky test detected

If the below 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.webauthn.account.WebAuthnTransportLocaleTest#localizationTransportUSB

Keycloak CI - WebAuthn IT (chrome)

java.lang.AssertionError: Expected OIDCLogin but was  (https://localhost:8543/auth/realms/test/protocol/openid-connect/auth?client_id=account-console&redirect_uri=https%3A%2F%2Flocalhost%3A8543%2Fauth%2Frealms%2Ftest%2Faccount%2F%23%2Fsecurity%2Fsigningin&state=f94ca8aa-f884-4b79-88f0-e87ce185970f&response_mode=fragment&response_type=code&scope=openid&nonce=3999b083-21ab-4463-8bfa-464bfbc4b865&code_challenge=DcZ_zMHgtDPu8CxCSjDH-5s6vY4aawhKZSolD6fXFko&code_challenge_method=S256)
	at org.junit.Assert.fail(Assert.java:89)
	at org.junit.Assert.assertTrue(Assert.java:42)
	at org.keycloak.testsuite.page.AbstractPage.assertCurrent(AbstractPage.java:110)
	at jdk.internal.reflect.GeneratedMethodAccessor628.invoke(Unknown Source)
...

Report flaky test

@cypress
Copy link
cypress bot commented Sep 29, 2023

1 flaky test on run #9144 ↗︎

0 1054 96 0 Flakiness 1

Details:

Update quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/hostname/Defau...
Project: Keycloak Admin UI Commit: b07391b538
Status: Passed Duration: 12:19 💡
Started: Sep 29, 2023 12:28 AM Ended: Sep 29, 2023 12:40 AM
Flakiness  cypress/e2e/realm_settings_general_tab_test.spec.ts • 1 flaky test • chrome

View Output Video

Test Artifacts
Realm settings general tab tests > Test all general tab switches Test Replay Output Screenshots

Review all test suite changes for PR #23259 ↗︎

@jonkoops
Copy link
Contributor

Thanks for all involved in landing this, it's much appreciated!

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.

De-duplicate code between WelcomeResource and QuarkusWelcomeResource
4 participants
0