Skip to content

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

Merged
vmuzikar merged 9 commits into
keycloak:mainfrom
shawkins:iss39063
Jun 13, 2025
Merged

vmuzikar merged 9 commits into
keycloak:mainfrom
shawkins:iss39063

Conversation

@shawkins

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

@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

@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.

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

shawkins commented Jun 3, 2025

Copy link
Copy Markdown
Contributor Author

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

shawkins commented Jun 3, 2025

Copy link
Copy Markdown
Contributor Author

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

@mabartos mabartos 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.

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

@mabartos mabartos 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.

@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?

@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

@vmuzikar

Copy link
Copy Markdown
Contributor

I plan to give this a quick look later today.

@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.

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

Can you also please rebase?

@shawkins

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

@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.

LGTM, thank you.

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

Copy link
Copy Markdown
Contributor Author

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

@mabartos mabartos 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.

LGTM

@pl-me

pl-me commented Aug 19, 2025 •

Copy link
Copy Markdown

@shawkins Hi, I noticed you have changed MicroProfileScope.getPropertyNames() to filter keys using double-dash-separator only. That means it is a breaking change if you rely on getPropertyNames() and still using single-dash options. Am I right?

As getPropertyNames() is now deprecated I guess I should move away from using that function anyway. I just wanted to make sure your change was intentional.

@shawkins

Copy link
Copy Markdown
Contributor Author

As getPropertyNames() is now deprecated I guess I should move away from using that function anyway. I just wanted to make sure your change was intentional.

The change was intentional, as was marking it as deprecated. Yes you should not rely on this function.

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

4 participants