Skip to content

Commit 35b1c92

Browse files
cicoyleartursouza
andauthored
[1.14] Cherrypick into release (#1240)
* Remove duplicate workflow build for pushes to master branch. (#1237) Signed-off-by: Artur Souza <[email protected]> Signed-off-by: Cassandra Coyle <[email protected]> * DaprBot pushing tag or to branch already triggers build. (#1238) Signed-off-by: Artur Souza <[email protected]> Signed-off-by: Cassandra Coyle <[email protected]> * fix release Signed-off-by: Cassandra Coyle <[email protected]> * remove springboot v3.2.6 and use dapr-sdk-parent version Signed-off-by: Cassandra Coyle <[email protected]> * fix orphaned channel Signed-off-by: Cassandra Coyle <[email protected]> --------- Signed-off-by: Artur Souza <[email protected]> Signed-off-by: Cassandra Coyle <[email protected]> Co-authored-by: Artur Souza <[email protected]>
1 parent 0b757ec commit 35b1c92

File tree

5 files changed

+33
-60
lines changed

5 files changed

+33
-60
lines changed

.github/workflows/create-release.yml

+4-19
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ jobs:
3232
uses: actions/checkout@v4
3333
with:
3434
fetch-depth: 0
35+
token: ${{ secrets.DAPR_BOT_TOKEN }}
36+
persist-credentials: false
3537
- name: Set up OpenJDK ${{ env.JDK_VER }}
3638
uses: actions/setup-java@v4
3739
with:
@@ -48,24 +50,7 @@ jobs:
4850
git config user.email "[email protected]"
4951
git config user.name "Dapr Bot"
5052
# Update origin with token
51-
git remote set-url origin https://x-access-token:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git
53+
git remote set-url origin https://x-access-token:${{ secrets.DAPR_BOT_TOKEN }}@github.com/${GITHUB_REPOSITORY}.git
5254
# Copy first to allow automation to use the latest version and not the release branch's version.
5355
cp -R ./.github/scripts ${RUNNER_TEMP}/
54-
${RUNNER_TEMP}/scripts/create-release.sh ${{ inputs.rel_version }}
55-
trigger:
56-
name: Triggers the Dapr SDK build
57-
runs-on: ubuntu-latest
58-
needs: create-release
59-
steps:
60-
- name: Identify build ref to trigger build and release.
61-
run: |
62-
if [[ "${{ inputs.rel_version }}" == *"SNAPSHOT"* ]]; then
63-
echo "BUILD_GIT_REF=master" >> $GITHUB_ENV
64-
else
65-
echo "BUILD_GIT_REF=v${{ inputs.rel_version }}" >> $GITHUB_ENV
66-
fi
67-
- name: Triggers the build and release.
68-
env:
69-
GITHUB_TOKEN: ${{ secrets.DAPR_BOT_TOKEN }}
70-
run: |
71-
gh workflow run build.yml --repo ${GITHUB_REPOSITORY} --ref v$(echo '${{ env.BUILD_GIT_REF }}' | sed -r 's/^[vV]?([0-9].+)$/\1/')
56+
${RUNNER_TEMP}/scripts/create-release.sh ${{ inputs.rel_version }}

sdk/src/test/java/io/dapr/client/DaprClientBuilderTest.java

+16-5
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
import io.dapr.exceptions.DaprException;
1919
import io.dapr.serializer.DaprObjectSerializer;
2020
import org.junit.jupiter.api.Test;
21+
import org.junit.jupiter.api.AfterEach;
2122

2223
import static org.junit.jupiter.api.Assertions.assertNotNull;
2324
import static org.junit.jupiter.api.Assertions.assertThrows;
@@ -27,6 +28,16 @@
2728

2829
public class DaprClientBuilderTest {
2930

31+
private DaprClient client;
32+
33+
@AfterEach
34+
public void cleanup() throws Exception {
35+
if (client != null) {
36+
client.close();
37+
client = null;
38+
}
39+
}
40+
3041
@Test
3142
public void build() {
3243
DaprObjectSerializer objectSerializer = mock(DaprObjectSerializer.class);
@@ -35,17 +46,17 @@ public void build() {
3546
DaprClientBuilder daprClientBuilder = new DaprClientBuilder();
3647
daprClientBuilder.withObjectSerializer(objectSerializer);
3748
daprClientBuilder.withStateSerializer(stateSerializer);
38-
DaprClient daprClient = daprClientBuilder.build();
39-
assertNotNull(daprClient);
49+
client = daprClientBuilder.build();
50+
assertNotNull(client);
4051
}
4152

4253
@Test
4354
public void buildWithOverrideSidecarIP() {
4455
DaprClientBuilder daprClientBuilder = new DaprClientBuilder();
4556
daprClientBuilder.withPropertyOverride(Properties.SIDECAR_IP, "unknownhost");
46-
DaprClient daprClient = daprClientBuilder.build();
47-
assertNotNull(daprClient);
48-
DaprException thrown = assertThrows(DaprException.class, () -> { daprClient.getMetadata().block(); });
57+
client = daprClientBuilder.build();
58+
assertNotNull(client);
59+
DaprException thrown = assertThrows(DaprException.class, () -> { client.getMetadata().block(); });
4960
assertTrue(thrown.toString().contains("UNAVAILABLE"), thrown.toString());
5061

5162
}

spring-boot-examples/consumer-app/pom.xml

-17
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,6 @@
1212
<name>consumer-app</name>
1313
<description>Spring Boot, Testcontainers and Dapr Integration Examples :: Consumer App</description>
1414

15-
<properties>
16-
<springboot.version>3.2.6</springboot.version>
17-
</properties>
1815

1916
<dependencyManagement>
2017
<dependencies>
@@ -37,12 +34,6 @@
3734
<groupId>org.springframework.boot</groupId>
3835
<artifactId>spring-boot-starter-actuator</artifactId>
3936
</dependency>
40-
<dependency>
41-
<groupId>io.dapr.spring</groupId>
42-
<artifactId>dapr-spring-boot-starter</artifactId>
43-
<version>${dapr-java-sdk.alpha-version}</version>
44-
</dependency>
45-
4637
<dependency>
4738
<groupId>io.dapr.spring</groupId>
4839
<artifactId>dapr-spring-boot-starter</artifactId>
@@ -93,14 +84,6 @@
9384
<groupId>org.springframework.boot</groupId>
9485
<artifactId>spring-boot-maven-plugin</artifactId>
9586
</plugin>
96-
<plugin>
97-
<groupId>org.apache.maven.plugins</groupId>
98-
<artifactId>maven-deploy-plugin</artifactId>
99-
<version>${maven-deploy-plugin.version}</version>
100-
<configuration>
101-
<skip>true</skip>
102-
</configuration>
103-
</plugin>
10487
<plugin>
10588
<groupId>org.apache.maven.plugins</groupId>
10689
<artifactId>maven-site-plugin</artifactId>

spring-boot-examples/pom.xml

+13-8
Original file line numberDiff line numberDiff line change
@@ -13,21 +13,26 @@
1313
<version>0.14.0-rc-3</version>
1414
<packaging>pom</packaging>
1515

16+
<properties>
17+
<maven.deploy.skip>true</maven.deploy.skip>
18+
</properties>
19+
1620
<modules>
1721
<module>producer-app</module>
1822
<module>consumer-app</module>
1923
</modules>
2024

2125
<build>
26+
<pluginManagement>
27+
<plugins>
28+
<plugin>
29+
<groupId>org.springframework.boot</groupId>
30+
<artifactId>spring-boot-maven-plugin</artifactId>
31+
<version>${springboot.version}</version>
32+
</plugin>
33+
</plugins>
34+
</pluginManagement>
2235
<plugins>
23-
<plugin>
24-
<groupId>org.apache.maven.plugins</groupId>
25-
<artifactId>maven-deploy-plugin</artifactId>
26-
<version>${maven-deploy-plugin.version}</version>
27-
<configuration>
28-
<skip>true</skip>
29-
</configuration>
30-
</plugin>
3136
<plugin>
3237
<groupId>org.apache.maven.plugins</groupId>
3338
<artifactId>maven-site-plugin</artifactId>

spring-boot-examples/producer-app/pom.xml

-11
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,6 @@
1313
<name>producer-app</name>
1414
<description>Spring Boot, Testcontainers and Dapr Integration Examples :: Producer App</description>
1515

16-
<properties>
17-
<springboot.version>3.2.6</springboot.version>
18-
</properties>
1916

2017
<dependencyManagement>
2118
<dependencies>
@@ -80,14 +77,6 @@
8077
<groupId>org.springframework.boot</groupId>
8178
<artifactId>spring-boot-maven-plugin</artifactId>
8279
</plugin>
83-
<plugin>
84-
<groupId>org.apache.maven.plugins</groupId>
85-
<artifactId>maven-deploy-plugin</artifactId>
86-
<version>${maven-deploy-plugin.version}</version>
87-
<configuration>
88-
<skip>true</skip>
89-
</configuration>
90-
</plugin>
9180
<plugin>
9281
<groupId>org.apache.maven.plugins</groupId>
9382
<artifactId>maven-site-plugin</artifactId>

0 commit comments

Comments
 (0)