Skip to content

Commit c195cd1

Browse files
cretzmjameswh
andauthored
Add Spring Boot 4 support (#2787)
Co-authored-by: James Watkins-Harvey <james.watkinsharvey@temporal.io>
1 parent fcb4e84 commit c195cd1

File tree

11 files changed

+377
-194
lines changed

11 files changed

+377
-194
lines changed

.github/workflows/ci.yml

Lines changed: 169 additions & 157 deletions
Original file line numberDiff line numberDiff line change
@@ -13,181 +13,193 @@ jobs:
1313
runs-on: ubuntu-latest-16-cores
1414
timeout-minutes: 30
1515
steps:
16-
- name: Checkout repo
17-
uses: actions/checkout@v5
18-
with:
19-
fetch-depth: 0
20-
submodules: recursive
21-
ref: ${{ github.event.pull_request.head.sha }}
22-
23-
- name: Set up Java
24-
uses: actions/setup-java@v5
25-
with:
26-
java-version: "23"
27-
distribution: "temurin"
28-
29-
- name: Set up Gradle
30-
uses: gradle/actions/setup-gradle@v5
31-
32-
- name: Run unit tests
33-
env:
34-
USER: unittest
35-
USE_DOCKER_SERVICE: false
36-
run: ./gradlew --no-daemon test -x spotlessCheck -x spotlessApply -x spotlessJava -P edgeDepsTest
37-
38-
- name: Run independent resource tuner test
39-
env:
40-
USER: unittest
41-
USE_DOCKER_SERVICE: false
42-
run: ./gradlew --no-daemon temporal-sdk:testResourceIndependent -x spotlessCheck -x spotlessApply -x spotlessJava -P edgeDepsTest
43-
44-
- name: Publish Test Report
45-
uses: mikepenz/action-junit-report@v6
46-
if: success() || failure() # always run even if the previous step fails
47-
with:
48-
report_paths: '**/build/test-results/test/TEST-*.xml'
16+
- name: Checkout repo
17+
uses: actions/checkout@v5
18+
with:
19+
fetch-depth: 0
20+
submodules: recursive
21+
ref: ${{ github.event.pull_request.head.sha }}
22+
23+
- name: Set up Java
24+
uses: actions/setup-java@v5
25+
with:
26+
java-version: "23"
27+
distribution: "temurin"
28+
29+
- name: Set up Gradle
30+
uses: gradle/actions/setup-gradle@v5
31+
32+
- name: Run unit tests
33+
env:
34+
USER: unittest
35+
USE_DOCKER_SERVICE: false
36+
run: ./gradlew --no-daemon test -x spotlessCheck -x spotlessApply -x spotlessJava -P edgeDepsTest
37+
38+
- name: Run independent resource tuner test
39+
env:
40+
USER: unittest
41+
USE_DOCKER_SERVICE: false
42+
run: ./gradlew --no-daemon temporal-sdk:testResourceIndependent -x spotlessCheck -x spotlessApply -x spotlessJava -P edgeDepsTest
43+
44+
- name: Run Spring Boot 3 compatibility tests
45+
env:
46+
USER: unittest
47+
USE_DOCKER_SERVICE: false
48+
run: ./gradlew --no-daemon :temporal-spring-boot-autoconfigure:test -x spotlessCheck -x spotlessApply -x spotlessJava -P edgeDepsTest -P springBoot3Test
49+
50+
- name: Run Spring Boot 4 compatibility tests
51+
env:
52+
USER: unittest
53+
USE_DOCKER_SERVICE: false
54+
run: ./gradlew --no-daemon :temporal-spring-boot-autoconfigure:test -x spotlessCheck -x spotlessApply -x spotlessJava -P edgeDepsTest -P springBoot4Test
55+
56+
- name: Publish Test Report
57+
uses: mikepenz/action-junit-report@v6
58+
if: success() || failure() # always run even if the previous step fails
59+
with:
60+
report_paths: "**/build/test-results/test/TEST-*.xml"
4961

5062
unit_test_jdk8:
5163
name: Unit test with docker service [JDK8]
5264
runs-on: ubuntu-latest-16-cores
5365
timeout-minutes: 30
5466
steps:
55-
- name: Checkout repo
56-
uses: actions/checkout@v5
57-
with:
58-
fetch-depth: 0
59-
submodules: recursive
60-
ref: ${{ github.event.pull_request.head.sha }}
61-
62-
- name: Set up Java
63-
uses: actions/setup-java@v5
64-
with:
65-
java-version: |
66-
23
67-
11
68-
distribution: "temurin"
69-
70-
- name: Set up Gradle
71-
uses: gradle/actions/setup-gradle@v5
72-
73-
- name: Start containerized server and dependencies
74-
env:
75-
TEMPORAL_CLI_VERSION: 1.6.1-server-1.31.0-151.0
76-
run: |
77-
wget -O temporal_cli.tar.gz https://github.com/temporalio/cli/releases/download/v${TEMPORAL_CLI_VERSION}/temporal_cli_${TEMPORAL_CLI_VERSION}_linux_amd64.tar.gz
78-
tar -xzf temporal_cli.tar.gz
79-
chmod +x temporal
80-
./temporal server start-dev \
81-
--headless \
82-
--port 7233 \
83-
--http-port 7243 \
84-
--namespace UnitTest \
85-
--db-filename temporal.sqlite \
86-
--sqlite-pragma journal_mode=WAL \
87-
--sqlite-pragma synchronous=OFF \
88-
--search-attribute CustomKeywordField=Keyword \
89-
--search-attribute CustomStringField=Text \
90-
--search-attribute CustomTextField=Text \
91-
--search-attribute CustomIntField=Int \
92-
--search-attribute CustomDatetimeField=Datetime \
93-
--search-attribute CustomDoubleField=Double \
94-
--search-attribute CustomBoolField=Bool \
95-
--dynamic-config-value system.enableActivityEagerExecution=true \
96-
--dynamic-config-value history.MaxBufferedQueryCount=10000 \
97-
--dynamic-config-value frontend.workerVersioningDataAPIs=true \
98-
--dynamic-config-value history.enableRequestIdRefLinks=true \
99-
--dynamic-config-value 'component.callbacks.allowedAddresses=[{"Pattern":"localhost:7243","AllowInsecure":true}]' &
100-
sleep 10s
101-
102-
- name: Run unit tests
103-
env:
104-
USER: unittest
105-
TEMPORAL_SERVICE_ADDRESS: localhost:7233
106-
USE_DOCKER_SERVICE: true
107-
run: ./gradlew --no-daemon test -x spotlessCheck -x spotlessApply -x spotlessJava
108-
109-
- name: Run Jackson 3 converter tests
110-
env:
111-
USER: unittest
112-
USE_DOCKER_SERVICE: false
113-
run: ./gradlew --no-daemon :temporal-sdk:jackson3Tests -x spotlessCheck -x spotlessApply -x spotlessJava
114-
115-
- name: Run virtual thread tests
116-
env:
117-
USER: unittest
118-
TEMPORAL_SERVICE_ADDRESS: localhost:7233
119-
USE_DOCKER_SERVICE: true
120-
run: ./gradlew --no-daemon :temporal-sdk:virtualThreadTests -x spotlessCheck -x spotlessApply -x spotlessJava
121-
122-
- name: Publish Test Report
123-
uses: mikepenz/action-junit-report@v6
124-
if: success() || failure() # always run even if the previous step fails
125-
with:
126-
report_paths: '**/build/test-results/test/TEST-*.xml'
67+
- name: Checkout repo
68+
uses: actions/checkout@v5
69+
with:
70+
fetch-depth: 0
71+
submodules: recursive
72+
ref: ${{ github.event.pull_request.head.sha }}
73+
74+
- name: Set up Java
75+
uses: actions/setup-java@v5
76+
with:
77+
java-version: |
78+
23
79+
11
80+
distribution: "temurin"
81+
82+
- name: Set up Gradle
83+
uses: gradle/actions/setup-gradle@v5
84+
85+
- name: Start containerized server and dependencies
86+
env:
87+
TEMPORAL_CLI_VERSION: 1.6.1-server-1.31.0-151.0
88+
run: |
89+
wget -O temporal_cli.tar.gz https://github.com/temporalio/cli/releases/download/v${TEMPORAL_CLI_VERSION}/temporal_cli_${TEMPORAL_CLI_VERSION}_linux_amd64.tar.gz
90+
tar -xzf temporal_cli.tar.gz
91+
chmod +x temporal
92+
./temporal server start-dev \
93+
--headless \
94+
--port 7233 \
95+
--http-port 7243 \
96+
--namespace UnitTest \
97+
--db-filename temporal.sqlite \
98+
--sqlite-pragma journal_mode=WAL \
99+
--sqlite-pragma synchronous=OFF \
100+
--search-attribute CustomKeywordField=Keyword \
101+
--search-attribute CustomStringField=Text \
102+
--search-attribute CustomTextField=Text \
103+
--search-attribute CustomIntField=Int \
104+
--search-attribute CustomDatetimeField=Datetime \
105+
--search-attribute CustomDoubleField=Double \
106+
--search-attribute CustomBoolField=Bool \
107+
--dynamic-config-value system.enableActivityEagerExecution=true \
108+
--dynamic-config-value history.MaxBufferedQueryCount=10000 \
109+
--dynamic-config-value frontend.workerVersioningDataAPIs=true \
110+
--dynamic-config-value history.enableRequestIdRefLinks=true \
111+
--dynamic-config-value 'component.callbacks.allowedAddresses=[{"Pattern":"localhost:7243","AllowInsecure":true}]' &
112+
sleep 10s
113+
114+
- name: Run unit tests
115+
env:
116+
USER: unittest
117+
TEMPORAL_SERVICE_ADDRESS: localhost:7233
118+
USE_DOCKER_SERVICE: true
119+
run: ./gradlew --no-daemon test -x spotlessCheck -x spotlessApply -x spotlessJava
120+
121+
- name: Run Jackson 3 converter tests
122+
env:
123+
USER: unittest
124+
USE_DOCKER_SERVICE: false
125+
run: ./gradlew --no-daemon :temporal-sdk:jackson3Tests -x spotlessCheck -x spotlessApply -x spotlessJava
126+
127+
- name: Run virtual thread tests
128+
env:
129+
USER: unittest
130+
TEMPORAL_SERVICE_ADDRESS: localhost:7233
131+
USE_DOCKER_SERVICE: true
132+
run: ./gradlew --no-daemon :temporal-sdk:virtualThreadTests -x spotlessCheck -x spotlessApply -x spotlessJava
133+
134+
- name: Publish Test Report
135+
uses: mikepenz/action-junit-report@v6
136+
if: success() || failure() # always run even if the previous step fails
137+
with:
138+
report_paths: "**/build/test-results/test/TEST-*.xml"
127139

128140
unit_test_cloud:
129141
name: Unit test with cloud
130142
runs-on: ubuntu-latest
131143
timeout-minutes: 30
132144
steps:
133-
- name: Checkout repo
134-
uses: actions/checkout@v5
135-
with:
136-
fetch-depth: 0
137-
submodules: recursive
138-
ref: ${{ github.event.pull_request.head.sha }}
139-
140-
- name: Set up Java
141-
uses: actions/setup-java@v5
142-
with:
143-
java-version: "11"
144-
distribution: "temurin"
145-
146-
- name: Set up Gradle
147-
uses: gradle/actions/setup-gradle@v5
148-
149-
- name: Run cloud test
150-
# Only supported in non-fork runs, since secrets are not available in forks. We intentionally
151-
# are only doing this check on the step instead of the job so we require job passing in CI
152-
# even for those that can't run this step.
153-
if: ${{ github.event.pull_request.head.repo.full_name == '' || github.event.pull_request.head.repo.full_name == 'temporalio/sdk-java' }}
154-
env:
155-
USER: unittest
156-
TEMPORAL_CLIENT_CLOUD_NAMESPACE: sdk-ci.a2dd6
157-
TEMPORAL_CLIENT_CLOUD_API_KEY: ${{ secrets.TEMPORAL_CLIENT_CLOUD_API_KEY }}
158-
TEMPORAL_CLIENT_CLOUD_API_VERSION: 2024-05-13-00
159-
run: ./gradlew --no-daemon :temporal-sdk:test --tests '*CloudOperationsClientTest'
160-
161-
- name: Publish Test Report
162-
uses: mikepenz/action-junit-report@v6
163-
if: success() || failure() # always run even if the previous step fails
164-
with:
165-
report_paths: '**/build/test-results/test/TEST-*.xml'
145+
- name: Checkout repo
146+
uses: actions/checkout@v5
147+
with:
148+
fetch-depth: 0
149+
submodules: recursive
150+
ref: ${{ github.event.pull_request.head.sha }}
151+
152+
- name: Set up Java
153+
uses: actions/setup-java@v5
154+
with:
155+
java-version: "11"
156+
distribution: "temurin"
157+
158+
- name: Set up Gradle
159+
uses: gradle/actions/setup-gradle@v5
160+
161+
- name: Run cloud test
162+
# Only supported in non-fork runs, since secrets are not available in forks. We intentionally
163+
# are only doing this check on the step instead of the job so we require job passing in CI
164+
# even for those that can't run this step.
165+
if: ${{ github.event.pull_request.head.repo.full_name == '' || github.event.pull_request.head.repo.full_name == 'temporalio/sdk-java' }}
166+
env:
167+
USER: unittest
168+
TEMPORAL_CLIENT_CLOUD_NAMESPACE: sdk-ci.a2dd6
169+
TEMPORAL_CLIENT_CLOUD_API_KEY: ${{ secrets.TEMPORAL_CLIENT_CLOUD_API_KEY }}
170+
TEMPORAL_CLIENT_CLOUD_API_VERSION: 2024-05-13-00
171+
run: ./gradlew --no-daemon :temporal-sdk:test --tests '*CloudOperationsClientTest'
172+
173+
- name: Publish Test Report
174+
uses: mikepenz/action-junit-report@v6
175+
if: success() || failure() # always run even if the previous step fails
176+
with:
177+
report_paths: "**/build/test-results/test/TEST-*.xml"
166178

167179
code_format:
168180
name: Code format
169181
runs-on: ubuntu-latest
170182
timeout-minutes: 20
171183
steps:
172-
- name: Checkout repo
173-
uses: actions/checkout@v5
174-
with:
175-
fetch-depth: 0
176-
submodules: recursive
177-
ref: ${{ github.event.pull_request.head.sha }}
178-
179-
- name: Set up Java
180-
uses: actions/setup-java@v5
181-
with:
182-
java-version: "11"
183-
distribution: "temurin"
184-
185-
- name: Set up Gradle
186-
uses: gradle/actions/setup-gradle@v5
187-
188-
- name: Run copyright and code format checks
189-
run: ./gradlew --no-daemon spotlessCheck
190-
184+
- name: Checkout repo
185+
uses: actions/checkout@v5
186+
with:
187+
fetch-depth: 0
188+
submodules: recursive
189+
ref: ${{ github.event.pull_request.head.sha }}
190+
191+
- name: Set up Java
192+
uses: actions/setup-java@v5
193+
with:
194+
java-version: "11"
195+
distribution: "temurin"
196+
197+
- name: Set up Gradle
198+
uses: gradle/actions/setup-gradle@v5
199+
200+
- name: Run copyright and code format checks
201+
run: ./gradlew --no-daemon spotlessCheck
202+
191203
build_native_images:
192204
name: Build native test server
193205
uses: ./.github/workflows/build-native-image.yml

build.gradle

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,16 @@ ext {
5555

5656
cronUtilsVersion = '9.2.1' // for test server only
5757

58-
// Spring Boot 3 requires Java 17, java-sdk builds against 2.x version because we support Java 8.
59-
// We do test compatibility with Spring Boot 3 in integration tests.
60-
springBootVersion = project.hasProperty("edgeDepsTest") ? '3.1.12' : '2.7.18'// [2.4.0,)
58+
// This is the version of Spring Boot we use to _build the SDK_. This has to be in the
59+
// range [2.7.0, 3.2.0) at this time, because `@ConstructorBinding` changed path in SB 3.2.0.
60+
springBootVersion = '2.7.18' // [2.7.0, 3.2.0)
61+
62+
// These are the version of Spring Boot we use to test the Spring Boot integration in various
63+
// scenarios. SB 3 and 4 require Java 17, and can therefore only be tested with 'edgeDepsTest'
64+
// enabled. SB 2.x runs on Java 8, and can be tested with or without 'edgeDepsTest' enabled.
65+
springBoot2Version = '2.7.18' // [2.7.0,)
66+
springBoot3Version = '3.5.12' // [3.1.0,)
67+
springBoot4Version = '4.0.2' // [4.0.0,)
6168

6269
// test scoped
6370
// we don't upgrade to 1.3 and 1.4 because they require slf4j 2.x

gradle/versioning.gradle

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,6 @@ group = 'io.temporal'
5555
version = getVersionName()
5656

5757
subprojects {
58-
apply plugin: "com.palantir.git-version"
59-
6058
group = 'io.temporal'
6159
version = getVersionName()
6260
}

0 commit comments

Comments
 (0)