+
Skip to content

fix: adding a -- separator for spi options #40005

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 9 commits into from
Jun 13, 2025
Merged

Conversation

shawkins
Copy link
Contributor

closes: #39063

@shawkins shawkins force-pushed the iss39063 branch 2 times, most recently from cc9ccb0 to 10c501a Compare May 27, 2025 21:10
@shawkins shawkins marked this pull request as ready for review May 27, 2025 21:11
@shawkins shawkins requested review from a team as code owners May 27, 2025 21:11
@shawkins shawkins requested a review from vmuzikar May 27, 2025 21:11
@shawkins
Copy link
Contributor Author

@vmuzikar are you ok with this being a breaking change from the perspective of users who are relying on auto-builds with -provider, -provider-default, -enabled? If so I can add a note for that.

And / or do you want a warning for now for the possibly ambiguous cases?

@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.webauthn.account.WebAuthnSigningInTest#checkAuthenticatorTimeLocale

Keycloak CI - WebAuthn IT (chrome)

java.text.ParseException: Unparseable date: "May 28, 2025, 11:26 AM"
	at java.base/java.text.DateFormat.parse(DateFormat.java:399)
	at org.keycloak.testsuite.webauthn.account.WebAuthnSigningInTest.checkAuthenticatorTimeLocale(WebAuthnSigningInTest.java:320)
	at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
	at java.base/java.lang.reflect.Method.invoke(Method.java:580)
...

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

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.

are you ok with this being a breaking change from the perspective of users who are relying on auto-builds with -provider, -provider-default, -enabled? If so I can add a note for that.

Yes, please add a note to the upgrading guide about that. Maybe with some reasoning about it.

And / or do you want a warning for now for the possibly ambiguous cases?

You mean to the docs? Definitely yes. I know you've done some updates to the docs but IMHO we need to be much more explicit. Basically to explain the difference between the two forms and the auto build behaviour. It might very easily get confusing to the users.

Additionally, I think we should update all docs occurences to the -- format.

@shawkins
Copy link
Contributor Author

shawkins commented Jun 3, 2025

Updated with a warning when changed the docs to use the new format.

There's still a reference to spi-authentication-sessions-map-auth-sessions-limit (now spi-authentication-sessions--map--auth-sessions-limit) that should be removed correct?

@shawkins
Copy link
Contributor Author

shawkins commented Jun 3, 2025

Also updated to internally map to the new spi form - this also highlighted that the PropertyMapper logic needs to maintain an additional mapping to the legacy form.

@shawkins shawkins force-pushed the iss39063 branch 2 times, most recently from bd4744e to ae2a768 Compare June 3, 2025 21:43
Copy link
Contributor

@mabartos mabartos 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 work! Using -- separator makes these SPI separations more visible and I like it more than before.

Just added some small comments that might improve things a little bit more IMO.

@shawkins
Copy link
Contributor Author

@shawkins Nice work! Using -- separator makes these SPI separations more visible and I like it more than before.

Just added some small comments that might improve things a little bit more IMO.

Thank you for the review. Applied the suggestions.

@shawkins shawkins requested a review from vmuzikar June 10, 2025 13:27
Copy link
Contributor

@mabartos mabartos left a comment

Choose a reason for hiding this comment

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

@shawkins Looks good, but one last thing - we should move these upgrading notes you provided to the "Notable changes" section and probably not to the "Breaking changes". Or is there anything I missed?

adding + + inlining where needed

Signed-off-by: Steve Hawkins <shawkins@redhat.com>
@shawkins
Copy link
Contributor Author

@mabartos had to correct the generated options output as well, along with a few more places where -- was missing or being rendered incorrectly.

mabartos
mabartos previously approved these changes Jun 11, 2025
Copy link
Contributor

@mabartos mabartos left a comment

Choose a reason for hiding this comment

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

LGTM

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

Keycloak CI - Store IT (postgres)

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

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

@vmuzikar
Copy link
Contributor

I plan to give this a quick look later today.

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.

@shawkins Sorry for the late review and thank you for the changes!

Overall LGTM but might be good to add some tests for checking the selected SPI options are correctly treated as buildtime.
Additionally, I wonder if we should have a test for the env var form, if __ works as expected.

@vmuzikar
Copy link
Contributor

Can you also please rebase?

@shawkins
Copy link
Contributor Author

Overall LGTM but might be good to add some tests for checking the selected SPI options are correctly treated as buildtime.

We already had a test or two along those lines (see StartCommandDistTest.errorSpiBuildtimeAtRuntime for example), and the arquilian logic relies on implicit rebuilds due to provider option changes.

Additionally, I wonder if we should have a test for the env var form, if __ works as expected.

I can certainly add something. The replacement logic in KcEnvConfigSource is now quite straight-forward all _ in a non-wildcard key will become -, so there's nothing special about this case.

Signed-off-by: Steven Hawkins <shawkins@redhat.com>
@vmuzikar
Copy link
Contributor

We already had a test or two along those lines (see StartCommandDistTest.errorSpiBuildtimeAtRuntime for example), and the arquilian logic relies on implicit rebuilds due to provider option changes.

But we don't cover all the SPI build time options (i.e. --provider, --enabled and --provider-default), do we?

I can certainly add something. The replacement logic in KcEnvConfigSource is now quite straight-forward all _ in a non-wildcard key will become -, so there's nothing special about this case.

Yeah, it'd be good to have something to make sure that e.g. Quarkus doesn't messes that up somewhere.

@shawkins
Copy link
Contributor Author

But we don't cover all the SPI build time options (i.e. --provider, --enabled and --provider-default), do we?

I'll add something after lunch.

Yeah, it'd be good to have something to make sure that e.g. Quarkus doesn't messes that up somewhere.

Quarkus? These entries are only handled by Keycloak logic.

@vmuzikar
Copy link
Contributor

Quarkus? These entries are only handled by Keycloak logic.

Yeah, but I meant some too smart interceptors maybe. Still I'd feel safer with some tests. :)

Signed-off-by: Steve Hawkins <shawkins@redhat.com>
@shawkins
Copy link
Contributor Author

Yeah, but I meant some too smart interceptors maybe. Still I'd feel safer with some tests. :)

See if the the additional changes are sufficient.

vmuzikar
vmuzikar previously approved these changes Jun 12, 2025
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, thank you.

@vmuzikar vmuzikar enabled auto-merge (squash) June 12, 2025 18:34
@shawkins
Copy link
Contributor Author

@mabartos @vmuzikar the rebase was trivial, just wanted to check if either of you want to review again.

Copy link
Contributor

@mabartos mabartos left a comment

Choose a reason for hiding this comment

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

LGTM

@vmuzikar vmuzikar merged commit 76bc9fa into keycloak:main Jun 13, 2025
80 checks passed
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.

Optimized startup fails from kc.spi-connections-http-client-default-expect-continue-enabled passed at runtime
3 participants
点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载