Skip to content

Commit 8d1984d

Browse files
authored
Merge branch 'main' into server-lite
2 parents 7f6653a + 424a0ce commit 8d1984d

File tree

62 files changed

+11802
-168
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+11802
-168
lines changed

.github/workflows/publish.yml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ jobs:
4242
ORG_GRADLE_PROJECT_signingKeyId: ${{ secrets.SIGNING_KEY_ID }}
4343
ORG_GRADLE_PROJECT_signingKey: ${{ secrets.SIGNING_KEY }}
4444
ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.SIGNING_PASSWORD }}
45-
4645
publish-server:
4746
runs-on: ubuntu-latest
4847
name: Gradle Build and Publish
@@ -78,6 +77,4 @@ jobs:
7877
asset_name: conductor-server-lite.jar
7978
asset_content_type: application/java-archive
8079
env:
81-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
82-
83-
80+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

awss3-storage/build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,6 @@ dependencies {
1717
compileOnly 'org.springframework.boot:spring-boot-starter'
1818

1919
implementation "com.amazonaws:aws-java-sdk-s3:${revAwsSdk}"
20+
implementation "com.amazonaws:aws-java-sdk-sts:${revAwsSdk}"
2021
implementation "org.apache.commons:commons-lang3"
2122
}
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
/*
2+
* Copyright 2025 Conductor Authors.
3+
* <p>
4+
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
5+
* the License. You may obtain a copy of the License at
6+
* <p>
7+
* http://www.apache.org/licenses/LICENSE-2.0
8+
* <p>
9+
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
10+
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
11+
* specific language governing permissions and limitations under the License.
12+
*/
13+
package com.netflix.conductor.common.run;
14+
15+
import java.util.Map;
16+
17+
import com.netflix.conductor.annotations.protogen.ProtoField;
18+
19+
import com.fasterxml.jackson.annotation.JsonIgnore;
20+
import com.fasterxml.jackson.annotation.JsonProperty;
21+
22+
/** Extended version of WorkflowSummary that retains input/output as Map */
23+
public class WorkflowSummaryExtended extends WorkflowSummary {
24+
25+
@ProtoField(id = 9) // Ensure Protobuf compatibility
26+
@JsonIgnore
27+
private Map<String, Object> inputMap;
28+
29+
@ProtoField(id = 10)
30+
@JsonIgnore
31+
private Map<String, Object> outputMap;
32+
33+
public WorkflowSummaryExtended(Workflow workflow) {
34+
super(workflow);
35+
if (workflow.getInput() != null) {
36+
this.inputMap = workflow.getInput();
37+
}
38+
if (workflow.getOutput() != null) {
39+
this.outputMap = workflow.getOutput();
40+
}
41+
}
42+
43+
/** New method for JSON serialization */
44+
@JsonProperty("input")
45+
public Map<String, Object> getInputMap() {
46+
return inputMap;
47+
}
48+
49+
/** New method for JSON serialization */
50+
@JsonProperty("output")
51+
public Map<String, Object> getOutputMap() {
52+
return outputMap;
53+
}
54+
55+
public void setInputMap(Map<String, Object> inputMap) {
56+
this.inputMap = inputMap;
57+
}
58+
59+
public void setOutputMap(Map<String, Object> outputMap) {
60+
this.outputMap = outputMap;
61+
}
62+
}

conductor-clients/java/conductor-java-sdk/build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ subprojects {
3535
implementation "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:${versions.jackson}"
3636
implementation "com.fasterxml.jackson.module:jackson-module-kotlin:${versions.jackson}"
3737
implementation "com.fasterxml.jackson.module:jackson-module-afterburner:${versions.jackson}"
38+
implementation "org.openjdk.nashorn:nashorn-core:15.4"
3839

3940
implementation "org.slf4j:slf4j-api:${versions.slf4j}"
4041
implementation "org.apache.commons:commons-lang3:${versions.commonsLang}"

conductor-clients/java/conductor-java-sdk/conductor-client/src/main/java/com/netflix/conductor/client/http/TaskClient.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -515,7 +515,7 @@ public SearchResult<Task> searchV2(Integer start, Integer size, String sort, Str
515515
return resp.getData();
516516
}
517517

518-
private void populateTaskPayloads(Task task) {
518+
public void populateTaskPayloads(Task task) {
519519
if (!conductorClientConfiguration.isEnforceThresholds()) {
520520
return;
521521
}

conductor-clients/java/conductor-java-sdk/conductor-client/src/main/java/com/netflix/conductor/client/http/WorkflowClient.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ public String startWorkflow(StartWorkflowRequest startWorkflowRequest) {
127127
return resp.getData();
128128
}
129129

130-
private void checkAndUploadToExternalStorage(StartWorkflowRequest startWorkflowRequest) {
130+
public void checkAndUploadToExternalStorage(StartWorkflowRequest startWorkflowRequest) {
131131
try (ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream()) {
132132
objectMapper.writeValue(byteArrayOutputStream, startWorkflowRequest.getInput());
133133
byte[] workflowInputBytes = byteArrayOutputStream.toByteArray();
@@ -565,7 +565,7 @@ public Workflow testWorkflow(WorkflowTestRequest testRequest) {
565565
*
566566
* @param workflow the workflow for which the output is to be populated.
567567
*/
568-
private void populateWorkflowOutput(Workflow workflow) {
568+
public void populateWorkflowOutput(Workflow workflow) {
569569
if (StringUtils.isNotBlank(workflow.getExternalOutputPayloadStoragePath())) {
570570
eventDispatcher.publish(new WorkflowPayloadUsedEvent(workflow.getWorkflowName(),
571571
workflow.getWorkflowVersion(),

conductor-clients/java/conductor-java-sdk/conductor-client/src/main/java/com/netflix/conductor/common/metadata/SchemaDef.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,13 @@
1414

1515
import java.util.Map;
1616

17+
import lombok.*;
18+
19+
@EqualsAndHashCode(callSuper = true)
20+
@Builder
21+
@Data
22+
@NoArgsConstructor
23+
@AllArgsConstructor
1724
public class SchemaDef extends Auditable {
1825

1926
public enum Type {

conductor-clients/java/conductor-java-sdk/conductor-client/src/main/java/com/netflix/conductor/common/metadata/workflow/SubWorkflowParams.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public class SubWorkflowParams {
3535
private IdempotencyStrategy idempotencyStrategy;
3636

3737
// Priority of the sub workflow, not set inherits from the parent
38-
private Integer priority;
38+
private Object priority;
3939

4040
public String getIdempotencyKey() {
4141
return idempotencyKey;
@@ -154,11 +154,10 @@ public boolean equals(Object o) {
154154
return Objects.equals(getName(), that.getName()) && Objects.equals(getVersion(), that.getVersion()) && Objects.equals(getTaskToDomain(), that.getTaskToDomain()) && Objects.equals(getWorkflowDefinition(), that.getWorkflowDefinition());
155155
}
156156

157-
public Integer getPriority() {
157+
public Object getPriority() {
158158
return priority;
159159
}
160-
161-
public void setPriority(Integer priority) {
160+
public void setPriority(Object priority) {
162161
this.priority = priority;
163162
}
164163
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
/*
2+
* Copyright 2020 Conductor Authors.
3+
* <p>
4+
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
5+
* the License. You may obtain a copy of the License at
6+
* <p>
7+
* http://www.apache.org/licenses/LICENSE-2.0
8+
* <p>
9+
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
10+
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
11+
* specific language governing permissions and limitations under the License.
12+
*/
13+
package com.netflix.conductor.common.metadata.workflow;
14+
15+
import java.io.IOException;
16+
import java.io.InputStream;
17+
18+
import org.junit.jupiter.api.Assertions;
19+
import org.junit.jupiter.api.BeforeEach;
20+
import org.junit.jupiter.api.DisplayName;
21+
import org.junit.jupiter.api.Test;
22+
23+
import com.netflix.conductor.common.config.ObjectMapperProvider;
24+
25+
import com.fasterxml.jackson.databind.ObjectMapper;
26+
27+
28+
class WorkflowDefDeserializationTest {
29+
30+
private ObjectMapper objectMapper;
31+
32+
@BeforeEach
33+
public void setup() {
34+
objectMapper = new ObjectMapperProvider().getObjectMapper();
35+
}
36+
37+
@Test
38+
@DisplayName("Should correctly deserialize subworkflow priority as a dynamic expression")
39+
public void testSubworkflowPriorityDeserialization() throws Exception {
40+
try (InputStream inputStream = getClass().getResourceAsStream("/workflows/main_workflow.json")) {
41+
if (inputStream == null) {
42+
throw new IOException("Resource not found: /workflows/main_workflow.json");
43+
}
44+
WorkflowDef mainWorkflowDef = objectMapper.readValue(inputStream, WorkflowDef.class);
45+
Assertions.assertEquals("${fetchPriority.output.priority}",
46+
mainWorkflowDef.getTasks().get(1).getSubWorkflowParam().getPriority().toString(),
47+
"Subworkflow priority should be deserialized as a dynamic expression");
48+
}
49+
}
50+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{
2+
"name": "main_workflow_with_priority",
3+
"version": 1,
4+
"tasks": [
5+
{
6+
"name": "fetch_priority_config",
7+
"taskReferenceName": "fetchPriority",
8+
"type": "SIMPLE",
9+
"outputParameters": {
10+
"priority": 42
11+
}
12+
},
13+
{
14+
"name": "sub_workflow_example",
15+
"taskReferenceName": "subWorkflowTask",
16+
"type": "SUB_WORKFLOW",
17+
"subWorkflowParam": {
18+
"name": "sub_workflow_example",
19+
"version": 1,
20+
"priority": "${fetchPriority.output.priority}"
21+
}
22+
}
23+
],
24+
"schemaVersion": 2
25+
}

0 commit comments

Comments
 (0)