Skip to content

Commit 52009fb

Browse files
authored
Merge branch 'master' into enable_jwt_api_auth
2 parents e2ebca6 + 48e852d commit 52009fb

File tree

4 files changed

+62
-6
lines changed
  • console2/src/components/molecules/ProcessStatusTable
  • runtime/v2/runner/src

4 files changed

+62
-6
lines changed

console2/src/components/molecules/ProcessStatusTable/index.tsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -48,13 +48,13 @@ const kindToDescription = (k: ProcessKind): string => {
4848

4949
class ProcessStatusTable extends React.PureComponent<Props> {
5050
static renderCommitId(process?: ProcessEntry) {
51-
if (!process || !process.commitId) {
51+
if (!process || !process.commitId || !process.repoUrl) {
5252
return ' - ';
5353
}
5454

5555
return (
5656
<GitHubLink
57-
url={process.repoUrl!}
57+
url={process.repoUrl}
5858
commitId={process.commitId}
5959
text={process.commitId}
6060
/>
@@ -217,7 +217,7 @@ class ProcessStatusTable extends React.PureComponent<Props> {
217217
}
218218

219219
static renderRepoPath(process?: ProcessEntry) {
220-
if (!process || !process.commitId) {
220+
if (!process || !process.commitId || !process.repoUrl) {
221221
return '-';
222222
}
223223

runtime/v2/runner/src/main/java/com/walmartlabs/concord/runtime/v2/runner/vm/UpdateLocalsCommand.java

+9-3
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,12 @@
2929

3030
import java.util.Collection;
3131
import java.util.Collections;
32+
import java.util.List;
3233
import java.util.Map;
3334

3435
/**
3536
* Takes the input, interpolates its values and sets the result
36-
* as the current frame's local variables.
37+
* to all root frame's local variables.
3738
* <p/>
3839
* Optionally takes a list of threads which root frames should be
3940
* updated with provided variables.
@@ -86,8 +87,13 @@ public void eval(Runtime runtime, State state, ThreadId threadId) {
8687
Map<String, Object> m = ee.evalAsMap(ecf.scope(ctx), input);
8788

8889
for (ThreadId tid : threads) {
89-
Frame root = VMUtils.assertNearestRoot(state, tid);
90-
VMUtils.putLocals(root, m);
90+
List<Frame> frames = state.getFrames(tid);
91+
92+
for (Frame f : frames) {
93+
if (f.getType() == FrameType.ROOT) {
94+
VMUtils.putLocals(f, m);
95+
}
96+
}
9197
}
9298
}
9399
}

runtime/v2/runner/src/test/java/com/walmartlabs/concord/runtime/v2/runner/MainTest.java

+31
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,37 @@ public void tearDown() throws IOException {
184184
LoggingConfigurator.reset();
185185
}
186186

187+
@Test
188+
public void testVariablesAfterResume() throws Exception {
189+
deploy("variablesAfterResume");
190+
191+
save(ProcessConfiguration.builder()
192+
.build());
193+
194+
byte[] log = run();
195+
assertLog(log, ".*workDir1: " + workDir.toAbsolutePath() + ".*");
196+
assertLog(log, ".*workDir3: " + workDir.toAbsolutePath() + ".*");
197+
198+
List<Form> forms = formService.list();
199+
assertEquals(1, forms.size());
200+
201+
Form myForm = forms.get(0);
202+
assertEquals("myForm", myForm.name());
203+
204+
// resume the process using the saved form
205+
206+
Map<String, Object> data = new HashMap<>();
207+
data.put("fullName", "John Smith");
208+
209+
Path newWorkDir = Files.createTempDirectory("test-new");
210+
IOUtils.copy(workDir, newWorkDir);
211+
workDir = newWorkDir;
212+
213+
log = resume(myForm.eventName(), ProcessConfiguration.builder().arguments(Collections.singletonMap("myForm", data)).build());
214+
assertLog(log, ".*workDir4: " + workDir.toAbsolutePath() + ".*");
215+
assertLog(log, ".*workDir2: " + workDir.toAbsolutePath() + ".*");
216+
}
217+
187218
@Test
188219
public void test() throws Exception {
189220
deploy("hello");
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
configuration:
2+
runtime: concord-v2
3+
4+
flows:
5+
default:
6+
- log: "workDir1: ${workDir}"
7+
8+
- call: inner
9+
10+
- log: "workDir2: ${workDir}"
11+
12+
inner:
13+
- log: "workDir3: ${workDir}"
14+
- form: myForm
15+
- log: "workDir4: ${workDir}"
16+
17+
forms:
18+
myForm:
19+
- fullName: { label: "Name", type: "string", placeholder: "Place name here" }

0 commit comments

Comments
 (0)