crbench//

← all cases

Add rolling-updates feature flag and compatibility framework

Tier 2 easy java · local · real merged PR from keycloak/keycloak #36882

Ground-truth defects

No planted defects (a false-positive trap — a clean review is the correct answer).

The change under review

diff
diff --git a/common/src/main/java/org/keycloak/common/Profile.java b/common/src/main/java/org/keycloak/common/Profile.java
index de9fa04e4ddb..d3da2f48ee7e 100755
--- a/common/src/main/java/org/keycloak/common/Profile.java
+++ b/common/src/main/java/org/keycloak/common/Profile.java
@@ -131,7 +131,9 @@ public enum Feature {
 
         USER_EVENT_METRICS("Collect metrics based on user events", Type.PREVIEW),
 
-        IPA_TUURA_FEDERATION("IPA-Tuura user federation provider", Type.EXPERIMENTAL)
+        IPA_TUURA_FEDERATION("IPA-Tuura user federation provider", Type.EXPERIMENTAL),
+
+        ROLLING_UPDATES("Rolling Updates", Type.PREVIEW),
         ;
 
         private final Type type;
diff --git a/docs/guides/operator/advanced-configuration.adoc b/docs/guides/operator/advanced-configuration.adoc
index 67a8be61a2d8..6db681c8d246 100644
--- a/docs/guides/operator/advanced-configuration.adoc
+++ b/docs/guides/operator/advanced-configuration.adoc
@@ -443,6 +443,12 @@ Check the https://kubernetes.io/docs/concepts/services-networking/network-polici
 
 The Keycloak Operator offers updates strategies to control how the Operator handles changes to the Keycloak CR.
 
+[CAUTION]
+====
+While on preview stage, the feature `rolling-updates` must be enabled.
+Otherwise, the {project_name} Operator will fail.
+====
+
 **Supported Updates Types:**
 
 Rolling Updates:: Update the StatefulSet in a rolling fashion, minimizing downtime (requires multiple replicas).
@@ -466,11 +472,14 @@ kind: Keycloak
 metadata:
   name: example-kc
 spec:
+  features:
+    enabled:
+      - rolling-updates # <1>
   update:
-    strategy: Recreate|<not set> # <1>
+    strategy: Recreate|<not set> # <2>
 ----
-
-<1> Set the desired update strategy here (Recreate in this example).
+<1> Enable preview feature `rolling-updates`.
+<2> Set the desired update strategy here (Recreate in this example).
 
 [%autowidth]
 .Possible field values
diff --git a/docs/guides/server/update-compatibility.adoc b/docs/guides/server/update-compatibility.adoc
index 24a4cfed4fbb..9f77d8d79658 100644
--- a/docs/guides/server/update-compatibility.adoc
+++ b/docs/guides/server/update-compatibility.adoc
@@ -9,7 +9,11 @@ preview="true"
 previewDiscussionLink="https://github.com/keycloak/keycloak/discussions/36785"
 >
 
-// TODO Link to discussion?
+[CAUTION]
+====
+While on preview stage, the feature `rolling-updates` must be enabled.
+Otherwise, the commands will fail.
+====
 
 The goal of this tool is to assist with modifying a {project_name} deployment, whether upgrading to a new version, enabling/disabling features, or changing configuration.
 The outcome will indicate whether a rolling upgrade is possible or if a recreate upgrade is required.
@@ -124,6 +128,10 @@ m|2
 m|3
 |Rolling Upgrade is not possible.
 The deployment must be shut down before applying the new configuration.
+
+m|4
+|Rolling Upgrade is not possible.
+The feature `rolling-updates` is disabled.
 |===
 
 </@tmpl.guide>
diff --git a/docs/guides/templates/kc.adoc b/docs/guides/templates/kc.adoc
index 8db47c0e08de..e99dcedd9a14 100644
--- a/docs/guides/templates/kc.adoc
+++ b/docs/guides/templates/kc.adoc
@@ -50,6 +50,6 @@ bin/kc.[sh|bat] bootstrap-admin ${parameters}
 <#macro updatecompatibility parameters>
 [source,bash]
 ----
-bin/kc.[sh|bat] update-compatibility ${parameters}
+bin/kc.[sh|bat] update-compatibility ${parameters} --features=rolling-updates
 ----
 </#macro>
diff --git a/operator/scripts/Dockerfile-custom-image b/operator/scripts/Dockerfile-custom-image
index 786e72233b63..86cd86472418 100644
--- a/operator/scripts/Dockerfile-custom-image
+++ b/operator/scripts/Dockerfile-custom-image
@@ -2,4 +2,4 @@ ARG IMAGE=keycloak
 ARG VERSION=latest
 FROM $IMAGE:$VERSION
 
-RUN /opt/keycloak/bin/kc.sh build --db=postgres --health-enabled=true
+RUN /opt/keycloak/bin/kc.sh build --db=postgres --health-enabled=true --features=rolling-updates
diff --git a/operator/src/test/java/org/keycloak/operator/testsuite/integration/UpgradeTest.java b/operator/src/test/java/org/keycloak/operator/testsuite/integration/UpgradeTest.java
index 384dfcc81091..589e6c97c6aa 100644
--- a/operator/src/test/java/org/keycloak/operator/testsuite/integration/UpgradeTest.java
+++ b/operator/src/test/java/org/keycloak/operator/testsuite/integration/UpgradeTest.java
@@ -17,6 +17,7 @@
 
 package org.keycloak.operator.testsuite.integration;
 
+import java.util.List;
 import java.util.concurrent.CompletableFuture;
 import java.util.concurrent.ExecutionException;
 import java.util.concurrent.TimeUnit;
@@ -27,10 +28,11 @@
 import org.awaitility.Awaitility;
 import org.junit.jupiter.params.ParameterizedTest;
 import org.junit.jupiter.params.provider.MethodSource;
+import org.keycloak.common.Profile;
 import org.keycloak.operator.crds.v2alpha1.deployment.Keycloak;
 import org.keycloak.operator.crds.v2alpha1.deployment.KeycloakStatusCondition;
 import org.keycloak.operator.crds.v2alpha1.deployment.ValueOrSecret;
-import org.keycloak.operator.crds.v2alpha1.deployment.spec.UnsupportedSpec;
+import org.keycloak.operator.crds.v2alpha1.deployment.spec.FeatureSpec;
 import org.keycloak.operator.crds.v2alpha1.deployment.spec.UpdateSpec;
 import org.keycloak.operator.upgrade.UpdateStrategy;
 
@@ -105,11 +107,12 @@ private static Keycloak createInitialDeployment(UpdateStrategy updateStrategy) {
         }
         var updateSpec = new UpdateSpec();
         updateSpec.setStrategy(updateStrategy);
+        kc.getSpec().setUpdateSpec(updateSpec);
 
-        if (kc.getSpec().getUnsupported() == null) {
-            kc.getSpec().setUnsupported(new UnsupportedSpec());
+        if (kc.getSpec().getFeatureSpec() == null) {
+            kc.getSpec().setFeatureSpec(new FeatureSpec());
         }
-        kc.getSpec().setUpdateSpec(updateSpec);
+        kc.getSpec().getFeatureSpec().setEnabledFeatures(List.of(Profile.Feature.ROLLING_UPDATES.getKey()));
         return kc;
     }
 
diff --git a/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/cli/command/AbstractUpdatesCommand.java b/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/cli/command/AbstractUpdatesCommand.java
index 6763c884a462..4dcd6f665662 100644
--- a/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/cli/command/AbstractUpdatesCommand.java
+++ b/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/cli/command/AbstractUpdatesCommand.java
@@ -80,4 +80,8 @@ void printPreviewWarning() {
         printError("Warning! This command is preview and is not recommended for use in production. It may change or be removed at a future release.");
     }
 
+    void printFeatureDisabled() {
+        printError("Unable to use this command. The preview feature 'rolling-updates' is not enabled.");
+    }
+
 }
diff --git a/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/cli/command/UpdateCompatibilityCheck.java b/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/cli/command/UpdateCompatibilityCheck.java
index 3252463ae5f3..86d7740a59a0 100644
--- a/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/cli/command/UpdateCompatibilityCheck.java
+++ b/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/cli/command/UpdateCompatibilityCheck.java
@@ -20,7 +20,9 @@
 import java.io.File;
 import java.io.IOException;
 
+import org.keycloak.common.Profile;
 import org.keycloak.quarkus.runtime.cli.PropertyException;
+import org.keycloak.quarkus.runtime.compatibility.CompatibilityResult;
 import org.keycloak.quarkus.runtime.compatibility.ServerInfo;
 import org.keycloak.util.JsonSerialization;
 import picocli.CommandLine;
@@ -41,6 +43,11 @@ public class UpdateCompatibilityCheck extends AbstractUpdatesCommand {
 
     @Override
     public void run() {
+        if (!Profile.isFeatureEnabled(Profile.Feature.ROLLING_UPDATES)) {
+            printFeatureDisabled();
+            picocli.exit(CompatibilityResult.FEATURE_DISABLED);
+            return;
+        }
         printPreviewWarning();
         validateConfig();
         var info = readServerInfo();
diff --git a/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/cli/command/UpdateCompatibilityMetadata.java b/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/cli/command/UpdateCompatibilityMetadata.java
index 71e6f3b9e58a..406afef9022e 100644
--- a/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/cli/command/UpdateCompatibilityMetadata.java
+++ b/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/cli/command/UpdateCompatibilityMetadata.java
@@ -21,7 +21,9 @@
 import java.io.IOException;
 
 import com.fasterxml.jackson.core.JsonProcessingException;
+import org.keycloak.common.Profile;
 import org.keycloak.quarkus.runtime.cli.PropertyException;
+import org.keycloak.quarkus.runtime.compatibility.CompatibilityResult;
 import org.keycloak.quarkus.runtime.compatibility.ServerInfo;
 import org.keycloak.util.JsonSerialization;
 import picocli.CommandLine;
@@ -41,6 +43,11 @@ public class UpdateCompatibilityMetadata extends AbstractUpdatesCommand {
 
     @Override
     public void run() {
+        if (!Profile.isFeatureEnabled(Profile.Feature.ROLLING_UPDATES)) {
+            printFeatureDisabled();
+            picocli.exit(CompatibilityResult.FEATURE_DISABLED);
+            return;
+        }
         printPreviewWarning();
         validateConfig();
         var info = compatibilityManager.current();
diff --git a/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/compatibility/CompatibilityResult.java b/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/compatibility/CompatibilityResult.java
index ea44c30b8b7c..b47b87a47457 100644
--- a/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/compatibility/CompatibilityResult.java
+++ b/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/compatibility/CompatibilityResult.java
@@ -28,7 +28,11 @@
 public interface CompatibilityResult {
 
     int ROLLING_UPGRADE_EXIT_CODE = 0;
-    int RECREATE_UPGRADE_EXIT_CODE = 4;
+    // see picocli.CommandLine.ExitCode
+    // 1 -> software error
+    // 2 -> usage error
+    int RECREATE_UPGRADE_EXIT_CODE = 3;
+    int FEATURE_DISABLED = 4;
 
     /**
      * The compatible {@link CompatibilityResult} implementation
diff --git a/quarkus/tests/integration/src/test/java/org/keycloak/it/cli/dist/UpdateCommandDistTest.java b/quarkus/tests/integration/src/test/java/org/keycloak/it/cli/dist/UpdateCommandDistTest.java
index 81b69a7e4cb2..bbecde257df5 100644
--- a/quarkus/tests/integration/src/test/java/org/keycloak/it/cli/dist/UpdateCommandDistTest.java
+++ b/quarkus/tests/integration/src/test/java/org/keycloak/it/cli/dist/UpdateCommandDistTest.java
@@ -41,6 +41,14 @@
 @RawDistOnly(reason = "Requires creating JSON file to be available between containers")
 public class UpdateCommandDistTest {
 
+    private static final String ENABLE_FEATURE = "--features=rolling-updates";
+
+    @Test
+    @Launch({UpdateCompatibility.NAME, UpdateCompatibilityMetadata.NAME})
+    public void testFeatureNotEnabled(CLIResult cliResult) {
+        cliResult.assertError("Unable to use this command. The preview feature 'rolling-updates' is not enabled.");
+    }
+
     @Test
     @Launch({UpdateCompatibility.NAME})
     public void testMissingSubCommand(CLIResult cliResult) {
@@ -48,13 +56,13 @@ public void testMissingSubCommand(CLIResult cliResult) {
     }
 
     @Test
-    @Launch({UpdateCompatibility.NAME, UpdateCompatibilityMetadata.NAME})
+    @Launch({UpdateCompatibility.NAME, UpdateCompatibilityMetadata.NAME, ENABLE_FEATURE})
     public void testMissingOptionOnSave(CLIResult cliResult) {
         cliResult.assertNoMessage("Missing required argument");
     }
 
     @Test
-    @Launch({UpdateCompatibility.NAME, UpdateCompatibilityCheck.NAME})
+    @Launch({UpdateCompatibility.NAME, UpdateCompatibilityCheck.NAME, ENABLE_FEATURE})
     public void testMissingOptionOnCheck(CLIResult cliResult) {
         cliResult.assertError("Missing required argument: " + UpdateCompatibilityCheck.INPUT_OPTION_NAME);
     }
@@ -62,7 +70,7 @@ public void testMissingOptionOnCheck(CLIResult cliResult) {
     @Test
     public void testCompatible(KeycloakDistribution distribution) throws IOException {
         var jsonFile = createTempFile("compatible");
-        var result = distribution.run(UpdateCompatibility.NAME, UpdateCompatibilityMetadata.NAME, UpdateCompatibilityMetadata.OUTPUT_OPTION_NAME, jsonFile.getAbsolutePath());
+        var result = distribution.run(UpdateCompatibility.NAME, UpdateCompatibilityMetadata.NAME, UpdateCompatibilityMetadata.OUTPUT_OPTION_NAME, jsonFile.getAbsolutePath(), ENABLE_FEATURE);
         result.assertMessage("Metadata:");
         assertEquals(0, result.exitCode());
 
@@ -70,7 +78,7 @@ public void testCompatible(KeycloakDistribution distribution) throws IOException
         assertEquals(Version.VERSION, info.getVersions().get(CompatibilityManagerImpl.KEYCLOAK_VERSION_KEY));
         assertEquals(org.infinispan.commons.util.Version.getVersion(), info.getVersions().get(CompatibilityManagerImpl.INFINISPAN_VERSION_KEY));
 
-        result = distribution.run(UpdateCompatibility.NAME, UpdateCompatibilityCheck.NAME, UpdateCompatibilityCheck.INPUT_OPTION_NAME, jsonFile.getAbsolutePath());
+        result = distribution.run(UpdateCompatibility.NAME, UpdateCompatibilityCheck.NAME, UpdateCompatibilityCheck.INPUT_OPTION_NAME, jsonFile.getAbsolutePath(), ENABLE_FEATURE);
         result.assertMessage("[OK] Rolling Upgrade is available.");
         result.assertNoError("Rolling Upgrade is not available.");
     }
@@ -85,7 +93,7 @@ public void testWrongVersions(KeycloakDistribution distribution) throws IOExcept
                 CompatibilityManagerImpl.INFINISPAN_VERSION_KEY, org.infinispan.commons.util.Version.getVersion()));
         JsonSerialization.mapper.writeValue(jsonFile, info);
 
-        var result = distribution.run(UpdateCompatibility.NAME, UpdateCompatibilityCheck.NAME, UpdateCompatibilityCheck.INPUT_OPTION_NAME, jsonFile.getAbsolutePath());
+        var result = distribution.run(UpdateCompatibility.NAME, UpdateCompatibilityCheck.NAME, UpdateCompatibilityCheck.INPUT_OPTION_NAME, jsonFile.getAbsolutePath(), ENABLE_FEATURE);
         result.assertError("[Versions] Rolling Upgrade is not available. 'keycloak' is incompatible: Old=0.0.0.Final, New=%s".formatted(Version.VERSION));
 
         // incompatible infinispan version
@@ -94,7 +102,7 @@ public void testWrongVersions(KeycloakDistribution distribution) throws IOExcept
                 CompatibilityManagerImpl.INFINISPAN_VERSION_KEY, "0.0.0.Final"));
         JsonSerialization.mapper.writeValue(jsonFile, info);
 
-        result = distribution.run(UpdateCompatibility.NAME, UpdateCompatibilityCheck.NAME, UpdateCompatibilityCheck.INPUT_OPTION_NAME, jsonFile.getAbsolutePath());
+        result = distribution.run(UpdateCompatibility.NAME, UpdateCompatibilityCheck.NAME, UpdateCompatibilityCheck.INPUT_OPTION_NAME, jsonFile.getAbsolutePath(), ENABLE_FEATURE);
         result.assertError("[Versions] Rolling Upgrade is not available. 'infinispan' is incompatible: Old=0.0.0.Final, New=%s".formatted(org.infinispan.commons.util.Version.getVersion()));
     }
 

Leaderboard for this case

easy · 9 of 9 bots kept a clean review (100% solve rate).

#BotResultCaughtCoverageFindingsFalse alarms
1 Claude Code (Opus 5.5) solved — — 2 0
2 Cubic solved — — 1 0
3 cursor solved — — 1 0
4 Drape (Deep Review) solved — — 0 0
5 Drape (Review) solved — — 1 0
6 greptile solved — — 1 0
7 Mjolnir (Opus 5.5) solved — — 0 0
8 Mjolnir (Sonnet 5.5) solved — — 0 0
9 qodo solved — — 1 0

Bot results

Claude Code (Opus 5.5) · cross-file engine perris 0.11.1+proven.tiered0.25.call.read.subclass.type
DefectSeverityFoundGrade
valid · impact low
The diff changes RECREATE_UPGRADE_EXIT_CODE from 4 to 3 and gives 4 the new meaning 'feature disabled'. Scripts written against the old exit-code contract will now misread the result. The command is preview and the docs were updated, which lowers the impact, but the contract really did change. [grounded: diff] [consensus 3/3: valid=3]
valid · impact low
The new CAUTION says the Operator will fail unless rolling-updates is enabled. However, UpgradeLogicFactory picks the logic from the update strategy alone, and a grep of operator/src/main found no reference to ROLLING_UPDATES, rolling-updates or update-compatibility. So the documented gate is not enforced. [grounded: tree operator/src/main/java/org/keycloak/operator/upgrade/UpgradeLogicFactory.java] [consensus 3/3: valid=3]
raw comments (2)
quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/compatibility/CompatibilityResult.java:34
This commit changes what exit code 4 means. Before, 4 meant 'recreate upgrade required'. Now that case returns 3, and 4 means 'feature disabled'. Any automation written against the previous release that treats exit code 4 as 'do a recreate upgrade' will now take the wrong path: it will see 4 when the command could not run at all because the feature is off, and it will not recognise 3 as a recreate signal. Reusing an existing exit code for a different meaning, instead of adding a new code like 5, makes these failures silent.
docs/guides/operator/advanced-configuration.adoc:448
The new CAUTION says the Operator will fail unless the `rolling-updates` feature is enabled, but no operator code checks for it. `UpgradeLogicFactory` still picks the update logic from the update strategy alone and never looks at the CR's features, so a CR with `update.strategy` set and the feature off still reconciles normally. The docs (and the example CR) promise behaviour that does not exist, and the feature gate is not actually applied to the operator's update strategy.
Cubic · cross-file engine perris 0.11.1+proven.tiered0.25.call.read.subclass.type
DefectSeverityFoundGrade
valid · impact low
The new CAUTION says the Operator will fail unless `rolling-updates` is enabled, with no conditions. A search of operator/src/main finds no ROLLING_UPDATES or isFeatureEnabled check, so the default `<not set>` path does not depend on the feature. The updated UpgradeTest also enables the feature only when a strategy is set and returns early for the null strategy. The added doc text is therefore inaccurate for default users. [grounded: diff] [consensus 5/5: valid=5]
raw comments (2)
docs/guides/operator/advanced-configuration.adoc:449
<!-- cubic:v=f1156075-caf7-49e0-b0f0-e1ee15a4908d --> <!-- cubic:review-run=cdefa372-922a-590c-a927-d55cc87fe231 --> <!-- metadata:{"confidence":6} --> P2: The CAUTION applies the "feature must be enabled or the Operator will fail" requirement unconditionally, but the section's own default (`<not set>`, mimics Keycloak 26.1) is the legacy path that intentionally runs without `rolling-updates`, and the operator's upgrade logic in this checkout (`UpgradeLogicFactory`, `AlwaysRecreateUpgradeLogic`, `RecreateOnImageChangeUpgradeLogic`) has no dependency on the `rolling-updates` feature. Restrict the requirement to when an update strategy is actually set, so the default-behavior user is not told the Operator will break. <details> <summary>Prompt for AI agents</summary> ```text Check if this issue is valid — if so, understand the root cause and fix it. At docs/guides/operator/advanced-configuration.adoc, line 448: <comment>The CAUTION applies the "feature must be enabled or the Operator will fail" requirement unconditionally, but the section's own default (`<not set>`, mimics Keycloak 26.1) is the legacy path that intentionally runs without `rolling-updates`, and the operator's upgrade logic in this checkout (`UpgradeLogicFactory`, `AlwaysRecreateUpgradeLogic`, `RecreateOnImageChangeUpgradeLogic`) has no dependency on the `rolling-updates` feature. Restrict the requirement to when an update strategy is actually set, so the default-behavior user is not told the Operator will break.</comment> <file context> @@ -443,6 +443,12 @@ Check the https://kubernetes.io/docs/concepts/services-networking/network-polici +[CAUTION] +==== +While on preview stage, the feature `rolling-updates` must be enabled. +Otherwise, the {project_name} Operator will fail. +==== </file context> ``` </details> ```suggestion [CAUTION] ==== While on preview stage, setting an update strategy requires the preview feature `rolling-updates` to be enabled. Otherwise, the {project_name} Operator will fail. ==== ```
PR-level
<!-- cubic:review-summary:start --> **1 issue found** across 11 files <!-- cubic:review-summary:end --> <details> <summary>Prompt for AI agents (unresolved issues)</summary> ```text Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately. <file name="docs/guides/operator/advanced-configuration.adoc"> <violation number="1" location="docs/guides/operator/advanced-configuration.adoc:448"> P2: The CAUTION applies the "feature must be enabled or the Operator will fail" requirement unconditionally, but the section's own default (`<not set>`, mimics Keycloak 26.1) is the legacy path that intentionally runs without `rolling-updates`, and the operator's upgrade logic in this checkout (`UpgradeLogicFactory`, `AlwaysRecreateUpgradeLogic`, `RecreateOnImageChangeUpgradeLogic`) has no dependency on the `rolling-updates` feature. Restrict the requirement to when an update strategy is actually set, so the default-behavior user is not told the Operator will break.</violation> </file> ``` </details> <sub>Reply with feedback, questions, or to request a fix.<br /><br />[Re-trigger cubic](https://www.cubic.dev/action/re-review/pr/drape-io/crbench-cubic-2026-09/53/ai_pr_review_github_delivery_38a208148c056ef0c8c3aaf0856d4e4a15908604553f807967c16c3ab1b934e6?returnTo=https%3A%2F%2Fgithub.com%2Fdrape-io%2Fcrbench-cubic-2026-09%2Fpull%2F53)</sub> <!-- cubic:review-post:ai_pr_review_github_delivery_38a208148c056ef0c8c3aaf0856d4e4a15908604553f807967c16c3ab1b934e6:6adff7765e383ef865b9941349f508d3d214ca96:cdefa372-922a-590c-a927-d55cc87fe231 -->
cursor · cross-file engine perris 0.11.1+proven.tiered0.25.call.read.subclass.type
DefectSeverityFoundGrade
valid · impact medium
Picocli.shouldSkipRebuild returns true for UpdateCompatibility.NAME, so no re-augmentation happens. At runtime, Profile is set by KeycloakRecorder.configureProfile (STATIC_INIT) using the features recorded at build time. That means a CLI `--features=rolling-updates` doesn't change Profile.isFeatureEnabled when the server was built without that feature, and the new gate still exits with FEATURE_DISABLED. The new gate in this diff is what introduces the failure. [grounded: diff] [consensus 4/5: valid=4, invalid=1]
raw comments (2)
quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/cli/command/UpdateCompatibilityCheck.java:50
### CLI feature flag ignored after build **Medium Severity** <!-- DESCRIPTION START --> The new `ROLLING_UPDATES` gate calls `Profile.isFeatureEnabled` after `update-compatibility` skips re-augmentation. Profile resolution prefers persisted `kc.features` over the CLI `--features=rolling-updates` flag that the docs append. After a prior `kc build` with a different features list, the documented command still exits as feature-disabled. <!-- DESCRIPTION END --> <!-- BUGBOT_BUG_ID: fc706c5c-2f44-40c6-8ac4-7d12226544aa --> <!-- LOCATIONS START quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/cli/command/UpdateCompatibilityCheck.java#L45-L50 quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/cli/command/UpdateCompatibilityMetadata.java#L45-L50 docs/guides/templates/kc.adoc#L49-L54 LOCATIONS END --> <details> <summary>Additional Locations (2)</summary> - [`quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/cli/command/UpdateCompatibilityMetadata.java#L45-L50`](https://github.com/drape-io/crbench-cursor-2026-09/blob/8addc0a9941c90287edaa6142d5d4529cd347cf6/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/cli/command/UpdateCompatibilityMetadata.java#L45-L50) - [`docs/guides/templates/kc.adoc#L49-L54`](https://github.com/drape-io/crbench-cursor-2026-09/blob/8addc0a9941c90287edaa6142d5d4529cd347cf6/docs/guides/templates/kc.adoc#L49-L54) </details> <div><a href="https://cursor.com/open?link=eyJ2ZXJzaW9uIjoxLCJ0eXBlIjoiQlVHQk9UX0ZJWF9JTl9DVVJTT1IiLCJkYXRhIjp7InJlZGlzS2V5IjoiYnVnYm90OjM2OTVhNmUxLTAyM2MtNDQwNC1hZTFjLWQyNzdmYzk0ZTRmZiIsImVuY3J5cHRpb25LZXkiOiJsYWlweC0zNlRFaWFRV2p1VFpqSVlUX3BhUjVVcmlnUUxNdHhLZGstTjhvIiwiYnJhbmNoIjoidDIta2V5Y2xvYWstMzY4ODIiLCJyZXBvT3duZXIiOiJkcmFwZS1pbyIsInJlcG9OYW1lIjoiY3JiZW5jaC1jdXJzb3ItMjAyNi0wOSIsInByb3ZpZGVyIjoiZ2l0aHViIn19" target="_blank" rel="noopener noreferrer"><picture><source media="(prefers-color-scheme: dark)" srcset="https://cursor.com/assets/images/fix-in-cursor-dark.png"><source media="(prefers-color-scheme: light)" srcset="https://cursor.com/assets/images/fix-in-cursor-light.png"><img alt="Fix in Cursor" width="115" height="28" src="https://cursor.com/assets/images/fix-in-cursor-dark.png"></picture></a>&nbsp;<a href="https://cursor.com/agents?link=eyJ2ZXJzaW9uIjoxLCJ0eXBlIjoiQlVHQk9UX0ZJWF9JTl9XRUIiLCJkYXRhIjp7InJlZGlzS2V5IjoiYnVnYm90OjM2OTVhNmUxLTAyM2MtNDQwNC1hZTFjLWQyNzdmYzk0ZTRmZiIsImVuY3J5cHRpb25LZXkiOiJsYWlweC0zNlRFaWFRV2p1VFpqSVlUX3BhUjVVcmlnUUxNdHhLZGstTjhvIiwiYnJhbmNoIjoidDIta2V5Y2xvYWstMzY4ODIiLCJyZXBvT3duZXIiOiJkcmFwZS1pbyIsInJlcG9OYW1lIjoiY3JiZW5jaC1jdXJzb3ItMjAyNi0wOSIsInByTnVtYmVyIjo1NCwiY29tbWl0U2hhIjoiOGFkZGMwYTk5NDFjOTAyODdlZGFhNjE0MmQ1ZDQ1MjljZDM0N2NmNiIsInByb3ZpZGVyIjoiZ2l0aHViIn19" target="_blank" rel="noopener noreferrer"><picture><source media="(prefers-color-scheme: dark)" srcset="https://cursor.com/assets/images/fix-in-web-dark.png"><source media="(prefers-color-scheme: light)" srcset="https://cursor.com/assets/images/fix-in-web-light.png"><img alt="Fix in Web" width="99" height="28" src="https://cursor.com/assets/images/fix-in-web-dark.png"></picture></a></div> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 8addc0a9941c90287edaa6142d5d4529cd347cf6. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup>
PR-level
<!-- BUGBOT_REVIEW --> Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue. <!-- BUGBOT_FIX_ALL --> <a href="https://cursor.com/open?link=eyJ2ZXJzaW9uIjoxLCJ0eXBlIjoiQlVHQk9UX0ZJWF9BTExfSU5fQ1VSU09SIiwiZGF0YSI6eyJyZWRpc0tleSI6ImJ1Z2JvdC1tdWx0aTpkZThlYmQ2ZC05NDc3LTRiNmYtYTY2Zi1jNzgzNjdiYzdmOTciLCJlbmNyeXB0aW9uS2V5IjoiT1pIUWVSUzZzaUhmUVdlUUlqa0hzU1VmQ3ZSakh5YktXREhITlFWZ3d6TSIsImJyYW5jaCI6InQyLWtleWNsb2FrLTM2ODgyIiwicmVwb093bmVyIjoiZHJhcGUtaW8iLCJyZXBvTmFtZSI6ImNyYmVuY2gtY3Vyc29yLTIwMjYtMDkiLCJwcm92aWRlciI6ImdpdGh1YiJ9fQ" target="_blank" rel="noopener noreferrer"><picture><source media="(prefers-color-scheme: dark)" srcset="https://cursor.com/assets/images/fix-in-cursor-dark.png"><source media="(prefers-color-scheme: light)" srcset="https://cursor.com/assets/images/fix-in-cursor-light.png"><img alt="Fix All in Cursor" width="115" height="28" src="https://cursor.com/assets/images/fix-in-cursor-dark.png"></picture></a> <!-- /BUGBOT_FIX_ALL --> <!-- BUGBOT_AUTOFIX_REVIEW_FOOTNOTE_BEGIN --> <sup>❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the [Cursor dashboard](https://www.cursor.com/dashboard/bugbot).</sup> <!-- BUGBOT_AUTOFIX_REVIEW_FOOTNOTE_END --> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 8addc0a9941c90287edaa6142d5d4529cd347cf6. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup>
Drape (Deep Review) · cross-file engine perris 0.11.1+proven.tiered0.25.call.read.subclass.type
DefectSeverityFoundGrade
Drape (Review) · cross-file engine perris 0.11.1+proven.tiered0.25.call.read.subclass.type
DefectSeverityFoundGrade
valid · impact low
The new CAUTION text says the Operator fails if `rolling-updates` is not enabled. Nothing in operator/src/main backs that up: a grep finds no reference to ROLLING_UPDATES, rolling-updates or update-compatibility, and UpgradeLogicFactory.create chooses the logic only from UpdateSpec.findUpdateStrategy. So this change added documentation that misdescribes how the Operator behaves. [grounded: diff] [consensus 3/3: valid=3]
raw comments (1)
docs/guides/operator/advanced-configuration.adoc:448
**Docs claim Operator fails without the feature** The docs say the Operator fails unless `rolling-updates` is enabled. But `UpgradeLogicFactory.create` picks the update logic from `spec.update.strategy` and never checks the feature, so nothing fails. Either gate the strategy on the feature in the Operator, or reword the docs so they do not claim the Operator will fail. ``` docs/guides/operator/advanced-configuration.adoc:446 [CAUTION] docs/guides/operator/advanced-configuration.adoc:447 ==== docs/guides/operator/advanced-configuration.adoc:448 While on preview stage, the feature `rolling-updates` must be enabled. docs/guides/operator/advanced-configuration.adoc:449 Otherwise, the {project_name} Operator will fail. operator/src/main/java/org/keycloak/operator/upgrade/UpgradeLogicFactory.java:35 public UpgradeLogic create(Keycloak keycloak, Context<Keycloak> context, KeycloakDeploymentDependentResource dependentResource) { operator/src/main/java/org/keycloak/operator/upgrade/UpgradeLogicFactory.java:36 var strategy = UpdateSpec.findUpdateStrategy(keycloak); operator/src/main/java/org/keycloak/operator/upgrade/UpgradeLogicFactory.java:37 if (strategy.isEmpty()) { operator/src/main/java/org/keycloak/operator/upgrade/UpgradeLogicFactory.java:38 return new RecreateOnImageChangeUpgradeLogic(context, keycloak, dependentResource); operator/src/main/java/org/keycloak/operator/upgrade/UpgradeLogicFactory.java:39 } operator/src/main/java/org/keycloak/operator/upgrade/UpgradeLogicFactory.java:40 return switch (strategy.get()) { ```
greptile · cross-file engine perris 0.11.1+proven.tiered0.25.call.read.subclass.type
DefectSeverityFoundGrade
valid · impact low
The PR adds docs saying the Operator will fail unless `rolling-updates` is enabled. The Operator code does not back this up. UpgradeLogicFactory picks the strategy from `UpdateSpec.findUpdateStrategy(keycloak)` and never checks the feature, and a grep finds no ROLLING_UPDATES or rolling-updates references in operator/src/main. So the documented gate is not enforced, and the mismatch comes from this change. [grounded: diff] [consensus 3/3: valid=3]
raw comments (2)
docs/guides/operator/advanced-configuration.adoc:449
<a href="#"><img alt="P1" src="https://greptile-static-assets.s3.amazonaws.com/badges/p1.svg?v=9" align="top"></a> **Operator Gate Is Missing** This documentation requires `rolling-updates` to be enabled, but the production Operator does not check that feature when selecting an update strategy. A CR can therefore use the preview update strategy without enabling the required feature, so the documented gate is not enforced. Add production validation for explicit update strategies or correct the stated requirement.
PR-level
<h3>Greptile Summary</h3> This PR places rolling-update compatibility functionality behind a new preview feature and updates its CLI exit-code contract, documentation, image setup, and integration tests. - Adds the `rolling-updates` preview feature. - Gates compatibility metadata and check commands when the feature is disabled. - Reserves exit code 3 for recreate upgrades and 4 for a disabled feature. - Enables the feature in documentation examples, the Operator test image, and applicable tests. - Operator-side enforcement described by the new documentation is still missing. <h3>Confidence Score: 4/5</h3> The PR should not merge until the documented `rolling-updates` requirement is enforced by the Operator or the documentation is corrected. The CLI feature gate is initialized and parsed correctly, but Operator reconciliation still accepts update strategies without checking the newly required preview feature, contradicting the operational contract introduced by this PR. **Files Needing Attention:** docs/guides/operator/advanced-configuration.adoc and Operator update reconciliation code <details><summary><h3>Important Files Changed</h3></summary> | Filename | Overview | |----------|----------| | common/src/main/java/org/keycloak/common/Profile.java | Adds `rolling-updates` as a preview feature. | | quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/cli/command/UpdateCompatibilityCheck.java | Rejects compatibility checks with exit code 4 when the preview feature is disabled. | | quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/cli/command/UpdateCompatibilityMetadata.java | Applies the same preview-feature gate to metadata generation. | | quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/compatibility/CompatibilityResult.java | Aligns recreate-upgrade behavior with documented exit code 3 and assigns code 4 to feature-disabled results. | | operator/src/test/java/org/keycloak/operator/testsuite/integration/UpgradeTest.java | Enables the feature for explicit update strategies, but does not cover or establish production enforcement when disabled. | | docs/guides/operator/advanced-configuration.adoc | Documents a mandatory Operator feature gate that the production Operator does not currently enforce. | | quarkus/tests/integration/src/test/java/org/keycloak/it/cli/dist/UpdateCommandDistTest.java | Covers enabled and disabled CLI paths, though it does not assert the new nonzero numeric exit codes. | </details> <details open><summary><h3>Flowchart</h3></summary> ```mermaid %%{init: {'theme': 'neutral'}}%% flowchart TD A[CLI update-compatibility command] --> B{rolling-updates enabled?} B -->|No| C[Print feature-disabled error] C --> D[Exit 4] B -->|Yes| E{metadata or check} E -->|metadata| F[Generate compatibility metadata] E -->|check| G[Compare old and current metadata] G -->|Compatible| H[Exit 0: rolling update] G -->|Incompatible| I[Exit 3: recreate update] J[Operator spec.update reconciliation] --> K[Select legacy or recreate strategy] K --> L[No rolling-updates feature check] ``` </details> <!-- greptile_other_comments_section --> <sub>Reviews (1): Last reviewed commit: ["Update common/src/main/java/org/keycloak..."](https://github.com/drape-io/crbench-greptile-2026-09/commit/e465681d28c57c5794b66b74a351af913a8c4622) | [Re-trigger Greptile](https://app.greptile.com/api/retrigger?id=64284598)</sub>
Mjolnir (Opus 5.5) · cross-file engine perris 0.11.1+proven.tiered0.25.call.read.subclass.type
DefectSeverityFoundGrade
Mjolnir (Sonnet 5.5) · cross-file engine perris 0.11.1+proven.tiered0.25.call.read.subclass.type
DefectSeverityFoundGrade
qodo · cross-file engine perris 0.11.1+proven.tiered0.25.call.read.subclass.type
DefectSeverityFoundGrade
valid · impact high
The new gate reads Profile, which is set at startup (STATIC_INIT) from the features recorded at build time. Picocli.shouldSkipRebuild returns true for `UpdateCompatibility.NAME`, so `--features=rolling-updates` at runtime triggers no rebuild and never updates the profile. On a distribution built without the feature, the documented invocation still exits with code 4. [grounded: diff] [consensus 3/3: valid=3]
raw comments (3)
quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/cli/command/UpdateCompatibilityCheck.java:48
<img src="https://img.shields.io/badge/High-634FD1?style=flat-square" height="20px" alt="Action required"> 1\. Enabled update commands are rejected <code>🐞 Bug</code> <code>≡ Correctness</code> <pre> <b><i>UpdateCompatibilityCheck.run()</i></b> and <b><i>UpdateCompatibilityMetadata.run()</i></b> inspect the statically recorded <b><i>Profile</i></b>, while the update-compatibility command is excluded from re-augmentation even though <b><i>features</i></b> is a build-time option. On a default distribution, passing the newly documented <b><i>--features=rolling-updates</i></b> argument therefore leaves the feature disabled and prevents both metadata generation and compatibility checking. </pre> <details> <summary><strong>Agent Prompt</strong></summary> ``` ## Issue description The update-compatibility commands check the recorded feature profile without applying their build-time `--features=rolling-updates` option, so the documented invocation is rejected. ## Fix Focus Areas - quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/cli/Picocli.java[251-258] - quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/cli/command/UpdateCompatibilityCheck.java[46-49] - quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/cli/command/UpdateCompatibilityMetadata.java[46-49] ## Recommended Fix Process build-time feature changes before executing either update-compatibility subcommand. Remove the unconditional rebuild exemption for update-compatibility, or otherwise refresh the profile from parsed feature configuration before evaluating the gate, while preserving exit code 4 when the option is genuinely absent. ``` <code>ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools</code> </details>
PR-level
<h3>PR Summary by Qodo</h3> Gate rolling updates behind a preview feature <code>✨ Enhancement</code> <code>🧪 Tests</code> <code>📝 Documentation</code> <code>⚙️ Configuration changes</code> <code>🕐 20-40 Minutes</code> <img src="https://www.qodo.ai/wp-content/uploads/2025/11/light-grey-line.svg" height="10%" alt="Grey Divider"> <details> <summary>AI Description</summary> <dl> <dd> <br/> ><pre> >• Gate rolling-update commands and Operator strategies behind a new preview feature. >• Reserve exit code 4 for disabled-feature failures and move recreate results to 3. >• Enable the feature in tests, examples, documentation, and custom Operator images. ></pre> </dd> </dl> </details> <details> <summary>Diagram</summary> <dl> <dd> <br/> ```mermaid graph TD A["Feature setting"] --> B["Profile registry"] --> C{"Feature enabled?"} -->|No| D["Exit code 4"] C -->|Yes| E["Update commands"] --> F["Compatibility result"] A --> G["Operator CR"] --> H["Upgrade strategy"] ``` </dd> </dl> </details> <details> <summary>High-Level Assessment</summary> <dl> <dd> <br/> >The approach is appropriate: the feature is defined in the central profile registry, enforced at both executable command entry points, and enabled explicitly wherever rolling-update behavior is exercised. Gating the parent command was considered but could preempt normal subcommand parsing and validation, while the explicit guards preserve existing CLI behavior. </dd> </dl> </details> <details> <summary> Files changed (11) <code> +70 / -18 </code> </summary> <dl> <dd> <br/> <details> <summary>Enhancement (5) <code> +26 / -2 </code></summary> <dl> <dd> <details> <summary>Profile.java<code>Register the rolling-updates preview feature</code> <code>+3/-1</code></summary> <br/> >Register the rolling-updates preview feature > ><pre> >• Adds ROLLING_UPDATES to the central feature registry as a preview capability, allowing runtime and deployment configuration to opt into rolling-update tooling. ></pre> > ><a href='https://github.com/drape-io/crbench-qodo-2026-09/pull/94/files#diff-08b8752e3233fbecddd3d7b31428b8521581d1d625efcdb0e52b71e10345eb43'>common/src/main/java/org/keycloak/common/Profile.java</a> </details> <details> <summary>AbstractUpdatesCommand.java<code>Add shared disabled-feature CLI error</code> <code>+4/-0</code></summary> <br/> >Add shared disabled-feature CLI error > ><pre> >• Introduces a common error message for update commands invoked without the rolling-updates preview feature. ></pre> > ><a href='https://github.com/drape-io/crbench-qodo-2026-09/pull/94/files#diff-f4b0076f6948cc4e18f43853145cb7fd58e76dbaead3ec62540b29020d879379'>quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/cli/command/AbstractUpdatesCommand.java</a> </details> <details> <summary>UpdateCompatibilityCheck.java<code>Gate compatibility checks by rolling-updates</code> <code>+7/-0</code></summary> <br/> >Gate compatibility checks by rolling-updates > ><pre> >• Stops compatibility checks when rolling-updates is disabled, prints the shared error, and exits with the dedicated feature-disabled code. ></pre> > ><a href='https://github.com/drape-io/crbench-qodo-2026-09/pull/94/files#diff-e7d63d631dce16eda1a0ab6c638d0d71b09891dfa6de0340839916ec3d6b99e8'>quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/cli/command/UpdateCompatibilityCheck.java</a> </details> <details> <summary>UpdateCompatibilityMetadata.java<code>Gate compatibility metadata generation by rolling-updates</code> <code>+7/-0</code></summary> <br/> >Gate compatibility metadata generation by rolling-updates > ><pre> >• Prevents metadata generation unless rolling-updates is enabled and returns the dedicated disabled-feature exit code. ></pre> > ><a href='https://github.com/drape-io/crbench-qodo-2026-09/pull/94/files#diff-dd29f19a86972d950e662487e20eb57a9acf803608ca58b91a0ef1a6853caa3a'>quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/cli/command/UpdateCompatibilityMetadata.java</a> </details> <details> <summary>CompatibilityResult.java<code>Separate recreate and disabled-feature exit codes</code> <code>+5/-1</code></summary> <br/> >Separate recreate and disabled-feature exit codes > ><pre> >• Moves recreate-required results from exit code 4 to 3, avoiding Picocli-reserved codes, and assigns code 4 to disabled-feature failures. ></pre> > ><a href='https://github.com/drape-io/crbench-qodo-2026-09/pull/94/files#diff-ff6a9e2df5480b2127f8314fb1b8f6b4e2644e21db11b33e62ea7a716ac99f41'>quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/compatibility/CompatibilityResult.java</a> </details> </dd> </dl> </details> <details> <summary>Tests (2) <code> +21 / -10 </code></summary> <dl> <dd> <details> <summary>UpgradeTest.java<code>Enable rolling updates in Operator upgrade tests</code> <code>+7/-4</code></summary> <br/> >Enable rolling updates in Operator upgrade tests > ><pre> >• Configures test Keycloak resources with a FeatureSpec that enables rolling-updates whenever an explicit update strategy is exercised. ></pre> > ><a href='https://github.com/drape-io/crbench-qodo-2026-09/pull/94/files#diff-3aaf3b85d16e5d58075a4b62ad75ca2deb0047f286fed2e70d3b668b34d0854e'>operator/src/test/java/org/keycloak/operator/testsuite/integration/UpgradeTest.java</a> </details> <details> <summary>UpdateCommandDistTest.java<code>Cover rolling-updates CLI feature gating</code> <code>+14/-6</code></summary> <br/> >Cover rolling-updates CLI feature gating > ><pre> >• Adds coverage for invoking update commands without the feature. Existing compatibility scenarios now enable rolling-updates explicitly. ></pre> > ><a href='https://github.com/drape-io/crbench-qodo-2026-09/pull/94/files#diff-cef0b4e9622a2e5ed751f4818be1e34336268c3a82bef38b13d79be8dac0a50a'>quarkus/tests/integration/src/test/java/org/keycloak/it/cli/dist/UpdateCommandDistTest.java</a> </details> </dd> </dl> </details> <details> <summary>Documentation (3) <code> +22 / -5 </code></summary> <dl> <dd> <details> <summary>advanced-configuration.adoc<code>Document Operator rolling-updates feature requirement</code> <code>+12/-3</code></summary> <br/> >Document Operator rolling-updates feature requirement > ><pre> >• Warns that Operator update strategies require the rolling-updates preview feature. Updates the Keycloak CR example to enable the feature explicitly. ></pre> > ><a href='https://github.com/drape-io/crbench-qodo-2026-09/pull/94/files#diff-3eec98597573db0d847ceabdd301e6c3fbce6a947b9b25ef2e50abebd2d2c255'>docs/guides/operator/advanced-configuration.adoc</a> </details> <details> <summary>update-compatibility.adoc<code>Document compatibility command gating and exit code</code> <code>+9/-1</code></summary> <br/> >Document compatibility command gating and exit code > ><pre> >• Explains that update compatibility commands require rolling-updates. Adds exit code 4 to document disabled-feature failures. ></pre> > ><a href='https://github.com/drape-io/crbench-qodo-2026-09/pull/94/files#diff-30181843472daee56faa2466883c14230b9b91f31b861480d8f6054ebfca24f3'>docs/guides/server/update-compatibility.adoc</a> </details> <details> <summary>kc.adoc<code>Enable rolling-updates in compatibility command examples</code> <code>+1/-1</code></summary> <br/> >Enable rolling-updates in compatibility command examples > ><pre> >• Appends the rolling-updates feature option to generated update-compatibility command examples. ></pre> > ><a href='https://github.com/drape-io/crbench-qodo-2026-09/pull/94/files#diff-bdf620b6347cb0e0ba60d3f84ea09e4263d78bca59c389d3019b1c2667f9f2d9'>docs/guides/templates/kc.adoc</a> </details> </dd> </dl> </details> <details> <summary>Other (1) <code> +1 / -1 </code></summary> <dl> <dd> <details> <summary>Dockerfile-custom-image<code>Build the Operator test image with rolling updates</code> <code>+1/-1</code></summary> <br/> >Build the Operator test image with rolling updates > ><pre> >• Enables rolling-updates while building the custom Keycloak image used by Operator workflows. ></pre> > ><a href='https://github.com/drape-io/crbench-qodo-2026-09/pull/94/files#diff-51abbec33a2274509089339179a05ce6bd6e980285fff7ca6386fa7ba61b0660'>operator/scripts/Dockerfile-custom-image</a> </details> </dd> </dl> </details> </dd> </dl> </details>
PR-level
<h3>Code Review by Qodo</h3> <code>🐞 Bugs (1)</code> <code>📘 Rule violations (0)</code> <code>📜 Skill insights (0)</code> <img src="https://www.qodo.ai/wp-content/uploads/2025/11/light-grey-line.svg" height="10%" alt="Grey Divider"> <br/> <img src="https://img.shields.io/badge/High-634FD1?style=flat-square" height="20px" alt="Action required"> <details> <summary> 1. Enabled update commands are rejected <code>🐞 Bug</code> <code>≡ Correctness</code></summary> <br/> > <details open> ><summary>Description</summary> ><br/> > ><pre> ><b><i>UpdateCompatibilityCheck.run()</i></b> and <b><i>UpdateCompatibilityMetadata.run()</i></b> inspect the statically >recorded <b><i>Profile</i></b>, while the update-compatibility command is excluded from re-augmentation even >though <b><i>features</i></b> is a build-time option. On a default distribution, passing the newly documented ><b><i>--features=rolling-updates</i></b> argument therefore leaves the feature disabled and prevents both >metadata generation and compatibility checking. ></pre> ></details> > <details> ><summary>Code</summary> ><br/> > ><code>[quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/cli/command/UpdateCompatibilityCheck.java[R46-48]](https://github.com/drape-io/crbench-qodo-2026-09/pull/94/files#diff-e7d63d631dce16eda1a0ab6c638d0d71b09891dfa6de0340839916ec3d6b99e8R46-R48)</code> > >```diff >+ if (!Profile.isFeatureEnabled(Profile.Feature.ROLLING_UPDATES)) { >+ printFeatureDisabled(); >+ picocli.exit(CompatibilityResult.FEATURE_DISABLED); >``` ></details> > <details> ><summary>Evidence</summary> ><br/> > ><pre> >Feature options are explicitly build-time configuration, and the profile is recorded during static >initialization. The CLI then explicitly skips re-augmentation for update-compatibility, while the >new documentation and tests pass the feature only to that command, so its <b><i>run()</i></b> methods continue >reading the prebuilt profile where this preview feature is disabled by default. ></pre> > > <code>[quarkus/config-api/src/main/java/org/keycloak/config/FeatureOptions.java[13-19]](https://github.com/drape-io/crbench-qodo-2026-09/blob/d48fdf60d7a6e10930fcd58665dce8f16790bbb5/quarkus/config-api/src/main/java/org/keycloak/config/FeatureOptions.java/#L13-L19)</code> > <code>[quarkus/deployment/src/main/java/org/keycloak/quarkus/deployment/KeycloakProcessor.java[225-233]](https://github.com/drape-io/crbench-qodo-2026-09/blob/d48fdf60d7a6e10930fcd58665dce8f16790bbb5/quarkus/deployment/src/main/java/org/keycloak/quarkus/deployment/KeycloakProcessor.java/#L225-L233)</code> > <code>[quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/KeycloakRecorder.java[82-84]](https://github.com/drape-io/crbench-qodo-2026-09/blob/d48fdf60d7a6e10930fcd58665dce8f16790bbb5/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/KeycloakRecorder.java/#L82-L84)</code> > <code>[quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/cli/Picocli.java[251-258]](https://github.com/drape-io/crbench-qodo-2026-09/blob/d48fdf60d7a6e10930fcd58665dce8f16790bbb5/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/cli/Picocli.java/#L251-L258)</code> > <code>[common/src/main/java/org/keycloak/common/Profile.java[316-324]](https://github.com/drape-io/crbench-qodo-2026-09/blob/d48fdf60d7a6e10930fcd58665dce8f16790bbb5/common/src/main/java/org/keycloak/common/Profile.java/#L316-L324)</code> > <code>[quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/cli/command/UpdateCompatibilityMetadata.java[46-49]](https://github.com/drape-io/crbench-qodo-2026-09/blob/d48fdf60d7a6e10930fcd58665dce8f16790bbb5/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/cli/command/UpdateCompatibilityMetadata.java/#L46-L49)</code> > <code>[docs/guides/templates/kc.adoc[50-54]](https://github.com/drape-io/crbench-qodo-2026-09/blob/d48fdf60d7a6e10930fcd58665dce8f16790bbb5/docs/guides/templates/kc.adoc/#L50-L54)</code> ></details> > <details> ><summary>Agent prompt</summary> ><br/> > >``` >The issue below was found during a code review. Follow the provided context and guidance below and implement a solution > >## Issue description >The update-compatibility commands check the recorded feature profile without applying their build-time `--features=rolling-updates` option, so the documented invocation is rejected. > >## Fix Focus Areas >- quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/cli/Picocli.java[251-258] >- quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/cli/command/UpdateCompatibilityCheck.java[46-49] >- quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/cli/command/UpdateCompatibilityMetadata.java[46-49] > >## Recommended Fix >Process build-time feature changes before executing either update-compatibility subcommand. Remove the unconditional rebuild exemption for update-compatibility, or otherwise refresh the profile from parsed feature configuration before evaluating the gate, while preserving exit code 4 when the option is genuinely absent. >``` > <code>ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools</code> ></details> <hr/> </details> <img src="https://www.qodo.ai/wp-content/uploads/2025/11/light-grey-line.svg" height="10%" alt="Grey Divider"> <!-- qodo-context:start --> <details><summary><strong>Context sources</strong></summary> <div>Review mode: <code>⚖️ Balanced</code>: This change modifies preview feature gating and CLI exit-code behavior across runtime, operator, documentation, and integration tests, creating meaningful cross-cutting compatibility risk but not enough independent logic density to warrant extended review.</div> <!-- qodo-context:end --> </details> <img src="https://www.qodo.ai/wp-content/uploads/2025/11/light-grey-line.svg" height="10%" alt="Grey Divider"> <!-- qodo-daily-tip:start --> <details> <summary><strong>Tip of the day</strong></summary> <br/> <pre>💡 Did you know, you can reply &#x27;qodo&#x27; on any finding to push back, ask questions, or dig deeper</pre> <a href="https://docs.qodo.ai/tips-and-tricks">More tips ↗</a> | <a href="https://app.qodo.ai/configurations?tab=display-preferences">Customize Qodo ↗</a> | <a href="https://docs.qodo.ai">Qodo docs ↗</a> </details> <img src="https://www.qodo.ai/wp-content/uploads/2025/11/light-grey-line.svg" height="10%" alt="Grey Divider"> <!-- qodo-daily-tip:end --> <!-- https://github.com/drape-io/crbench-qodo-2026-09/commit/d48fdf60d7a6e10930fcd58665dce8f16790bbb5 --> <a href="https://www.qodo.ai"><img src="https://www.qodo.ai/wp-content/uploads/2025/03/qodo-logo.svg" width="80" alt="Qodo Logo"></a>