Skip to content

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

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

fix: adding a -- separator for spi options#40005
vmuzikar merged 9 commits intokeycloak: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

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

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

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

@vmuzikar
Copy link
Copy Markdown
Contributor

I plan to give this a quick look later today.

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

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

Copy link
Copy Markdown
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
robson90 pushed a commit to robson90/keycloak that referenced this pull request Jul 23, 2025
* fix: adding a -- separator for spi options

closes: keycloak#39063

Signed-off-by: Steve Hawkins <shawkins@redhat.com>

* adding a warning for ambiguous spi options

also adding a note about the change

Signed-off-by: Steve Hawkins <shawkins@redhat.com>
# Conflicts:
#	docs/documentation/upgrading/topics/changes/changes-26_3_0.adoc

* updating docs to the new format

Signed-off-by: Steve Hawkins <shawkins@redhat.com>
# Conflicts:
#	docs/guides/high-availability/examples/generated/keycloak-ispn.yaml
#	docs/guides/high-availability/examples/generated/keycloak.yaml

* internally using the new spi options

also adding a deprecation notice

Signed-off-by: Steve Hawkins <shawkins@redhat.com>

* Apply suggestions from code review

Co-authored-by: Martin Bartoš <mabartos@redhat.com>
Signed-off-by: Steven Hawkins <shawkins@redhat.com>

* correcting options output

adding + + inlining where needed

Signed-off-by: Steve Hawkins <shawkins@redhat.com>

* adding test showing the env mapping with __

Signed-off-by: Steve Hawkins <shawkins@redhat.com>

---------

Signed-off-by: Steve Hawkins <shawkins@redhat.com>
Signed-off-by: Steven Hawkins <shawkins@redhat.com>
Co-authored-by: Martin Bartoš <mabartos@redhat.com>
Signed-off-by: Robin Meese <39960884+robson90@users.noreply.github.com>
@shawkins shawkins mentioned this pull request Aug 5, 2025
2 tasks
@pl-me
Copy link
Copy Markdown

pl-me commented Aug 19, 2025

@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