Skip to content

Conversation

@everettbu
Copy link
Contributor

Test 4

Closes #36840

Signed-off-by: Pedro Ruivo <[email protected]>
Copy link

@greptile-apps greptile-apps bot left a 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:

  1. Feature Flag Introduction: A new ROLLING_UPDATES feature flag is added to Profile.java with Type.PREVIEW, indicating this is experimental functionality that requires explicit enablement.

  2. CLI Command Protection: Both UpdateCompatibilityCheck and UpdateCompatibilityMetadata commands now validate that the rolling updates feature is enabled before execution. When disabled, they provide a standardized error message and exit with code 4.

  3. Standardized Error Handling: A new printFeatureDisabled() method is added to AbstractUpdatesCommand to provide consistent error messaging across all update commands. The exit code system is also refined, with RECREATE_UPGRADE_EXIT_CODE changed from 4 to 3, and a new FEATURE_DISABLED exit code of 4 added.

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

  5. Infrastructure Changes: The operator test suite is updated to use the new FeatureSpec instead of the deprecated UnsupportedSpec, and the custom Docker image build includes the rolling-updates feature flag.

  6. Template Updates: Documentation templates are modified to automatically include the --features=rolling-updates flag 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.adoc for the hardcoded feature flag approach, and the operator test changes for potential integration impacts.

9 files reviewed, 1 comment

Edit Code Review Bot Settings | Greptile

[source,bash]
----
bin/kc.[sh|bat] update-compatibility ${parameters}
bin/kc.[sh|bat] update-compatibility ${parameters} --features=rolling-updates
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants