This is an automated email from the ASF dual-hosted git repository.

lizhimins pushed a commit to branch rocketmq-studio
in repository https://gitbox.apache.org/repos/asf/rocketmq-dashboard.git


The following commit(s) were added to refs/heads/rocketmq-studio by this push:
     new 04feafe49 fix(studio): bind the rmqctl enabled environment flag (#4978)
04feafe49 is described below

commit 04feafe491082ecc77bd710212a052c3ade4551e
Author: aias00 <[email protected]>
AuthorDate: Sat Sep 26 03:11:07 2026 -0700

    fix(studio): bind the rmqctl enabled environment flag (#4978)
    
    Signed-off-by: liuhy <[email protected]>
---
 server/src/main/resources/application.yml          |  2 +-
 .../conversation/AiConversationPropertiesTest.java | 50 ++++++++++++++++++++++
 2 files changed, 51 insertions(+), 1 deletion(-)

diff --git a/server/src/main/resources/application.yml 
b/server/src/main/resources/application.yml
index f24f4063e..a521b561d 100644
--- a/server/src/main/resources/application.yml
+++ b/server/src/main/resources/application.yml
@@ -117,7 +117,7 @@ studio:
       orphan-run-timeout: PT10M
       stop-grace: PT3S
       workspace-dir: 
${STUDIO_AI_CONVERSATION_WORKSPACE_DIR:/tmp/rocketmq-studio-ai}
-      rmqctl-enabled: true
+      rmqctl-enabled: ${STUDIO_AI_RMQCTL_ENABLED:true}
       rmqctl-server-url: ${STUDIO_AI_RMQCTL_SERVER_URL:}
       rmqctl-timeout: PT60S
   alerting:
diff --git 
a/server/src/test/java/org/apache/rocketmq/studio/ops/ai/conversation/AiConversationPropertiesTest.java
 
b/server/src/test/java/org/apache/rocketmq/studio/ops/ai/conversation/AiConversationPropertiesTest.java
new file mode 100644
index 000000000..5944a2c3c
--- /dev/null
+++ 
b/server/src/test/java/org/apache/rocketmq/studio/ops/ai/conversation/AiConversationPropertiesTest.java
@@ -0,0 +1,50 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.rocketmq.studio.ops.ai.conversation;
+
+import org.junit.jupiter.api.Test;
+import 
org.springframework.boot.context.properties.EnableConfigurationProperties;
+import 
org.springframework.boot.test.context.ConfigDataApplicationContextInitializer;
+import org.springframework.boot.test.context.runner.ApplicationContextRunner;
+import org.springframework.context.annotation.Configuration;
+
+import static org.assertj.core.api.Assertions.assertThat;
+
+class AiConversationPropertiesTest {
+
+    private final ApplicationContextRunner runner = new 
ApplicationContextRunner()
+            .withInitializer(new ConfigDataApplicationContextInitializer())
+            .withUserConfiguration(TestConfiguration.class);
+
+    @Test
+    void rmqctlEnvironmentOverrideShouldDisableHostedToolsTest() {
+        runner.withPropertyValues("STUDIO_AI_RMQCTL_ENABLED=false")
+                .run(context -> 
assertThat(context.getBean(AiConversationProperties.class).isRmqctlEnabled())
+                        .isFalse());
+    }
+
+    @Test
+    void rmqctlShouldRemainEnabledByDefaultTest() {
+        runner.run(context -> 
assertThat(context.getBean(AiConversationProperties.class).isRmqctlEnabled())
+                .isTrue());
+    }
+
+    @Configuration(proxyBeanMethods = false)
+    @EnableConfigurationProperties(AiConversationProperties.class)
+    static class TestConfiguration {
+    }
+}

Reply via email to