-
Notifications
You must be signed in to change notification settings - Fork 15
Add rolling-updates feature flag and compatibility framework #4
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
base: feature-rolling-updates-baseline
Are you sure you want to change the base?
Add rolling-updates feature flag and compatibility framework #4
Conversation
Closes #36840 Signed-off-by: Pedro Ruivo <[email protected]>
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.
Greptile Summary
This PR introduces a comprehensive rolling updates feature framework for Keycloak with proper feature flag gating. The implementation adds a new ROLLING_UPDATES preview feature flag to the Profile system and implements consistent feature validation across all update-related CLI commands.
The core changes include:
-
Feature Flag Introduction: A new
ROLLING_UPDATESfeature flag is added toProfile.javawithType.PREVIEW, indicating this is experimental functionality that requires explicit enablement. -
CLI Command Protection: Both
UpdateCompatibilityCheckandUpdateCompatibilityMetadatacommands now validate that the rolling updates feature is enabled before execution. When disabled, they provide a standardized error message and exit with code 4. -
Standardized Error Handling: A new
printFeatureDisabled()method is added toAbstractUpdatesCommandto provide consistent error messaging across all update commands. The exit code system is also refined, withRECREATE_UPGRADE_EXIT_CODEchanged from 4 to 3, and a newFEATURE_DISABLEDexit code of 4 added. -
Documentation Updates: The update-compatibility guide is updated to warn users that the rolling-updates feature must be enabled, and the new exit code 4 is documented.
-
Infrastructure Changes: The operator test suite is updated to use the new
FeatureSpecinstead of the deprecatedUnsupportedSpec, and the custom Docker image build includes the rolling-updates feature flag. -
Template Updates: Documentation templates are modified to automatically include the
--features=rolling-updatesflag in examples.
This implementation follows Keycloak's established patterns for feature flags and provides a solid foundation for rolling updates functionality while maintaining backward compatibility and clear user guidance.
Confidence score: 4/5
- This PR is generally safe to merge with well-structured feature flag implementation and consistent error handling patterns.
- The score is 4/5 due to potential user experience concerns with hardcoded feature flags in documentation templates and the preview nature of the feature requiring careful production consideration.
- Files needing more attention:
docs/guides/templates/kc.adocfor the hardcoded feature flag approach, and the operator test changes for potential integration impacts.
9 files reviewed, 1 comment
| [source,bash] | ||
| ---- | ||
| bin/kc.[sh|bat] update-compatibility ${parameters} | ||
| bin/kc.[sh|bat] update-compatibility ${parameters} --features=rolling-updates |
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.
style: Hardcoding --features=rolling-updates in the template removes flexibility. Consider using a parameter or documenting this requirement separately so users understand why this flag is needed.
Test 4