Skip to content

Commit 61cdae7

Browse files
authored
Merge branch 'master' into development-cloudconfig
Signed-off-by: lony2003 <35906997+lony2003@users.noreply.github.com>
2 parents 70d4eea + e13f934 commit 61cdae7

File tree

1,401 files changed

+12914
-5284
lines changed

Some content is hidden

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

1,401 files changed

+12914
-5284
lines changed

.github/workflows/build.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ jobs:
3939
GOPROXY: https://proxy.golang.org
4040
JDK_VER: ${{ matrix.java }}
4141
DAPR_CLI_VER: 1.15.0
42-
DAPR_RUNTIME_VER: 1.15.3
42+
DAPR_RUNTIME_VER: 1.15.4
4343
DAPR_INSTALL_URL: https://raw.githubusercontent.com/dapr/cli/v1.15.0/install/install.sh
4444
DAPR_CLI_REF:
4545
DAPR_REF:
@@ -121,7 +121,7 @@ jobs:
121121
env:
122122
DOCKER_HOST: ${{steps.setup_docker.outputs.sock}}
123123
- name: Codecov
124-
uses: codecov/codecov-action@v5.4.0
124+
uses: codecov/codecov-action@v5.4.3
125125
- name: Install jars
126126
run: ./mvnw install -q -B -DskipTests
127127
- name: Integration tests using spring boot version ${{ matrix.spring-boot-version }}

.github/workflows/fossa.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,12 @@ jobs:
3535
uses: actions/checkout@v4
3636

3737
- name: "Run FOSSA Scan"
38-
uses: fossas/fossa-action@v1.6.0 # Use a specific version if locking is preferred
38+
uses: fossas/fossa-action@v1.7.0 # Use a specific version if locking is preferred
3939
with:
4040
api-key: ${{ env.FOSSA_API_KEY }}
4141

4242
- name: "Run FOSSA Test"
43-
uses: fossas/fossa-action@v1.6.0 # Use a specific version if locking is preferred
43+
uses: fossas/fossa-action@v1.7.0 # Use a specific version if locking is preferred
4444
with:
4545
api-key: ${{ env.FOSSA_API_KEY }}
4646
run-tests: true

.github/workflows/validate.yml

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ jobs:
3838
GOPROXY: https://proxy.golang.org
3939
JDK_VER: ${{ matrix.java }}
4040
DAPR_CLI_VER: 1.15.0
41-
DAPR_RUNTIME_VER: 1.15.3
41+
DAPR_RUNTIME_VER: 1.15.4
4242
DAPR_INSTALL_URL: https://raw.githubusercontent.com/dapr/cli/v1.15.0/install/install.sh
4343
DAPR_CLI_REF:
4444
DAPR_REF:
@@ -115,6 +115,18 @@ jobs:
115115
run: ./mvnw install -q
116116
env:
117117
DOCKER_HOST: ${{steps.setup_docker.outputs.sock}}
118+
- name: Validate Jobs example
119+
working-directory: ./examples
120+
run: |
121+
mm.py ./src/main/java/io/dapr/examples/jobs/README.md
122+
env:
123+
DOCKER_HOST: ${{steps.setup_docker.outputs.sock}}
124+
- name: Validate conversation ai example
125+
working-directory: ./examples
126+
run: |
127+
mm.py ./src/main/java/io/dapr/examples/conversation/README.md
128+
env:
129+
DOCKER_HOST: ${{steps.setup_docker.outputs.sock}}
118130
- name: Validate invoke http example
119131
working-directory: ./examples
120132
run: |
@@ -204,4 +216,10 @@ jobs:
204216
run: |
205217
mm.py README.md
206218
env:
207-
DOCKER_HOST: ${{steps.setup_docker.outputs.sock}}
219+
DOCKER_HOST: ${{steps.setup_docker.outputs.sock}}
220+
- name: Validate Spring Boot Workflow examples
221+
working-directory: ./spring-boot-examples/workflows
222+
run: |
223+
mm.py README.md
224+
env:
225+
DOCKER_HOST: ${{steps.setup_docker.outputs.sock}}

CONTRIBUTING.md

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,52 @@ Before you file an issue, make sure you've checked the following:
5151

5252
This section describes the guidelines for contributing code / docs to Dapr.
5353

54+
### Things to consider when adding new API to SDK
55+
56+
1. All the new API's go under [dapr-sdk maven package](https://github.com/dapr/java-sdk/tree/master/sdk)
57+
2. Make sure there is an example talking about how to use the API along with a README with mechanical markdown. [Example](https://github.com/dapr/java-sdk/pull/1235/files#diff-69ed756c4c01fd5fa884aac030dccb8f3f4d4fefa0dc330862d55a6f87b34a14)
58+
59+
#### Mechanical Markdown
60+
61+
Mechanical markdown is used to validate example outputs in our CI pipeline. It ensures that the expected output in README files matches the actual output when running the examples. This helps maintain example output, catches any unintended changes in example behavior, and regressions.
62+
63+
To test mechanical markdown locally:
64+
65+
1. Install the package:
66+
```bash
67+
pip3 install mechanical-markdown
68+
```
69+
70+
2. Run the test from the respective examples README directory, for example:
71+
```bash
72+
cd examples
73+
mm.py ./src/main/java/io/dapr/examples/workflows/README.md
74+
```
75+
76+
The test will:
77+
- Parse the STEP markers in the README
78+
- Execute the commands specified in the markers
79+
- Compare the actual output with the expected output
80+
- Report any mismatches
81+
82+
When writing STEP markers:
83+
- Use `output_match_mode: substring` for flexible matching
84+
- Quote strings containing special YAML characters (like `:`, `*`, `'`)
85+
- Set appropriate timeouts for long-running examples
86+
87+
Example STEP marker:
88+
```yaml
89+
<!-- STEP
90+
name: Run example
91+
output_match_mode: substring
92+
expected_stdout_lines:
93+
- "Starting workflow: io.dapr.examples.workflows.compensation.BookTripWorkflow"
94+
...
95+
background: true
96+
timeout_seconds: 60
97+
-->
98+
```
99+
54100
### Pull Requests
55101

56102
All contributions come through pull requests. To submit a proposed change, we recommend following this workflow:
@@ -64,6 +110,7 @@ All contributions come through pull requests. To submit a proposed change, we re
64110
6. Commit and open a PR
65111
7. Wait for the CI process to finish and make sure all checks are green
66112
8. A maintainer of the project will be assigned, and you can expect a review within a few days
113+
9. All the files have the Copyright header.
67114

68115
### Configure the code style with checkstyle
69116

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -50,19 +50,19 @@ For a Maven project, add the following to your `pom.xml` file:
5050
<dependency>
5151
<groupId>io.dapr</groupId>
5252
<artifactId>dapr-sdk</artifactId>
53-
<version>1.14.0</version>
53+
<version>1.14.1</version>
5454
</dependency>
5555
<!-- Dapr's SDK for Actors (optional). -->
5656
<dependency>
5757
<groupId>io.dapr</groupId>
5858
<artifactId>dapr-sdk-actors</artifactId>
59-
<version>1.14.0</version>
59+
<version>1.14.1</version>
6060
</dependency>
6161
<!-- Dapr's SDK integration with SpringBoot (optional). -->
6262
<dependency>
6363
<groupId>io.dapr</groupId>
6464
<artifactId>dapr-sdk-springboot</artifactId>
65-
<version>1.14.0</version>
65+
<version>1.14.1</version>
6666
</dependency>
6767
...
6868
</dependencies>
@@ -76,11 +76,11 @@ For a Gradle project, add the following to your `build.gradle` file:
7676
dependencies {
7777
...
7878
// Dapr's core SDK with all features, except Actors.
79-
compile('io.dapr:dapr-sdk:1.14.0')
79+
compile('io.dapr:dapr-sdk:1.14.1')
8080
// Dapr's SDK for Actors (optional).
81-
compile('io.dapr:dapr-sdk-actors:1.14.0')
81+
compile('io.dapr:dapr-sdk-actors:1.14.1')
8282
// Dapr's SDK integration with SpringBoot (optional).
83-
compile('io.dapr:dapr-sdk-springboot:1.14.0')
83+
compile('io.dapr:dapr-sdk-springboot:1.14.1')
8484
}
8585
```
8686

dapr-spring/dapr-spring-boot-autoconfigure/pom.xml

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<parent>
77
<groupId>io.dapr.spring</groupId>
88
<artifactId>dapr-spring-parent</artifactId>
9-
<version>0.15.0-SNAPSHOT</version>
9+
<version>0.16.0-SNAPSHOT</version>
1010
</parent>
1111

1212
<artifactId>dapr-spring-boot-autoconfigure</artifactId>
@@ -18,19 +18,20 @@
1818
<dependency>
1919
<groupId>io.dapr.spring</groupId>
2020
<artifactId>dapr-spring-data</artifactId>
21-
<version>${project.parent.version}</version>
2221
<optional>true</optional>
2322
</dependency>
23+
<dependency>
24+
<groupId>io.dapr</groupId>
25+
<artifactId>dapr-sdk-actors</artifactId>
26+
</dependency>
2427
<dependency>
2528
<groupId>io.dapr.spring</groupId>
2629
<artifactId>dapr-spring-messaging</artifactId>
27-
<version>${project.parent.version}</version>
2830
<optional>true</optional>
2931
</dependency>
3032
<dependency>
3133
<groupId>io.dapr.spring</groupId>
3234
<artifactId>dapr-spring-workflows</artifactId>
33-
<version>${project.parent.version}</version>
3435
<optional>true</optional>
3536
</dependency>
3637
<dependency>
@@ -71,9 +72,20 @@
7172
<dependency>
7273
<groupId>io.dapr</groupId>
7374
<artifactId>testcontainers-dapr</artifactId>
74-
<version>${dapr.sdk.alpha.version}</version>
7575
<scope>test</scope>
7676
</dependency>
77+
<dependency>
78+
<groupId>org.springframework</groupId>
79+
<artifactId>spring-beans</artifactId>
80+
</dependency>
81+
<dependency>
82+
<groupId>org.springframework</groupId>
83+
<artifactId>spring-context</artifactId>
84+
</dependency>
85+
<dependency>
86+
<groupId>org.springframework.boot</groupId>
87+
<artifactId>spring-boot-starter-test</artifactId>
88+
</dependency>
7789
</dependencies>
7890
<build>
7991
<plugins>
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,31 +13,31 @@
1313

1414
package io.dapr.spring.boot.autoconfigure.client;
1515

16-
class PropertiesDaprConnectionDetails implements DaprConnectionDetails {
16+
public class ClientPropertiesDaprConnectionDetails implements DaprConnectionDetails {
1717

1818
private final DaprClientProperties daprClientProperties;
1919

20-
public PropertiesDaprConnectionDetails(DaprClientProperties daprClientProperties) {
20+
public ClientPropertiesDaprConnectionDetails(DaprClientProperties daprClientProperties) {
2121
this.daprClientProperties = daprClientProperties;
2222
}
2323

2424
@Override
25-
public String httpEndpoint() {
25+
public String getHttpEndpoint() {
2626
return this.daprClientProperties.getHttpEndpoint();
2727
}
2828

2929
@Override
30-
public String grpcEndpoint() {
30+
public String getGrpcEndpoint() {
3131
return this.daprClientProperties.getGrpcEndpoint();
3232
}
3333

3434
@Override
35-
public Integer httpPort() {
35+
public Integer getHttpPort() {
3636
return this.daprClientProperties.getHttpPort();
3737
}
3838

3939
@Override
40-
public Integer grpcPort() {
40+
public Integer getGrpcPort() {
4141
return this.daprClientProperties.getGrpcPort();
4242
}
4343
}

dapr-spring/dapr-spring-boot-autoconfigure/src/main/java/io/dapr/spring/boot/autoconfigure/client/DaprClientAutoConfiguration.java

Lines changed: 60 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -37,25 +37,37 @@ public class DaprClientAutoConfiguration {
3737
@Bean
3838
@ConditionalOnMissingBean(DaprConnectionDetails.class)
3939
DaprConnectionDetails daprConnectionDetails(DaprClientProperties properties) {
40-
return new PropertiesDaprConnectionDetails(properties);
40+
return new ClientPropertiesDaprConnectionDetails(properties);
4141
}
4242

4343
@Bean
4444
@ConditionalOnMissingBean
4545
DaprClientBuilder daprClientBuilder(DaprConnectionDetails daprConnectionDetails) {
46-
DaprClientBuilder builder = new DaprClientBuilder();
47-
if (daprConnectionDetails.httpEndpoint() != null) {
48-
builder.withPropertyOverride(Properties.HTTP_ENDPOINT, daprConnectionDetails.httpEndpoint());
46+
DaprClientBuilder builder = createDaprClientBuilder();
47+
String httpEndpoint = daprConnectionDetails.getHttpEndpoint();
48+
49+
if (httpEndpoint != null) {
50+
builder.withPropertyOverride(Properties.HTTP_ENDPOINT, httpEndpoint);
4951
}
50-
if (daprConnectionDetails.grpcEndpoint() != null) {
51-
builder.withPropertyOverride(Properties.GRPC_ENDPOINT, daprConnectionDetails.grpcEndpoint());
52+
53+
String grpcEndpoint = daprConnectionDetails.getGrpcEndpoint();
54+
55+
if (grpcEndpoint != null) {
56+
builder.withPropertyOverride(Properties.GRPC_ENDPOINT, grpcEndpoint);
5257
}
53-
if (daprConnectionDetails.httpPort() != null) {
54-
builder.withPropertyOverride(Properties.HTTP_PORT, String.valueOf(daprConnectionDetails.httpPort()));
58+
59+
Integer httpPort = daprConnectionDetails.getHttpPort();
60+
61+
if (httpPort != null) {
62+
builder.withPropertyOverride(Properties.HTTP_PORT, String.valueOf(httpPort));
5563
}
56-
if (daprConnectionDetails.grpcPort() != null) {
57-
builder.withPropertyOverride(Properties.GRPC_PORT, String.valueOf(daprConnectionDetails.grpcPort()));
64+
65+
Integer grpcPort = daprConnectionDetails.getGrpcPort();
66+
67+
if (grpcPort != null) {
68+
builder.withPropertyOverride(Properties.GRPC_PORT, String.valueOf(grpcPort));
5869
}
70+
5971
return builder;
6072
}
6173

@@ -90,22 +102,50 @@ ActorRuntime daprActorRuntime(DaprConnectionDetails daprConnectionDetails) {
90102
@ConditionalOnMissingBean
91103
WorkflowRuntimeBuilder daprWorkflowRuntimeBuilder(DaprConnectionDetails daprConnectionDetails) {
92104
Properties properties = createPropertiesFromConnectionDetails(daprConnectionDetails);
105+
93106
return new WorkflowRuntimeBuilder(properties);
94107
}
95108

96-
private Properties createPropertiesFromConnectionDetails(DaprConnectionDetails daprConnectionDetails) {
97-
final Map<String, String> propertyOverrides = new HashMap<>();
98-
propertyOverrides.put(Properties.HTTP_ENDPOINT.getName(), daprConnectionDetails.httpEndpoint());
99-
if (daprConnectionDetails.httpPort() != null) {
100-
propertyOverrides.put(Properties.HTTP_PORT.getName(), String.valueOf(daprConnectionDetails.httpPort()));
109+
/**
110+
* We use this method in tests to override the default DaprClientBuilder.
111+
*/
112+
protected DaprClientBuilder createDaprClientBuilder() {
113+
return new DaprClientBuilder();
114+
}
115+
116+
/**
117+
* Creates a Properties object from the DaprConnectionDetails.
118+
*
119+
* @param daprConnectionDetails the DaprConnectionDetails
120+
* @return the Properties object
121+
*/
122+
protected Properties createPropertiesFromConnectionDetails(DaprConnectionDetails daprConnectionDetails) {
123+
Map<String, String> propertyOverrides = new HashMap<>();
124+
String httpEndpoint = daprConnectionDetails.getHttpEndpoint();
125+
126+
if (httpEndpoint != null) {
127+
propertyOverrides.put(Properties.HTTP_ENDPOINT.getName(), httpEndpoint);
101128
}
102-
propertyOverrides.put(Properties.GRPC_ENDPOINT.getName(), daprConnectionDetails.grpcEndpoint());
103-
if (daprConnectionDetails.grpcPort() != null) {
104-
propertyOverrides.put(Properties.GRPC_PORT.getName(), String.valueOf(daprConnectionDetails.grpcPort()));
129+
130+
Integer httpPort = daprConnectionDetails.getHttpPort();
131+
132+
if (httpPort != null) {
133+
propertyOverrides.put(Properties.HTTP_PORT.getName(), String.valueOf(httpPort));
105134
}
106-
return new Properties(propertyOverrides);
107-
}
108135

136+
String grpcEndpoint = daprConnectionDetails.getGrpcEndpoint();
137+
138+
if (grpcEndpoint != null) {
139+
propertyOverrides.put(Properties.GRPC_ENDPOINT.getName(), grpcEndpoint);
140+
}
109141

142+
Integer grpcPort = daprConnectionDetails.getGrpcPort();
143+
144+
if (grpcPort != null) {
145+
propertyOverrides.put(Properties.GRPC_PORT.getName(), String.valueOf(grpcPort));
146+
}
147+
148+
return new Properties(propertyOverrides);
149+
}
110150

111151
}

dapr-spring/dapr-spring-boot-autoconfigure/src/main/java/io/dapr/spring/boot/autoconfigure/client/DaprConnectionDetails.java

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,13 @@
1616
import org.springframework.boot.autoconfigure.service.connection.ConnectionDetails;
1717

1818
public interface DaprConnectionDetails extends ConnectionDetails {
19-
String httpEndpoint();
2019

21-
String grpcEndpoint();
20+
String getHttpEndpoint();
2221

23-
Integer httpPort();
22+
String getGrpcEndpoint();
23+
24+
Integer getHttpPort();
25+
26+
Integer getGrpcPort();
2427

25-
Integer grpcPort();
2628
}

0 commit comments

Comments
 (0)