Skip to content

Commit 54cb142

Browse files
authored
Merge branch 'master' into workflow-dashboard
Signed-off-by: salaboy <Salaboy@gmail.com>
2 parents 02a2d2c + 304fb2b commit 54cb142

File tree

66 files changed

+10501
-68
lines changed

Some content is hidden

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

66 files changed

+10501
-68
lines changed

.github/scripts/update_sdk_version.sh

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -8,27 +8,11 @@ DAPR_JAVA_SDK_VERSION=$1
88
# Replaces the SDK major version to 0 for alpha artifacts.
99
DAPR_JAVA_SDK_ALPHA_VERSION=`echo $DAPR_JAVA_SDK_VERSION | sed 's/^[0-9]*\./0./'`
1010

11-
mvn versions:set -DnewVersion=$DAPR_JAVA_SDK_VERSION
11+
mvn versions:set -DnewVersion=$DAPR_JAVA_SDK_VERSION -DprocessDependencies=true
1212
mvn versions:set-property -Dproperty=dapr.sdk.alpha.version -DnewVersion=$DAPR_JAVA_SDK_ALPHA_VERSION
1313
mvn versions:set-property -Dproperty=dapr.sdk.version -DnewVersion=$DAPR_JAVA_SDK_VERSION
1414
mvn versions:set-property -Dproperty=dapr.sdk.version -DnewVersion=$DAPR_JAVA_SDK_VERSION -f sdk-tests/pom.xml
1515
mvn versions:set-property -Dproperty=dapr.sdk.alpha.version -DnewVersion=$DAPR_JAVA_SDK_ALPHA_VERSION -f sdk-tests/pom.xml
1616

17-
###################
18-
# Alpha artifacts #
19-
###################
20-
21-
# sdk-workflows
22-
mvn versions:set -DnewVersion=$DAPR_JAVA_SDK_VERSION -f sdk-workflows/pom.xml
23-
24-
# testcontainers-dapr
25-
mvn versions:set -DnewVersion=$DAPR_JAVA_SDK_VERSION -f testcontainers-dapr/pom.xml
26-
27-
# dapr-spring
28-
mvn versions:set -DnewVersion=$DAPR_JAVA_SDK_VERSION -DprocessDependencies=true -f dapr-spring/pom.xml
29-
mvn versions:set-property -Dproperty=dapr.spring.version -DnewVersion=$DAPR_JAVA_SDK_VERSION -f dapr-spring/pom.xml
30-
31-
# spring-boot-examples
32-
mvn versions:set -DnewVersion=$DAPR_JAVA_SDK_VERSION -f spring-boot-examples/pom.xml
3317

3418
git clean -f

.github/workflows/build.yml

Lines changed: 56 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -36,20 +36,68 @@ jobs:
3636
with:
3737
token: ${{ secrets.CODECOV_TOKEN }}
3838
- name: Upload test report for sdk
39-
uses: actions/upload-artifact@v5
39+
uses: actions/upload-artifact@v6
4040
with:
4141
name: test-dapr-java-sdk-jdk${{ env.JDK_VER }}
4242
path: sdk/target/jacoco-report/
4343
- name: Upload test report for sdk-actors
44-
uses: actions/upload-artifact@v5
44+
uses: actions/upload-artifact@v6
4545
with:
4646
name: report-dapr-java-sdk-actors-jdk${{ env.JDK_VER }}
4747
path: sdk-actors/target/jacoco-report/
4848

49+
build-durabletask:
50+
name: "Durable Task build & tests"
51+
runs-on: ubuntu-latest
52+
timeout-minutes: 30
53+
continue-on-error: false
54+
env:
55+
JDK_VER: 17
56+
steps:
57+
- uses: actions/checkout@v5
58+
- name: Set up OpenJDK ${{ env.JDK_VER }}
59+
uses: actions/setup-java@v4
60+
with:
61+
distribution: 'temurin'
62+
java-version: ${{ env.JDK_VER }}
63+
- name: Checkout Durable Task Sidecar
64+
uses: actions/checkout@v4
65+
with:
66+
repository: dapr/durabletask-go
67+
path: durabletask-sidecar
68+
69+
# TODO: Move the sidecar into a central image repository
70+
- name: Initialize Durable Task Sidecar
71+
run: docker run -d --name durabletask-sidecar -p 4001:4001 --rm -i $(docker build -q ./durabletask-sidecar)
72+
73+
- name: Display Durable Task Sidecar Logs
74+
run: nohup docker logs --since=0 durabletask-sidecar > durabletask-sidecar.log 2>&1 &
75+
76+
# wait for 10 seconds, so sidecar container can be fully up, this will avoid intermittent failing issues for integration tests causing by failed to connect to sidecar
77+
- name: Wait for 10 seconds
78+
run: sleep 10
79+
80+
- name: Integration Tests For Durable Tasks
81+
run: ./mvnw -B -pl durabletask-client -Pintegration-tests dependency:copy-dependencies verify || echo "TEST_FAILED=true" >> $GITHUB_ENV
82+
continue-on-error: true
83+
84+
- name: Kill Durable Task Sidecar
85+
run: docker kill durabletask-sidecar
86+
87+
- name: Upload Durable Task Sidecar Logs
88+
uses: actions/upload-artifact@v6
89+
with:
90+
name: Durable Task Sidecar Logs
91+
path: durabletask-sidecar.log
92+
93+
- name: Fail the job if tests failed
94+
if: env.TEST_FAILED == 'true'
95+
run: exit 1
96+
4997
build:
5098
name: "Build jdk:${{ matrix.java }} sb:${{ matrix.spring-boot-display-version }} exp:${{ matrix.experimental }}"
5199
runs-on: ubuntu-latest
52-
timeout-minutes: 30
100+
timeout-minutes: 45
53101
continue-on-error: ${{ matrix.experimental }}
54102
strategy:
55103
fail-fast: false
@@ -151,23 +199,24 @@ jobs:
151199
run: ./mvnw clean install -B -q -DskipTests
152200
- name: Integration tests using spring boot version ${{ matrix.spring-boot-version }}
153201
id: integration_tests
154-
run: PRODUCT_SPRING_BOOT_VERSION=${{ matrix.spring-boot-version }} ./mvnw -B -Pintegration-tests dependency:copy-dependencies verify
202+
run: PRODUCT_SPRING_BOOT_VERSION=${{ matrix.spring-boot-version }} ./mvnw -B -pl !durabletask-client -Pintegration-tests dependency:copy-dependencies verify
155203
- name: Upload failsafe test report for sdk-tests on failure
156204
if: ${{ failure() && steps.integration_tests.conclusion == 'failure' }}
157-
uses: actions/upload-artifact@v5
205+
uses: actions/upload-artifact@v6
158206
with:
159207
name: failsafe-report-sdk-tests-jdk${{ matrix.java }}-sb${{ matrix.spring-boot-version }}
160208
path: sdk-tests/target/failsafe-reports
161209
- name: Upload surefire test report for sdk-tests on failure
162210
if: ${{ failure() && steps.integration_tests.conclusion == 'failure' }}
163-
uses: actions/upload-artifact@v5
211+
uses: actions/upload-artifact@v6
164212
with:
165213
name: surefire-report-sdk-tests-jdk${{ matrix.java }}-sb${{ matrix.spring-boot-version }}
166214
path: sdk-tests/target/surefire-reports
167215

216+
168217
publish:
169218
runs-on: ubuntu-latest
170-
needs: [ build, test ]
219+
needs: [ build, test, build-durabletask ]
171220
timeout-minutes: 30
172221
env:
173222
JDK_VER: 17

durabletask-client/pom.xml

Lines changed: 163 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,163 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project xmlns="http://maven.apache.org/POM/4.0.0"
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
5+
<modelVersion>4.0.0</modelVersion>
6+
<parent>
7+
<groupId>io.dapr</groupId>
8+
<artifactId>dapr-sdk-parent</artifactId>
9+
<version>1.17.0-SNAPSHOT</version>
10+
</parent>
11+
12+
<artifactId>durabletask-client</artifactId>
13+
14+
<properties>
15+
<protobuf.output.directory>${project.build.directory}/generated-sources</protobuf.output.directory>
16+
<protobuf.input.directory>${project.build.directory}/proto</protobuf.input.directory>
17+
</properties>
18+
19+
<dependencies>
20+
<dependency>
21+
<groupId>javax.annotation</groupId>
22+
<artifactId>javax.annotation-api</artifactId>
23+
<scope>provided</scope>
24+
</dependency>
25+
<dependency>
26+
<groupId>io.grpc</groupId>
27+
<artifactId>grpc-protobuf</artifactId>
28+
</dependency>
29+
<dependency>
30+
<groupId>io.grpc</groupId>
31+
<artifactId>grpc-stub</artifactId>
32+
</dependency>
33+
<dependency>
34+
<groupId>io.grpc</groupId>
35+
<artifactId>grpc-netty</artifactId>
36+
</dependency>
37+
<dependency>
38+
<groupId>com.google.protobuf</groupId>
39+
<artifactId>protobuf-java</artifactId>
40+
</dependency>
41+
<dependency>
42+
<groupId>com.fasterxml.jackson.core</groupId>
43+
<artifactId>jackson-core</artifactId>
44+
</dependency>
45+
<dependency>
46+
<groupId>com.fasterxml.jackson.core</groupId>
47+
<artifactId>jackson-databind</artifactId>
48+
</dependency>
49+
<dependency>
50+
<groupId>com.fasterxml.jackson.core</groupId>
51+
<artifactId>jackson-annotations</artifactId>
52+
</dependency>
53+
<dependency>
54+
<groupId>com.fasterxml.jackson.datatype</groupId>
55+
<artifactId>jackson-datatype-jsr310</artifactId>
56+
</dependency>
57+
<dependency>
58+
<groupId>io.grpc</groupId>
59+
<artifactId>grpc-testing</artifactId>
60+
<scope>test</scope>
61+
</dependency>
62+
<dependency>
63+
<groupId>org.junit.jupiter</groupId>
64+
<artifactId>junit-jupiter</artifactId>
65+
<scope>test</scope>
66+
</dependency>
67+
<dependency>
68+
<groupId>org.testcontainers</groupId>
69+
<artifactId>testcontainers</artifactId>
70+
</dependency>
71+
</dependencies>
72+
<build>
73+
<plugins>
74+
<plugin>
75+
<groupId>org.sonatype.plugins</groupId>
76+
<artifactId>nexus-staging-maven-plugin</artifactId>
77+
</plugin>
78+
<plugin>
79+
<groupId>org.apache.maven.plugins</groupId>
80+
<artifactId>maven-failsafe-plugin</artifactId>
81+
<configuration>
82+
<classesDirectory>${project.build.outputDirectory}</classesDirectory>
83+
</configuration>
84+
</plugin>
85+
<plugin>
86+
<groupId>com.googlecode.maven-download-plugin</groupId>
87+
<artifactId>download-maven-plugin</artifactId>
88+
<version>1.6.0</version>
89+
<executions>
90+
<execution>
91+
<id>getDaprProto</id>
92+
<phase>initialize</phase>
93+
<goals>
94+
<goal>wget</goal>
95+
</goals>
96+
<configuration>
97+
<skipCache>true</skipCache>
98+
<url>${durabletask.proto.url}</url>
99+
<outputFileName>orchestrator_service.proto</outputFileName>
100+
<outputDirectory>${protobuf.input.directory}</outputDirectory>
101+
</configuration>
102+
</execution>
103+
</executions>
104+
</plugin>
105+
<plugin>
106+
<groupId>org.xolstice.maven.plugins</groupId>
107+
<artifactId>protobuf-maven-plugin</artifactId>
108+
<version>0.6.1</version>
109+
<configuration>
110+
<protocArtifact>com.google.protobuf:protoc:${protobuf.version}:exe:${os.detected.classifier}</protocArtifact>
111+
<pluginId>grpc-java</pluginId>
112+
<pluginArtifact>io.grpc:protoc-gen-grpc-java:${grpc.version}:exe:${os.detected.classifier}</pluginArtifact>
113+
<protoSourceRoot>${protobuf.input.directory}</protoSourceRoot>
114+
</configuration>
115+
<executions>
116+
<execution>
117+
<goals>
118+
<goal>compile</goal>
119+
<goal>compile-custom</goal>
120+
</goals>
121+
</execution>
122+
</executions>
123+
</plugin>
124+
<plugin>
125+
<groupId>org.apache.maven.plugins</groupId>
126+
<artifactId>maven-source-plugin</artifactId>
127+
<version>3.2.1</version>
128+
<executions>
129+
<execution>
130+
<id>attach-sources</id>
131+
<goals>
132+
<goal>jar-no-fork</goal>
133+
</goals>
134+
</execution>
135+
</executions>
136+
</plugin>
137+
<plugin>
138+
<groupId>org.apache.maven.plugins</groupId>
139+
<artifactId>maven-javadoc-plugin</artifactId>
140+
<version>3.2.0</version>
141+
<configuration>
142+
<notimestamp>true</notimestamp>
143+
</configuration>
144+
<executions>
145+
<execution>
146+
<id>attach-javadocs</id>
147+
<goals>
148+
<goal>jar</goal>
149+
</goals>
150+
</execution>
151+
</executions>
152+
</plugin>
153+
<plugin>
154+
<groupId>com.github.spotbugs</groupId>
155+
<artifactId>spotbugs-maven-plugin</artifactId>
156+
<configuration>
157+
<!-- Skip findbugs for auto-generated code -->
158+
<skip>true</skip>
159+
</configuration>
160+
</plugin>
161+
</plugins>
162+
</build>
163+
</project>
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
/*
2+
* Copyright 2025 The Dapr Authors
3+
* Licensed under the Apache License, Version 2.0 (the "License");
4+
* you may not use this file except in compliance with the License.
5+
* You may obtain a copy of the License at
6+
* http://www.apache.org/licenses/LICENSE-2.0
7+
* Unless required by applicable law or agreed to in writing, software
8+
* distributed under the License is distributed on an "AS IS" BASIS,
9+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10+
* See the License for the specific language governing permissions and
11+
limitations under the License.
12+
*/
13+
14+
package io.dapr.durabletask;
15+
16+
import java.util.ArrayList;
17+
import java.util.List;
18+
19+
/**
20+
* Exception that gets thrown when multiple {@link Task}s for an activity or sub-orchestration fails with an
21+
* unhandled exception.
22+
*
23+
* <p>Detailed information associated with each task failure can be retrieved using the {@link #getExceptions()}
24+
* method.</p>
25+
*/
26+
public class CompositeTaskFailedException extends RuntimeException {
27+
private final List<Exception> exceptions;
28+
29+
CompositeTaskFailedException() {
30+
this.exceptions = new ArrayList<>();
31+
}
32+
33+
CompositeTaskFailedException(List<Exception> exceptions) {
34+
this.exceptions = exceptions;
35+
}
36+
37+
CompositeTaskFailedException(String message, List<Exception> exceptions) {
38+
super(message);
39+
this.exceptions = exceptions;
40+
}
41+
42+
CompositeTaskFailedException(String message, Throwable cause, List<Exception> exceptions) {
43+
super(message, cause);
44+
this.exceptions = exceptions;
45+
}
46+
47+
CompositeTaskFailedException(Throwable cause, List<Exception> exceptions) {
48+
super(cause);
49+
this.exceptions = exceptions;
50+
}
51+
52+
CompositeTaskFailedException(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace,
53+
List<Exception> exceptions) {
54+
super(message, cause, enableSuppression, writableStackTrace);
55+
this.exceptions = exceptions;
56+
}
57+
58+
/**
59+
* Gets a list of exceptions that occurred during execution of a group of {@link Task}.
60+
* These exceptions include details of the task failure and exception information
61+
*
62+
* @return a list of exceptions
63+
*/
64+
public List<Exception> getExceptions() {
65+
return new ArrayList<>(this.exceptions);
66+
}
67+
68+
}

0 commit comments

Comments
 (0)