Skip to content

Commit

Permalink
Merge branch 'enable_jwt_api_auth' of https://github.com/walmartlabs/…
Browse files Browse the repository at this point in the history
…concord into enable_jwt_api_auth
  • Loading branch information
dankle committed Sep 25, 2023
2 parents de362e6 + 52009fb commit 943a8a9
Show file tree
Hide file tree
Showing 4 changed files with 62 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,13 @@ const kindToDescription = (k: ProcessKind): string => {

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

return (
<GitHubLink
url={process.repoUrl!}
url={process.repoUrl}
commitId={process.commitId}
text={process.commitId}
/>
Expand Down Expand Up @@ -217,7 +217,7 @@ class ProcessStatusTable extends React.PureComponent<Props> {
}

static renderRepoPath(process?: ProcessEntry) {
if (!process || !process.commitId) {
if (!process || !process.commitId || !process.repoUrl) {
return '-';
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,12 @@

import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.Map;

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

for (ThreadId tid : threads) {
Frame root = VMUtils.assertNearestRoot(state, tid);
VMUtils.putLocals(root, m);
List<Frame> frames = state.getFrames(tid);

for (Frame f : frames) {
if (f.getType() == FrameType.ROOT) {
VMUtils.putLocals(f, m);
}
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,37 @@ public void tearDown() throws IOException {
LoggingConfigurator.reset();
}

@Test
public void testVariablesAfterResume() throws Exception {
deploy("variablesAfterResume");

save(ProcessConfiguration.builder()
.build());

byte[] log = run();
assertLog(log, ".*workDir1: " + workDir.toAbsolutePath() + ".*");
assertLog(log, ".*workDir3: " + workDir.toAbsolutePath() + ".*");

List<Form> forms = formService.list();
assertEquals(1, forms.size());

Form myForm = forms.get(0);
assertEquals("myForm", myForm.name());

// resume the process using the saved form

Map<String, Object> data = new HashMap<>();
data.put("fullName", "John Smith");

Path newWorkDir = Files.createTempDirectory("test-new");
IOUtils.copy(workDir, newWorkDir);
workDir = newWorkDir;

log = resume(myForm.eventName(), ProcessConfiguration.builder().arguments(Collections.singletonMap("myForm", data)).build());
assertLog(log, ".*workDir4: " + workDir.toAbsolutePath() + ".*");
assertLog(log, ".*workDir2: " + workDir.toAbsolutePath() + ".*");
}

@Test
public void test() throws Exception {
deploy("hello");
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
configuration:
runtime: concord-v2

flows:
default:
- log: "workDir1: ${workDir}"

- call: inner

- log: "workDir2: ${workDir}"

inner:
- log: "workDir3: ${workDir}"
- form: myForm
- log: "workDir4: ${workDir}"

forms:
myForm:
- fullName: { label: "Name", type: "string", placeholder: "Place name here" }

0 comments on commit 943a8a9

Please sign in to comment.