Skip to content

Commit 689078b

Browse files
authored
Spring boot 3.1.2 (#398)
* upgrade to java 17/kotlin 1.9.0 * upgrade gradle to 8.3 * replace embedded-consul with testcontainers * upgrade Spring Boot to 3.1.2 * change EchoContainer image to fix tests on arm * fix ports generation * replace deprecated WebSecurityConfigurerAdapter in ChaosController * move jackson module config to separate file * fix bad config test * remove deprecated configuration from SynchronizationConfig * update CHANGELOG.md * disable spring boot plugin while keeping dependency management * separate workflow for flaky tests * do not free generated ports * update docker files * fix security configuration
1 parent 2f820d6 commit 689078b

File tree

45 files changed

+505
-315
lines changed

Some content is hidden

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

45 files changed

+505
-315
lines changed

.github/workflows/ci.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ jobs:
3636
- uses: actions/setup-java@v3
3737
with:
3838
distribution: 'temurin'
39-
java-version: '11'
39+
java-version: '17'
4040

4141
- name: Cache Gradle packages
4242
uses: actions/cache@v2

.github/workflows/flaky.yaml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: Flaky tests
2+
3+
on:
4+
workflow_dispatch:
5+
6+
push:
7+
paths-ignore:
8+
- 'readme.md'
9+
10+
jobs:
11+
flaky_test:
12+
name: flaky_test
13+
runs-on: ubuntu-latest
14+
env:
15+
GRADLE_OPTS: '-Dfile.encoding=utf-8 -Dorg.gradle.daemon=false'
16+
17+
steps:
18+
- uses: actions/checkout@v3
19+
with:
20+
fetch-depth: 0
21+
ref: ${{ github.head_ref }}
22+
23+
- uses: gradle/wrapper-validation-action@v1
24+
25+
- uses: actions/setup-java@v3
26+
with:
27+
distribution: 'temurin'
28+
java-version: '17'
29+
30+
- name: Cache Gradle packages
31+
uses: actions/cache@v3
32+
with:
33+
path: |
34+
~/.gradle/caches
35+
~/.gradle/wrapper
36+
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
37+
restore-keys: |
38+
${{ runner.os }}-gradle-
39+
40+
- name: Flaky tests
41+
run: ./gradlew clean -Penvironment=integration :envoy-control-tests:flakyTest
42+
43+
- name: Junit report
44+
uses: mikepenz/action-junit-report@v2
45+
if: always()
46+
with:
47+
report_paths: '**/build/test-results/test/TEST-*.xml'
48+
49+
- name: Cleanup Gradle Cache
50+
run: |
51+
rm -f ~/.gradle/caches/modules-2/modules-2.lock
52+
rm -f ~/.gradle/caches/modules-2/gc.properties

.github/workflows/publish.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@ jobs:
2121
with:
2222
fetch-depth: 0
2323
- uses: gradle/wrapper-validation-action@v1
24-
- name: Set up JDK 11
24+
- name: Set up JDK 17
2525
uses: actions/setup-java@v3
2626
with:
2727
distribution: 'temurin'
28-
java-version: '11'
28+
java-version: '17'
2929
- name: Release
3030
if: github.ref == 'refs/heads/master'
3131
run: ./gradlew release -Prelease.customPassword=${GITHUB_TOKEN} -Prelease.customUsername=${GITHUB_ACTOR} -Prelease.forceVersion=${FORCE_VERSION}

.github/workflows/resilence.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
- uses: actions/setup-java@v3
2626
with:
2727
distribution: 'temurin'
28-
java-version: '11'
28+
java-version: '17'
2929

3030
- name: Cache Gradle packages
3131
uses: actions/cache@v3

CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,16 @@
22

33
Lists all changes with user impact.
44
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
5+
## [0.20.00]
6+
7+
### Changed
8+
- Spring Boot upgraded to 3.1.2
9+
- Java upgraded to 17
10+
- Kotlin upgraded to 1.8.2
11+
- Gradle upgraded to 8.3
12+
13+
### Fixed
14+
- Random port generation for testcontainers
515

616
## [0.19.36]
717

build.gradle

Lines changed: 23 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,14 @@ plugins {
1212
id 'signing'
1313

1414
id 'pl.allegro.tech.build.axion-release' version '1.13.3'
15-
id 'org.jetbrains.kotlin.jvm' version '1.6.10'
16-
id 'org.jetbrains.kotlin.plugin.spring' version '1.6.10'
17-
id 'org.jetbrains.kotlin.plugin.allopen' version '1.6.10'
15+
id 'org.jetbrains.kotlin.jvm' version '1.8.22'
16+
id 'org.jetbrains.kotlin.plugin.spring' version '1.8.22'
17+
id 'org.jetbrains.kotlin.plugin.allopen' version '1.8.22'
1818
id "org.jlleitschuh.gradle.ktlint" version "10.2.1"
1919
id "org.jlleitschuh.gradle.ktlint-idea" version "10.2.0"
2020
id "io.gitlab.arturbosch.detekt" version "1.18.0"
2121
id 'io.github.gradle-nexus.publish-plugin' version '1.0.0'
22+
id 'org.springframework.boot' version '3.1.2' apply false
2223

2324
}
2425

@@ -44,34 +45,25 @@ allprojects {
4445

4546
apply plugin: 'kotlin'
4647
apply plugin: 'kotlin-spring'
48+
apply plugin: 'io.spring.dependency-management'
4749

4850
project.ext.versions = [
49-
kotlin : '1.6.10',
5051
java_controlplane : '1.0.37',
51-
spring_boot : '2.3.4.RELEASE',
52+
spring_boot : '3.1.2',
5253
grpc : '1.48.1',
53-
jaxb : '2.3.1',
54-
javaxactivation : '1.2.0',
55-
micrometer : '1.5.5',
56-
dropwizard : '4.1.12.1',
5754
ecwid_consul : '1.4.1',
58-
awaitility : '4.0.3',
59-
embedded_consul : '2.0.0',
60-
junit : '5.6.2',
61-
assertj : '3.17.2',
62-
jackson : '2.11.2',
6355
toxiproxy : '2.1.3',
64-
testcontainers : '1.16.0',
65-
reactor : '3.3.10.RELEASE',
6656
consul_recipes : '0.9.1',
67-
mockito : '3.3.3',
6857
cglib : '3.2.9',
69-
logback : '1.2.3',
70-
slf4j : '1.7.30',
7158
re2j : '1.3',
7259
xxhash : '0.10.1',
73-
okhttp : '4.9.0'
7460
]
61+
62+
dependencyManagement {
63+
imports {
64+
mavenBom org.springframework.boot.gradle.plugin.SpringBootPlugin.BOM_COORDINATES
65+
}
66+
}
7567
}
7668

7769

@@ -91,7 +83,6 @@ subprojects {
9183
apply plugin: 'io.gitlab.arturbosch.detekt'
9284
apply plugin: 'signing'
9385

94-
sourceCompatibility = JavaVersion.VERSION_11
9586
[compileJava, compileTestJava]*.options*.encoding = 'UTF-8'
9687

9788
ktlint {
@@ -167,23 +158,22 @@ subprojects {
167158
compile.exclude group: 'log4j', module: 'log4j'
168159
}
169160

170-
compileKotlin {
171-
kotlinOptions {
172-
jvmTarget = '11'
161+
java {
162+
toolchain {
163+
languageVersion.set(JavaLanguageVersion.of(17))
173164
}
174165
}
175166

176-
compileTestKotlin {
177-
kotlinOptions {
178-
jvmTarget = '11'
167+
kotlin {
168+
jvmToolchain {
169+
languageVersion.set(JavaLanguageVersion.of(17))
179170
}
180171
}
181-
182172
dependencies {
183-
testImplementation group: 'org.junit.jupiter', name: 'junit-jupiter-api', version: versions.junit
184-
testImplementation group: 'org.junit.jupiter', name: 'junit-jupiter-params', version: versions.junit
185-
testImplementation group: 'org.assertj', name: 'assertj-core', version: versions.assertj
186-
testRuntimeOnly group: 'org.junit.jupiter', name: 'junit-jupiter-engine', version: versions.junit
173+
testImplementation group: 'org.junit.jupiter', name: 'junit-jupiter-api'
174+
testImplementation group: 'org.junit.jupiter', name: 'junit-jupiter-params'
175+
testImplementation group: 'org.assertj', name: 'assertj-core'
176+
testRuntimeOnly group: 'org.junit.jupiter', name: 'junit-jupiter-engine'
187177
}
188178

189179
detekt {
@@ -195,5 +185,5 @@ subprojects {
195185
}
196186

197187
wrapper {
198-
gradleVersion = '7.1.1'
188+
gradleVersion = '8.3'
199189
}

docs/development.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ Envoy Control is a [Kotlin](https://kotlinlang.org/) application, it requires JD
1616
```./gradlew integrationTest```
1717
* Reliability tests
1818
```./gradlew clean -i -Penvironment=integration :envoy-control-tests:reliabilityTest -DRELIABILITY_FAILURE_DURATION_SECONDS=20```
19+
* Flaky tests
20+
```./gradlew -Penvironment=integration :envoy-control-tests:flakyTest```
1921

2022
## Running Lua tests locally (not inside docker) for debugging purposes
2123

envoy-control-core/build.gradle

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,36 @@
1+
plugins {
2+
id 'org.springframework.boot' apply false
3+
}
4+
15
dependencies {
26
api project(':envoy-control-services')
37

4-
implementation group: 'org.jetbrains.kotlin', name: 'kotlin-stdlib', version: versions.kotlin
5-
implementation group: 'org.jetbrains.kotlin', name: 'kotlin-stdlib-jdk8', version: versions.kotlin
6-
api group: 'com.fasterxml.jackson.module', name: 'jackson-module-afterburner', version: versions.jackson
7-
api group: 'com.fasterxml.jackson.module', name: 'jackson-module-kotlin', version: versions.jackson
8-
implementation group: 'org.jetbrains.kotlin', name: 'kotlin-reflect', version: versions.kotlin
9-
api group: 'io.dropwizard.metrics', name: 'metrics-core', version: versions.dropwizard
10-
api group: 'io.micrometer', name: 'micrometer-core', version: versions.micrometer
8+
implementation group: 'org.jetbrains.kotlin', name: 'kotlin-stdlib'
9+
api group: 'com.fasterxml.jackson.module', name: 'jackson-module-afterburner'
10+
api group: 'com.fasterxml.jackson.module', name: 'jackson-module-kotlin'
11+
implementation group: 'org.jetbrains.kotlin', name: 'kotlin-reflect'
12+
api group: 'io.dropwizard.metrics', name: 'metrics-core'
13+
api group: 'io.micrometer', name: 'micrometer-core'
1114
implementation group: 'com.google.re2j', name: 're2j', version: versions.re2j
1215

1316
api group: 'io.envoyproxy.controlplane', name: 'server', version: versions.java_controlplane
1417

1518
implementation group: 'io.grpc', name: 'grpc-netty', version: versions.grpc
1619

17-
implementation group: 'io.projectreactor', name: 'reactor-core', version: versions.reactor
20+
implementation group: 'io.projectreactor', name: 'reactor-core'
1821

19-
implementation group: 'org.slf4j', name: 'jcl-over-slf4j', version: versions.slf4j
20-
implementation group: 'ch.qos.logback', name: 'logback-classic', version: versions.logback
22+
implementation group: 'org.slf4j', name: 'jcl-over-slf4j'
23+
implementation group: 'ch.qos.logback', name: 'logback-classic'
2124

2225
testImplementation group: 'io.grpc', name: 'grpc-testing', version: versions.grpc
23-
testImplementation group: 'io.projectreactor', name: 'reactor-test', version: versions.reactor
24-
testImplementation group: 'org.mockito', name: 'mockito-core', version: versions.mockito
26+
testImplementation group: 'io.projectreactor', name: 'reactor-test'
27+
testImplementation group: 'org.mockito', name: 'mockito-core'
2528
testImplementation group: 'cglib', name: 'cglib-nodep', version: versions.cglib
2629

27-
testImplementation group: 'org.awaitility', name: 'awaitility', version: versions.awaitility
30+
testImplementation group: 'org.awaitility', name: 'awaitility'
2831

29-
testImplementation group: 'org.testcontainers', name: 'testcontainers', version: versions.testcontainers
30-
testImplementation group: 'org.testcontainers', name: 'junit-jupiter', version: versions.testcontainers
32+
testImplementation group: 'org.testcontainers', name: 'testcontainers'
33+
testImplementation group: 'org.testcontainers', name: 'junit-jupiter'
3134
}
3235

3336
tasks.withType(GroovyCompile) {

envoy-control-core/src/main/kotlin/pl/allegro/tech/servicemesh/envoycontrol/snapshot/SnapshotUpdater.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ class SnapshotUpdater(
150150
private fun updateSnapshotForGroup(group: Group, globalSnapshot: GlobalSnapshot) {
151151
try {
152152
val groupSnapshot = snapshotFactory.getSnapshotForGroup(group, globalSnapshot)
153-
snapshotTimer(group.serviceName).record {
153+
snapshotTimer(group.serviceName).recordCallable {
154154
cache.setSnapshot(group, groupSnapshot)
155155
}
156156
} catch (e: Throwable) {

envoy-control-core/src/main/kotlin/pl/allegro/tech/servicemesh/envoycontrol/synchronization/GlobalStateChanges.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@ class GlobalStateChanges(
1515
private val meterRegistry: MeterRegistry,
1616
private val properties: SyncProperties
1717
) {
18-
private val scheduler = Schedulers.newElastic("global-service-changes-combinator")
18+
private val scheduler = Schedulers.newBoundedElastic(
19+
Int.MAX_VALUE, Int.MAX_VALUE, "global-service-changes-combinator"
20+
)
1921

2022
fun combined(): Flux<MultiClusterState> {
2123
val clusterStatesStreams: List<Flux<MultiClusterState>> = clusterStateChanges.map { it.stream() }

0 commit comments

Comments
 (0)