Skip to content

Commit 29eac2e

Browse files
committed
Merge branch 'master' of https://github.com/siri-varma/java-sdk
2 parents c30f537 + a159db2 commit 29eac2e

File tree

121 files changed

+2401
-226
lines changed

Some content is hidden

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

121 files changed

+2401
-226
lines changed

CONTRIBUTING.md

Lines changed: 42 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,48 @@ This section describes the guidelines for contributing code / docs to Dapr.
5454
### Things to consider when adding new API to SDK
5555

5656
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. [Example](https://github.com/dapr/java-sdk/pull/1235/files#diff-69ed756c4c01fd5fa884aac030dccb8f3f4d4fefa0dc330862d55a6f87b34a14)
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+
```
5899

59100
### Pull Requests
60101

checkstyle.xml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@
112112
<module name="ModifierOrder"/>
113113
<module name="EmptyLineSeparator">
114114
<property name="allowNoEmptyLineBetweenFields" value="true"/>
115+
<property name="allowMultipleEmptyLines" value="false"/>
115116
</module>
116117
<module name="SeparatorWrap">
117118
<property name="id" value="SeparatorWrapDot"/>
@@ -287,4 +288,13 @@
287288
<module name="SuppressWarningsHolder"/>
288289
</module>
289290
<module name="SuppressWarningsFilter"/>
291+
<module name="RegexpHeader">
292+
<property name="headerFile" value="${checkstyle.header.file}"/>
293+
<property name="fileExtensions" value="java,xml"/>
294+
</module>
295+
<module name="SuppressionSingleFilter">
296+
<property name="checks" value="RegexpHeader"/>
297+
<property name="files" value=".*\.properties$"/>
298+
</module>
299+
<module name="NewlineAtEndOfFile"/>
290300
</module>

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

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -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>

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ public class DaprClientProperties {
2323
private Integer httpPort;
2424
private Integer grpcPort;
2525

26-
2726
/**
2827
* Constructs a {@link DaprClientProperties}.
2928
*/

dapr-spring/dapr-spring-boot-autoconfigure/src/main/java/io/dapr/spring/boot/autoconfigure/pubsub/DaprPubSubProperties.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515

1616
import org.springframework.boot.context.properties.ConfigurationProperties;
1717

18-
1918
@ConfigurationProperties(prefix = DaprPubSubProperties.CONFIG_PREFIX)
2019
public class DaprPubSubProperties {
2120

dapr-spring/dapr-spring-boot-starters/dapr-spring-boot-starter-test/pom.xml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,10 @@
2323
<dependency>
2424
<groupId>io.dapr.spring</groupId>
2525
<artifactId>dapr-spring-boot-tests</artifactId>
26-
<version>${project.parent.version}</version>
2726
</dependency>
2827
<dependency>
2928
<groupId>io.dapr</groupId>
3029
<artifactId>testcontainers-dapr</artifactId>
31-
<version>${project.parent.version}</version>
3230
</dependency>
3331
<dependency>
3432
<groupId>org.springframework.boot</groupId>

dapr-spring/dapr-spring-boot-starters/dapr-spring-boot-starter/pom.xml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,27 +23,22 @@
2323
<dependency>
2424
<groupId>io.dapr</groupId>
2525
<artifactId>dapr-sdk-springboot</artifactId>
26-
<version>${dapr.sdk.version}</version>
2726
</dependency>
2827
<dependency>
2928
<groupId>io.dapr.spring</groupId>
3029
<artifactId>dapr-spring-boot-autoconfigure</artifactId>
31-
<version>${project.parent.version}</version>
3230
</dependency>
3331
<dependency>
3432
<groupId>io.dapr.spring</groupId>
3533
<artifactId>dapr-spring-data</artifactId>
36-
<version>${project.parent.version}</version>
3734
</dependency>
3835
<dependency>
3936
<groupId>io.dapr.spring</groupId>
4037
<artifactId>dapr-spring-messaging</artifactId>
41-
<version>${project.parent.version}</version>
4238
</dependency>
4339
<dependency>
4440
<groupId>io.dapr.spring</groupId>
4541
<artifactId>dapr-spring-workflows</artifactId>
46-
<version>${project.parent.version}</version>
4742
</dependency>
4843
</dependencies>
4944

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
<dependency>
2323
<groupId>io.dapr.spring</groupId>
2424
<artifactId>dapr-spring-boot-autoconfigure</artifactId>
25-
<version>${project.parent.version}</version>
2625
</dependency>
2726
<dependency>
2827
<groupId>org.testcontainers</groupId>
@@ -38,7 +37,6 @@
3837
<dependency>
3938
<groupId>io.dapr</groupId>
4039
<artifactId>testcontainers-dapr</artifactId>
41-
<version>${dapr.sdk.alpha.version}</version>
4240
</dependency>
4341
</dependencies>
4442
<build>

dapr-spring/dapr-spring-boot-tests/src/main/java/io/dapr/spring/boot/testcontainers/service/connection/DaprContainerConnectionDetailsFactory.java

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,16 @@
1+
/*
2+
* Copyright 2021 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+
114
package io.dapr.spring.boot.testcontainers.service.connection;
215

316
import io.dapr.spring.boot.autoconfigure.client.DaprConnectionDetails;

dapr-spring/dapr-spring-data/pom.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@
1919
<groupId>org.springframework.data</groupId>
2020
<artifactId>spring-data-keyvalue</artifactId>
2121
</dependency>
22+
<dependency>
23+
<groupId>io.dapr</groupId>
24+
<artifactId>dapr-sdk</artifactId>
25+
</dependency>
2226
</dependencies>
2327

2428
<build>

0 commit comments

Comments
 (0)