Skip to content

Commit a8fb3ee

Browse files
authored
perf: Update Spring & Faster Startup and time to test (tolgee#2457)
1 parent 16d764c commit a8fb3ee

File tree

83 files changed

+193
-54
lines changed

Some content is hidden

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

83 files changed

+193
-54
lines changed

.github/workflows/prerelease-alpha.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414

1515
- uses: actions/setup-java@v3
1616
with:
17-
java-version: 17
17+
java-version: 21
1818
distribution: adopt
1919

2020
- name: Setup node

.github/workflows/preview.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616

1717
- uses: actions/setup-java@v3
1818
with:
19-
java-version: 17
19+
java-version: 21
2020
distribution: adopt
2121

2222
- name: Setup node

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818

1919
- uses: actions/setup-java@v3
2020
with:
21-
java-version: 17
21+
java-version: 21
2222
distribution: adopt
2323

2424
- name: Setup node

.github/workflows/reportIntermittentTests.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313

1414
- uses: actions/setup-java@v3
1515
with:
16-
java-version: 17
16+
java-version: 21
1717
distribution: adopt
1818

1919
- name: Setup node
@@ -80,7 +80,7 @@ jobs:
8080

8181
- uses: actions/setup-java@v3
8282
with:
83-
java-version: 17
83+
java-version: 21
8484
distribution: adopt
8585

8686
- name: Setup node
@@ -146,7 +146,7 @@ jobs:
146146

147147
- uses: actions/setup-java@v3
148148
with:
149-
java-version: 17
149+
java-version: 21
150150
distribution: adopt
151151

152152
- name: Setup node
@@ -232,7 +232,7 @@ jobs:
232232

233233
- uses: actions/setup-java@v3
234234
with:
235-
java-version: 17
235+
java-version: 21
236236
distribution: adopt
237237

238238
- name: Cache Gradle packages

.github/workflows/test.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414

1515
- uses: actions/setup-java@v3
1616
with:
17-
java-version: 17
17+
java-version: 21
1818
distribution: adopt
1919

2020
- name: Setup node
@@ -83,7 +83,7 @@ jobs:
8383
- uses: actions/checkout@v3
8484
- uses: actions/setup-java@v3
8585
with:
86-
java-version: 17
86+
java-version: 21
8787
distribution: adopt
8888

8989
- name: Setup node
@@ -122,7 +122,7 @@ jobs:
122122
with:
123123
timeout_minutes: 30
124124
max_attempts: ${{ github.event_name == 'push' && 5 || 1 }}
125-
command: ./gradlew ${{ matrix.command }} -x classes -x compileKotlin -x compileJava
125+
command: ./gradlew ${{ matrix.command }}
126126
env:
127127
SKIP_SERVER_BUILD: true
128128
CI_RELEASE: ${{ github.event_name == 'push' && true || false }}
@@ -163,7 +163,7 @@ jobs:
163163

164164
- uses: actions/setup-java@v3
165165
with:
166-
java-version: 17
166+
java-version: 21
167167
distribution: adopt
168168

169169
- name: Setup node
@@ -269,7 +269,7 @@ jobs:
269269

270270
- uses: actions/setup-java@v3
271271
with:
272-
java-version: 17
272+
java-version: 21
273273
distribution: adopt
274274

275275
- name: Cache Gradle packages
@@ -420,7 +420,7 @@ jobs:
420420

421421
- uses: actions/setup-java@v3
422422
with:
423-
java-version: 17
423+
java-version: 21
424424
distribution: adopt
425425

426426
- name: Setup node

backend/api/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ repositories {
3030
}
3131

3232
kotlin {
33-
jvmToolchain(17)
33+
jvmToolchain(21)
3434
}
3535

3636
allOpen {

backend/api/src/main/kotlin/io/tolgee/websocket/WebSocketConfig.kt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import io.tolgee.security.authentication.JwtService
55
import io.tolgee.security.authentication.TolgeeAuthentication
66
import io.tolgee.service.security.SecurityService
77
import org.springframework.context.annotation.Configuration
8+
import org.springframework.context.annotation.Lazy
89
import org.springframework.messaging.Message
910
import org.springframework.messaging.MessageChannel
1011
import org.springframework.messaging.MessagingException
@@ -21,7 +22,9 @@ import org.springframework.web.socket.config.annotation.WebSocketMessageBrokerCo
2122
@Configuration
2223
@EnableWebSocketMessageBroker
2324
class WebSocketConfig(
25+
@Lazy
2426
private val jwtService: JwtService,
27+
@Lazy
2528
private val securityService: SecurityService,
2629
) : WebSocketMessageBrokerConfigurer {
2730
override fun configureMessageBroker(config: MessageBrokerRegistry) {

backend/app/build.gradle

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ allOpen {
6565
}
6666

6767
kotlin {
68-
jvmToolchain(17)
68+
jvmToolchain(21)
6969
}
7070

7171
dependencies {
@@ -205,23 +205,23 @@ test {
205205
setTestRetry(it)
206206
}
207207

208-
task runContextRecreatingTests(type: Test, group: 'verification') {
208+
tasks.register('runContextRecreatingTests', Test) {
209209
useJUnitPlatform {
210210
includeTags "contextRecreating"
211211
}
212212
maxHeapSize = "4096m"
213213
setTestRetry(it)
214214
}
215215

216-
task runStandardTests(type: Test, group: 'verification') {
216+
tasks.register('runStandardTests', Test) {
217217
useJUnitPlatform {
218218
excludeTags "contextRecreating", "websocket"
219219
}
220220
maxHeapSize = "4096m"
221221
setTestRetry(it)
222222
}
223223

224-
task runWebsocketTests(type: Test, group: 'verification') {
224+
tasks.register('runWebsocketTests', Test) {
225225
useJUnitPlatform {
226226
includeTags "websocket"
227227
}

backend/app/src/main/kotlin/io/tolgee/configuration/WebSecurityConfig.kt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty
2929
import org.springframework.boot.web.servlet.FilterRegistrationBean
3030
import org.springframework.context.annotation.Bean
3131
import org.springframework.context.annotation.Configuration
32+
import org.springframework.context.annotation.Lazy
3233
import org.springframework.core.Ordered
3334
import org.springframework.core.annotation.Order
3435
import org.springframework.security.config.Customizer
@@ -46,12 +47,19 @@ import org.springframework.web.servlet.config.annotation.WebMvcConfigurer
4647
@Configuration
4748
@EnableWebSecurity
4849
class WebSecurityConfig(
50+
@Lazy
4951
private val authenticationFilter: AuthenticationFilter,
52+
@Lazy
5053
private val globalIpRateLimitFilter: GlobalIpRateLimitFilter,
54+
@Lazy
5155
private val globalUserRateLimitFilter: GlobalUserRateLimitFilter,
56+
@Lazy
5257
private val rateLimitInterceptor: RateLimitInterceptor,
58+
@Lazy
5359
private val authenticationInterceptor: AuthenticationInterceptor,
60+
@Lazy
5461
private val organizationAuthorizationInterceptor: OrganizationAuthorizationInterceptor,
62+
@Lazy
5563
private val projectAuthorizationInterceptor: ProjectAuthorizationInterceptor,
5664
private val exceptionHandlerFilter: ExceptionHandlerFilter,
5765
) : WebMvcConfigurer {

backend/data/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ diff.dependsOn compileKotlin
7979
diffChangelog.dependsOn compileKotlin
8080

8181
kotlin {
82-
jvmToolchain(17)
82+
jvmToolchain(21)
8383
}
8484

8585
dependencies {

0 commit comments

Comments
 (0)