-
Notifications
You must be signed in to change notification settings - Fork 7.8k
Ability to enable/disable feature via single property #43542
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
Conversation
9d51549 to
3ece80e
Compare
Thank you for taking this on. What do you think of expressing this as:
|
|
Is this a real issue? I don't think folks need to enable/disable that many features. If they really do I think we should consider something like also supporting a separate file. If the argument is that folks will have many features to enable/disable this just makes it even worse IMO as you basically end up with more crud, not less. |
|
Is this not also going to bloat the help completely? You'd have --features that list all features, then also additionally have a separate option for each feature? |
We're starting to add a lot of features. We're also not just talking about people trying things out locally. Let's say I've been provided a containerized augmented image. Now I want to try out the new serdes optimization feature. Without knowing the list of features that may already be configured in that augmented image, I cannot simply try out the feature as I may change the feature configuration in unexpected ways.
That will be more difficult to manage from the operator.
I would vote for eventually getting rid of the list based option. |
That's a good point, but would mean we'd need to handle what happens if the same feature is listed multiple times; could be
Please no, that is super convenient and quick to manage if you want to manage enabled/disabled features in one go, which at least personally is what I want |
|
Okay, so @shawkins convinced me that we probably should do this; I do like Another thing I'd like to know is how this will look like in the CLI help, and the guide docs needs updating as well. One proposal would be that help would not list all the Could we do some separate help command for features? That lists all the features, their description, etc? Something similar to what the guide does? |
Yep, it might be nice. The So, the approach suggested by @shawkins would look like this:
And potentially, as suggested by @stianst, enable the feature like
The help will be clean. There will be only one option (called wildcard option) that accepts feature names - sth like the
Yes, it's on our radar as well as it'd be nice to have the capability of listing features in the distribution itself with some more information + maybe even info whether the feature is enabled or not for already augmented distro. I'll create an issue for this.
I think these 2 approaches can coexist as you can override the feature state by using this new option. |
That would need to be done separately. There are several places in our code where we make the assumption that our options must have an argument.
Ok, sounds like the concensus is to keep both and just add docs around precedence.
Another current behavior worth mentioning is that a feature cannot appear in both features and features-disabled - which has usability issue from an overriding perspective because you may need to override both lists. Otherwise the presedence order for sources in general is:
We'd check first for the value of kc.feature-name, then fallback to the list handling. This makes features and features-disabled more akin to "default" feature handling as once you use feature-name, then features and features-disabled aren't applicible to that feature. |
Exactly. I would not rush this. It is a new concept that we'd allow value-less config options.
+1 It'd be on par with current |
af25c06 to
8154c16
Compare
25c913d to
39a1610
Compare
|
Created a follow-up task for the old testsuite: Not sure if it's worth the effort though. |
common/src/main/java/org/keycloak/common/profile/SingleProfileConfigResolver.java
Show resolved
Hide resolved
vmuzikar
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Generally looks good, but I didn't review in depth. @shawkins could you please review? :)
shawkins
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for the delay, I thought I had already submitted a more recent review. It looks good, but I wouldn't introduce a specific duplicate property check.
...src/main/java/org/keycloak/quarkus/runtime/configuration/mappers/FeaturePropertyMappers.java
Outdated
Show resolved
Hide resolved
Closes keycloak#43541 Signed-off-by: Martin Bartoš <[email protected]>
Signed-off-by: Martin Bartoš <[email protected]>
Signed-off-by: Martin Bartoš <[email protected]>
|
@shawkins Fixed help tests. Should be ready for review. |
quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/QuarkusProfileConfigResolver.java
Outdated
Show resolved
Hide resolved
Signed-off-by: Martin Bartoš <[email protected]>
shawkins
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the updates @mabartos, this LGTM.
vmuzikar
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mabartos Thank you for the update. Added one comment I'd like to get addressed/discussed before merging
docs/guides/server/features.adoc
Outdated
| To enable all preview features, enter this command: | ||
| <@kc.build parameters="--feature-preview=enabled"/> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why would we add another way to enable the preview profile? It feels confusing – redundant way to enable a profile and the naming feature-preview (feature, not features). We already have --features=preview. If a user wants to enable the preview profile with additional features, they can use the combination of --features=preview and --feature-<name>=enabled.
Sorry if I missed it before in the previous review.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is no different than the case for supporting the individual properties in general. If you already have --features set in a provided image, then want to try out preview features, it's much simplier to do that via the feature-preview option.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMHO we shouldn't have mixed profiles and features in a single option in the first place – i.e. we shouldn't have done --features=preview. It's ambiguous and confusing. That's the main reason I do not want to expand on this by supporting profiles in --feature-<name>.
IIRC @stianst had some ideas for introducing "server profiles" in general that would affect not only profile features but also config defaults etc. I'd like to wait for this before we introduce yet another way to toggle feature profiles.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My idea wasn't server profiles, but rather security profiles so not relevant to this
One related thing here though is that it would be good to have categories of features, and ability to enable preview for a category.
dpop should be oauth-dpop and it should be possible to do something like --features=oauth:preview to enable all preview oauth features.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Created follow-up task:
Signed-off-by: Martin Bartoš <[email protected]>
vmuzikar
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shawkins
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks @mabartos
@shawkins This is the initial form of how it could work with the single property.