Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@shawkins
Copy link
Contributor

Scaled back replacement for #41886 - it turns out that I need these changes first to further refine picocli performance.

closes: #38438

@shawkins shawkins marked this pull request as ready for review September 25, 2025 14:59
@shawkins shawkins requested review from a team as code owners September 25, 2025 14:59
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

@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#setUpLinksTest

Keycloak CI - WebAuthn IT (firefox)

java.lang.AssertionError: 
Set up link for "webauthn-passwordless" is not visible
Expected: is <true>
     but: was <false>
	at org.hamcrest.MatcherAssert.assertThat(MatcherAssert.java:20)
...

Report flaky test

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 Thanks for the PR! Just a few comments.

fromOption(ExportOptions.FILE)
.to("kc.spi-export--single-file--file")
.paramLabel("file")
.isEnabled(c -> c instanceof Export)
Copy link
Contributor

Choose a reason for hiding this comment

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

So, when there's some duplication, we'd need to explicitly enable/disable the mapper, right?

Why we should remove the check of the command.getOptionCategories()? It was quite nice approach(idea) on how to eliminate the mapper from "denied" category - so, no explicit check of the command.

Would it be possible to have it checked based on the used optionCategories? And if there are some duplicated mappers in 2 or more categories, require to add some explicit check.

I could imagine even have the default value for the isEnabled the check of the comman categories. So, every mapper with the associated option in the denied category would be disabled.

@shawkins WDYT?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

So, when there's some duplication, we'd need to explicitly enable/disable the mapper, right?

Yes. The import / export property mappers are really a pretty special case. They overlap and are valid only for their respective commands. Honestly I'm not sure we even want someone putting file=... into the keycloak.conf as it's not clear that should represent both the import and export location. We've also talked about having the keycloak.conf more easily scoped per command, but that's an even bigger change.

Why we should remove the check of the command.getOptionCategories()? It was quite nice approach(idea) on how to eliminate the mapper from "denied" category - so, no explicit check of the command.

I would like to further refine the option categories handling in other prs. The problem is that it's not a great abstraction - it is ultimiately about hidding options and it's behavior can be different between build and runtime options.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes. The import / export property mappers are really a pretty special case. They overlap and are valid only for their respective commands. Honestly I'm not sure we even want someone putting file=... into the keycloak.conf as it's not clear that should represent both the import and export location. We've also talked about having the keycloak.conf more easily scoped per command, but that's an even bigger change.

@shawkins In the context of CLI and putting the command with the --file, the scenario is nice as you don't have to specify sth like --import-file, or --export-file. However, yes, totally unusable in the keycloak.conf as having the file= there.

I would like to further refine the option categories handling in other prs. The problem is that it's not a great abstraction - it is ultimiately about hidding options and it's behavior can be different between build and runtime options.

Ok, works to me.

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 Sorry for the late response.

LGTM in general.

It'd be good if you could rebase this to comply with the spotless checks.

@shawkins shawkins merged commit f28e34e into keycloak:main Oct 14, 2025
83 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.

Avoid 'duplicated mappers' Quarkus message for kc.dir

2 participants