Skip to content

Commit 3b5ba0d

Browse files
authored
Merge branch 'master' into pg_image_14
2 parents dbbf63e + e29adb7 commit 3b5ba0d

File tree

607 files changed

+6673
-2144
lines changed

Some content is hidden

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

607 files changed

+6673
-2144
lines changed

.mvn/wrapper/maven-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@
1616
# under the License.
1717
wrapperVersion=3.3.2
1818
distributionType=only-script
19-
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.3/apache-maven-3.6.3-bin.zip
19+
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.9/apache-maven-3.9.9-bin.zip

CHANGELOG.md

Lines changed: 157 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,162 @@
11
# Change Log
22

3+
## [2.31.0] - 2025-08-04
4+
5+
### Added
6+
7+
- concord-tasks: add createApiKey action
8+
([#1194](https://github.com/walmartlabs/concord/pull/1194));
9+
- concord-server: option to specify API key value
10+
([#1195](https://github.com/walmartlabs/concord/pull/1195));
11+
- concord-tasks: add createOrUpdateApiKey action
12+
([#1196](https://github.com/walmartlabs/concord/pull/1196)).
13+
14+
### Changed
15+
16+
- concord-runtime-model: more flexible interfaces, simplify code
17+
([#1184](https://github.com/walmartlabs/concord/pull/1184));
18+
- project: fix typo
19+
([#1191](https://github.com/walmartlabs/concord/pull/1191));
20+
- runtime-v2: additional error logging when cloning state fails
21+
([#1192](https://github.com/walmartlabs/concord/pull/1192));
22+
- project: update dependencies
23+
([#1193](https://github.com/walmartlabs/concord/pull/1193)).
24+
25+
26+
27+
## [2.30.0] - 2025-07-12
28+
29+
### Added
30+
31+
- http-task: support sending int values in multipart
32+
requests
33+
([#1174](https://github.com/walmartlabs/concord/pull/1174));
34+
- concord-server: config option to disable template script
35+
processing
36+
([#1176](https://github.com/walmartlabs/concord/pull/1176));
37+
- common, runtime-v1: add method to assert given path string
38+
resolves in expected parent
39+
([#1179](https://github.com/walmartlabs/concord/pull/1179)).
40+
41+
### Changed
42+
43+
- concord-cli: produce an executable binary again
44+
([#1171](https://github.com/walmartlabs/concord/pull/1171));
45+
- concord-server: allow get user for concordSystemReader role
46+
([#1173](https://github.com/walmartlabs/concord/pull/1173));
47+
- runtime-v2: return copies in ObjectMapperProvider
48+
([#1175](https://github.com/walmartlabs/concord/pull/1175));
49+
- concord-server: do not log session token
50+
([#1177](https://github.com/walmartlabs/concord/pull/1177));
51+
- concord-server: kill process when resume fails with no
52+
state
53+
([#1178](https://github.com/walmartlabs/concord/pull/1178));
54+
- runtime-v2: validate form name constraints as documented
55+
([#1180](https://github.com/walmartlabs/concord/pull/1180));
56+
- runtime-v1: validate form name constraints as documented
57+
([#1181](https://github.com/walmartlabs/concord/pull/1181));
58+
- runtime-v2: remove unused imports, dead code
59+
([#1185](https://github.com/walmartlabs/concord/pull/1185));
60+
- concord-console2: sort variables in task call details
61+
([#1186](https://github.com/walmartlabs/concord/pull/1186));
62+
- http-task: allow send long multipart with debug enabled
63+
([#1188](https://github.com/walmartlabs/concord/pull/1188));
64+
- concord-server: fix tx in process card dao
65+
([#1189](https://github.com/walmartlabs/concord/pull/1189)).
66+
67+
68+
69+
## [2.29.0] - 2025-06-13
70+
71+
### Added
72+
73+
- concord-server: refactor WebSocketChannelManager, allow
74+
message sources in plugins
75+
([#1056](https://github.com/walmartlabs/concord/pull/1056));
76+
- concord-agent: one-shot mode
77+
([#1150](https://github.com/walmartlabs/concord/pull/1150));
78+
- slack-tasks: allow send blocks instead of simple text
79+
([#1161](https://github.com/walmartlabs/concord/pull/1161));
80+
- concord-server, concord-console2: add console.cfgFile
81+
config parameter
82+
([#1166](https://github.com/walmartlabs/concord/pull/1166));
83+
- runtime-v2: support expressions for output variables in
84+
call step
85+
([#1170](https://github.com/walmartlabs/concord/pull/1170)).
86+
87+
### Changed
88+
89+
- concord-server, concord-console2: use webapp plugin
90+
([#1154](https://github.com/walmartlabs/concord/pull/1154));
91+
- runtime-v2: add extra check to testThrowParallelWithPayload
92+
([#1157](https://github.com/walmartlabs/concord/pull/1157));
93+
- concord-server-it: reduce agent and server poll delays to
94+
speed up tests
95+
([#1159](https://github.com/walmartlabs/concord/pull/1159));
96+
- concord-runtime-v1/v2-it: reduce agent and server poll
97+
delays to speed up tests
98+
([#1163](https://github.com/walmartlabs/concord/pull/1163));
99+
- runtime-v2: improve handling of @SensitiveData on bridge
100+
methods
101+
([#1164](https://github.com/walmartlabs/concord/pull/1164));
102+
- webapp: fix prefix matching
103+
([#1167](https://github.com/walmartlabs/concord/pull/1167));
104+
- oidc: fix role mapping validation
105+
([#1168](https://github.com/walmartlabs/concord/pull/1168));
106+
- concord-server-db: use our own implementation of session
107+
locks
108+
([#1169](https://github.com/walmartlabs/concord/pull/1169)).
109+
110+
111+
112+
## [2.28.0] - 2025-06-04
113+
114+
### Added
115+
116+
- concord-server: add more repository-level GitHub events
117+
([#1149](https://github.com/walmartlabs/concord/pull/1149));
118+
- runtime-v2: allow marking nested values as sensitive data
119+
([#1151](https://github.com/walmartlabs/concord/pull/1151));
120+
- misc-tasks, runtime-v2: support masking when base64
121+
encoding/decoding sensitive data
122+
([#1155](https://github.com/walmartlabs/concord/pull/1155)).
123+
124+
### Changed
125+
126+
- runtime-v1, runtime-v2: refactor loader structure
127+
([#1147](https://github.com/walmartlabs/concord/pull/1147));
128+
- examples: update description
129+
([#1153](https://github.com/walmartlabs/concord/pull/1153));
130+
- concord-server-it: make dependency resolver timeout same
131+
as in runtime-v2 ITs
132+
([#1156](https://github.com/walmartlabs/concord/pull/1156));
133+
- docker-images: update JDK versions
134+
([#1158](https://github.com/walmartlabs/concord/pull/1158));
135+
- project: use central-publishing-maven-plugin
136+
([#1160](https://github.com/walmartlabs/concord/pull/1160)).
137+
138+
139+
140+
## [2.27.0] - 2025-05-22
141+
142+
### Added
143+
144+
- concord-server: default Git credentials hostname whitelist
145+
([#1139](https://github.com/walmartlabs/concord/pull/1139));
146+
- concord-server: log listening address, starting tasks
147+
([#1141](https://github.com/walmartlabs/concord/pull/1141));
148+
149+
### Changed
150+
151+
- oidc: validate team and role mappings
152+
([#1144](https://github.com/walmartlabs/concord/pull/1144));
153+
- concord-server-db: use session locks in Liquibase
154+
([#1145](https://github.com/walmartlabs/concord/pull/1145));
155+
- concord-server: handle SIGTERM
156+
([#1146](https://github.com/walmartlabs/concord/pull/1146)).
157+
158+
159+
3160
## [2.26.0] - 2025-05-05
4161

5162
### Added

SECURITY.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
## Reporting a Vulnerability
44

5-
To report a vulnerabitility please use [GitHub Issues](https://github.com/walmartlabs/concord/issues)
5+
To report a vulnerability please use [GitHub Issues](https://github.com/walmartlabs/concord/issues)
66
or reach the team using the following email address:
77

88

agent-operator/pom.xml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,16 @@
66
<parent>
77
<groupId>com.walmartlabs.concord</groupId>
88
<artifactId>parent</artifactId>
9-
<version>2.26.1-SNAPSHOT</version>
9+
<version>2.31.1-SNAPSHOT</version>
1010
<relativePath>../pom.xml</relativePath>
1111
</parent>
1212

1313
<groupId>com.walmartlabs.concord.k8s</groupId>
1414
<artifactId>concord-agent-operator</artifactId>
1515
<packaging>jar</packaging>
1616

17+
<name>${project.groupId}:${project.artifactId}</name>
18+
1719
<dependencies>
1820
<dependency>
1921
<groupId>com.walmartlabs.concord</groupId>

agent/pom.xml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,15 @@
66
<parent>
77
<groupId>com.walmartlabs.concord</groupId>
88
<artifactId>parent</artifactId>
9-
<version>2.26.1-SNAPSHOT</version>
9+
<version>2.31.1-SNAPSHOT</version>
1010
<relativePath>../pom.xml</relativePath>
1111
</parent>
1212

1313
<artifactId>concord-agent</artifactId>
1414
<packaging>jar</packaging>
1515

16+
<name>${project.groupId}:${project.artifactId}</name>
17+
1618
<properties>
1719
<runnerV1.path>
1820
${project.basedir}/../runtime/v1/impl/target/concord-runtime-impl-v1-${project.version}-jar-with-dependencies.jar

agent/src/main/java/com/walmartlabs/concord/agent/AgentModule.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,12 +57,11 @@ public void configure(Binder binder) {
5757

5858
binder.bind(AgentConfiguration.class).in(SINGLETON);
5959
binder.bind(DockerConfiguration.class).in(SINGLETON);
60+
binder.bind(RuntimeConfiguration.class).asEagerSingleton();
6061
binder.bind(GitConfiguration.class).in(SINGLETON);
6162
binder.bind(ImportConfiguration.class).in(SINGLETON);
6263
binder.bind(PreForkConfiguration.class).in(SINGLETON);
6364
binder.bind(RepositoryCacheConfiguration.class).in(SINGLETON);
64-
binder.bind(RunnerV1Configuration.class).in(SINGLETON);
65-
binder.bind(RunnerV2Configuration.class).in(SINGLETON);
6665
binder.bind(ServerConfiguration.class).in(SINGLETON);
6766

6867
binder.bind(DefaultDependencies.class).in(SINGLETON);

agent/src/main/java/com/walmartlabs/concord/agent/Main.java

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,20 +22,31 @@
2222

2323

2424
import com.google.inject.Guice;
25-
import com.google.inject.Injector;
2625
import org.eclipse.sisu.space.BeanScanning;
2726
import org.eclipse.sisu.space.SpaceModule;
2827
import org.eclipse.sisu.space.URLClassSpace;
2928
import org.eclipse.sisu.wire.WireModule;
3029

3130
public class Main {
3231

33-
public static void main(String[] args) {
34-
ClassLoader cl = Main.class.getClassLoader();
32+
public static void main(String[] args) throws Exception {
33+
// auto-wire all modules
34+
var classLoader = Main.class.getClassLoader();
35+
var modules = new WireModule(new SpaceModule(new URLClassSpace(classLoader), BeanScanning.GLOBAL_INDEX));
36+
var injector = Guice.createInjector(modules);
3537

36-
Injector injector = Guice.createInjector(new WireModule(new SpaceModule(new URLClassSpace(cl), BeanScanning.GLOBAL_INDEX)));
37-
38-
Agent a = injector.getInstance(Agent.class);
39-
a.start();
38+
if (args.length == 1) {
39+
// one-shot mode - read ProcessResponse directly from the command line, execute the process and exit
40+
// the current $PWD will be used as ${workDir}
41+
var oneShotRunner = injector.getInstance(OneShotRunner.class);
42+
oneShotRunner.run(args[0]);
43+
} else if (args.length == 0) {
44+
// agent mode - connect to the server's websocket and handle ProcessResponses
45+
var agent = injector.getInstance(Agent.class);
46+
agent.start();
47+
} else {
48+
throw new IllegalArgumentException("Specify the entire ProcessResponse JSON as the first argument to run in " +
49+
"the one-shot mode or run without arguments for the default (agent) mode.");
50+
}
4051
}
4152
}
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
package com.walmartlabs.concord.agent;
2+
3+
/*-
4+
* *****
5+
* Concord
6+
* -----
7+
* Copyright (C) 2017 - 2024 Walmart Inc.
8+
* -----
9+
* Licensed under the Apache License, Version 2.0 (the "License");
10+
* you may not use this file except in compliance with the License.
11+
* You may obtain a copy of the License at
12+
*
13+
* http://www.apache.org/licenses/LICENSE-2.0
14+
*
15+
* Unless required by applicable law or agreed to in writing, software
16+
* distributed under the License is distributed on an "AS IS" BASIS,
17+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18+
* See the License for the specific language governing permissions and
19+
* limitations under the License.
20+
* =====
21+
*/
22+
23+
import com.fasterxml.jackson.databind.ObjectMapper;
24+
import com.google.inject.Injector;
25+
import com.walmartlabs.concord.agent.cfg.AgentConfiguration;
26+
import com.walmartlabs.concord.agent.guice.WorkerModule;
27+
import com.walmartlabs.concord.common.IOUtils;
28+
import com.walmartlabs.concord.server.queueclient.message.ProcessResponse;
29+
30+
import javax.inject.Inject;
31+
32+
import static java.util.Objects.requireNonNull;
33+
34+
public class OneShotRunner {
35+
36+
private final AgentConfiguration agentCfg;
37+
private final ObjectMapper objectMapper;
38+
private final Injector injector;
39+
40+
@Inject
41+
public OneShotRunner(AgentConfiguration agentCfg,
42+
ObjectMapper objectMapper,
43+
Injector injector) {
44+
45+
this.agentCfg = requireNonNull(agentCfg);
46+
this.objectMapper = requireNonNull(objectMapper);
47+
this.injector = requireNonNull(injector);
48+
}
49+
50+
public void run(String processResponseJson) throws Exception {
51+
var processResponse = objectMapper.readValue(processResponseJson, ProcessResponse.class);
52+
var workDir = IOUtils.createTempDir(agentCfg.getPayloadDir(), "workDir");
53+
var jobRequest = JobRequest.from(processResponse, workDir);
54+
55+
var workerModule = new WorkerModule(agentCfg.getAgentId(), jobRequest.getInstanceId(), jobRequest.getSessionToken());
56+
var workerFactory = injector.createChildInjector(workerModule).getInstance(WorkerFactory.class);
57+
var worker = workerFactory.create(jobRequest, status -> {
58+
});
59+
60+
worker.setThrowOnFailure(true);
61+
62+
try {
63+
worker.run();
64+
} catch (Exception e) {
65+
System.exit(1);
66+
}
67+
68+
System.exit(0);
69+
}
70+
}

agent/src/main/java/com/walmartlabs/concord/agent/Worker.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ public class Worker implements Runnable {
5050
private final JobRequest jobRequest;
5151

5252
private JobInstance jobInstance;
53+
private boolean throwOnFailure;
5354

5455
@Inject
5556
public Worker(RepositoryManager repositoryManager,
@@ -119,6 +120,10 @@ public void cancel() {
119120
jobInstance.cancel();
120121
}
121122

123+
public void setThrowOnFailure(boolean throwOnFailure) {
124+
this.throwOnFailure = throwOnFailure;
125+
}
126+
122127
private void handleError(UUID instanceId, Throwable error) {
123128
StatusEnum status = StatusEnum.FAILED;
124129

@@ -131,6 +136,13 @@ private void handleError(UUID instanceId, Throwable error) {
131136

132137
onStatusChange(instanceId, status);
133138
log.info("handleError ['{}'] -> done", instanceId);
139+
140+
if (throwOnFailure) {
141+
if (error instanceof RuntimeException re) {
142+
throw re;
143+
}
144+
throw new RuntimeException(error);
145+
}
134146
}
135147

136148
private void onStatusChange(UUID instanceId, StatusEnum status) {

0 commit comments

Comments
 (0)