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

SbloodyS pushed a commit to branch dev
in repository https://gitbox.apache.org/repos/asf/dolphinscheduler.git


The following commit(s) were added to refs/heads/dev by this push:
     new 7a102f34f8 [Fix-17794] Fix rerun workflow instance should follow the 
specified workerGroup parameter (#18352)
7a102f34f8 is described below

commit 7a102f34f8ccf7ac77664c98f5b916ec2d845978
Author: xiangzihao <[email protected]>
AuthorDate: Wed Jun 17 14:59:08 2026 +0800

    [Fix-17794] Fix rerun workflow instance should follow the specified 
workerGroup parameter (#18352)
---
 .../trigger/WorkflowInstanceRepeatTrigger.java     |  1 +
 .../trigger/WorkflowInstanceRepeatTriggerTest.java | 53 ++++++++++++++++++++++
 2 files changed, 54 insertions(+)

diff --git 
a/dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/engine/workflow/trigger/WorkflowInstanceRepeatTrigger.java
 
b/dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/engine/workflow/trigger/WorkflowInstanceRepeatTrigger.java
index b2e615d1aa..0de1af604a 100644
--- 
a/dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/engine/workflow/trigger/WorkflowInstanceRepeatTrigger.java
+++ 
b/dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/engine/workflow/trigger/WorkflowInstanceRepeatTrigger.java
@@ -46,6 +46,7 @@ public class WorkflowInstanceRepeatTrigger
                 
.workflowDefinitionCode(workflowInstance.getWorkflowDefinitionCode())
                 
.workflowDefinitionVersion(workflowInstance.getWorkflowDefinitionVersion())
                 .executorId(repeatRunningRequest.getUserId())
+                .workerGroup(workflowInstance.getWorkerGroup())
                 .startTime(new Date())
                 .updateTime(new Date())
                 .build();
diff --git 
a/dolphinscheduler-master/src/test/java/org/apache/dolphinscheduler/server/master/engine/workflow/trigger/WorkflowInstanceRepeatTriggerTest.java
 
b/dolphinscheduler-master/src/test/java/org/apache/dolphinscheduler/server/master/engine/workflow/trigger/WorkflowInstanceRepeatTriggerTest.java
new file mode 100644
index 0000000000..d5e4820aeb
--- /dev/null
+++ 
b/dolphinscheduler-master/src/test/java/org/apache/dolphinscheduler/server/master/engine/workflow/trigger/WorkflowInstanceRepeatTriggerTest.java
@@ -0,0 +1,53 @@
+/*
+ * 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.dolphinscheduler.server.master.engine.workflow.trigger;
+
+import static org.assertj.core.api.Assertions.assertThat;
+
+import org.apache.dolphinscheduler.common.enums.CommandType;
+import org.apache.dolphinscheduler.dao.entity.Command;
+import org.apache.dolphinscheduler.dao.entity.WorkflowInstance;
+import 
org.apache.dolphinscheduler.extract.master.transportor.workflow.WorkflowInstanceRepeatRunningRequest;
+
+import org.junit.jupiter.api.Test;
+
+class WorkflowInstanceRepeatTriggerTest {
+
+    @Test
+    void testRepeatRunningCommandShouldInheritWorkflowInstanceWorkerGroup() {
+        final int workflowInstanceId = 1;
+        final long workflowDefinitionCode = 1001L;
+        final int workflowDefinitionVersion = 2;
+        final String workerGroup = "worker-group-a";
+        final WorkflowInstance workflowInstance = new WorkflowInstance();
+        workflowInstance.setId(workflowInstanceId);
+        workflowInstance.setWorkflowDefinitionCode(workflowDefinitionCode);
+        
workflowInstance.setWorkflowDefinitionVersion(workflowDefinitionVersion);
+        workflowInstance.setWorkerGroup(workerGroup);
+
+        final Command command = new 
WorkflowInstanceRepeatTrigger().constructTriggerCommand(
+                WorkflowInstanceRepeatRunningRequest.builder()
+                        .workflowInstanceId(workflowInstanceId)
+                        .userId(1)
+                        .build(),
+                workflowInstance);
+
+        
assertThat(command.getCommandType()).isEqualTo(CommandType.REPEAT_RUNNING);
+        assertThat(command.getWorkerGroup()).isEqualTo(workerGroup);
+    }
+}

Reply via email to