Skip to content

Conversation

@akshayutture-augment
Copy link

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.

Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.

@akshayutture-augment
Copy link
Author

@greptileai

@greptile-apps
Copy link

greptile-apps bot commented Nov 14, 2025

Greptile Overview

Confidence Score: 5/5

  • This PR is safe to merge with no identified issues
  • The changes are straightforward and well-implemented. The feature flag is properly defined, the gating logic is consistent across commands, exit codes are semantically correct with clear documentation, all tests are updated appropriately, and documentation is thorough. No bugs, security issues, or logical errors were identified.
  • No files require special attention

Important Files Changed

File Analysis

Filename Score Overview
common/src/main/java/org/keycloak/common/Profile.java 5/5 Added new ROLLING_UPDATES feature flag as PREVIEW type
quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/cli/command/UpdateCompatibilityCheck.java 5/5 Added feature flag check with appropriate exit code when rolling-updates disabled
quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/cli/command/UpdateCompatibilityMetadata.java 5/5 Added feature flag check with appropriate exit code when rolling-updates disabled
quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/compatibility/CompatibilityResult.java 5/5 Added FEATURE_DISABLED exit code (4) and adjusted RECREATE_UPGRADE_EXIT_CODE from 4 to 3 with clarifying comments
quarkus/tests/integration/src/test/java/org/keycloak/it/cli/dist/UpdateCommandDistTest.java 5/5 Added test for feature flag requirement and updated all test invocations to enable rolling-updates feature

Sequence Diagram

sequenceDiagram
    participant User
    participant CLI as Update Command
    participant Check as UpdateCompatibilityCheck
    participant Metadata as UpdateCompatibilityMetadata
    participant Profile as Profile.Feature
    participant Manager as CompatibilityManager
    participant Result as CompatibilityResult

    User->>CLI: Execute update metadata command
    CLI->>Metadata: run()
    Metadata->>Profile: isFeatureEnabled(ROLLING_UPDATES)
    alt Feature Disabled
        Profile-->>Metadata: false
        Metadata->>User: printFeatureDisabled()
        Metadata->>User: exit(FEATURE_DISABLED=4)
    else Feature Enabled
        Profile-->>Metadata: true
        Metadata->>User: printPreviewWarning()
        Metadata->>Metadata: validateConfig()
        Metadata->>Manager: current()
        Manager-->>Metadata: ServerInfo
        Metadata->>User: printToConsole(ServerInfo)
        Metadata->>User: writeToFile(ServerInfo)
    end

    User->>CLI: Execute update check command
    CLI->>Check: run()
    Check->>Profile: isFeatureEnabled(ROLLING_UPDATES)
    alt Feature Disabled
        Profile-->>Check: false
        Check->>User: printFeatureDisabled()
        Check->>User: exit(FEATURE_DISABLED=4)
    else Feature Enabled
        Profile-->>Check: true
        Check->>User: printPreviewWarning()
        Check->>Check: validateConfig()
        Check->>Check: readServerInfo()
        Check->>Manager: isCompatible(ServerInfo)
        Manager->>Manager: compareVersions()
        alt Compatible
            Manager-->>Check: CompatibilityResult.OK (exitCode=0)
            Check->>User: printOut("[OK] Rolling Upgrade is available")
            Check->>User: exit(0)
        else Incompatible
            Manager-->>Check: IncompatibleResult (exitCode=3)
            Check->>User: printError(incompatibility message)
            Check->>User: exit(3)
        end
    end
Loading

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.

10 files reviewed, no comments

Edit Code Review Agent Settings | Greptile

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.

3 participants