From 85f703c06ced457ba97aff8057b1f4ccb348560b Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 31 Oct 2023 19:49:01 +0000 Subject: [PATCH 1/5] Update all dependencies | datasource | package | from | to | | ---------- | ------------------------------------------------------------------------------------------------- | ------------- | ------------- | | maven | com.google.devtools.ksp:com.google.devtools.ksp.gradle.plugin | 1.9.10-1.0.13 | 1.9.20-1.0.13 | | maven | com.google.devtools.ksp:symbol-processing-api | 1.9.10-1.0.13 | 1.9.20-1.0.13 | | maven | org.jetbrains.kotlin.plugin.serialization:org.jetbrains.kotlin.plugin.serialization.gradle.plugin | 1.9.10 | 1.9.20 | | maven | org.jetbrains.kotlin.multiplatform:org.jetbrains.kotlin.multiplatform.gradle.plugin | 1.9.10 | 1.9.20 | | maven | org.jetbrains.kotlin.jvm:org.jetbrains.kotlin.jvm.gradle.plugin | 1.9.10 | 1.9.20 | --- gradle/libs.versions.toml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index b3a0cc1b9e4..8930b47d064 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -11,12 +11,12 @@ jUnitVintage = "5.10.0" kotest = "5.7.2" kotestGradle = "5.7.2" kover = "0.7.4" -kotlin = "1.9.10" -kotlinxSerializationPlugin = "1.9.10" +kotlin = "1.9.20" +kotlinxSerializationPlugin = "1.9.20" kotlinBinaryCompatibilityValidator = "0.13.2" kotlinCompileTesting = "1.5.0" knit = "0.4.0" -kspVersion = "1.9.10-1.0.13" +kspVersion = "1.9.20-1.0.13" kotlinxSerialization = "1.6.0" mockWebServer = "4.12.0" retrofit = "2.9.0" From a5720be19b3d5de3a048588cea1b30f52f5d4b58 Mon Sep 17 00:00:00 2001 From: Alejandro Serrano Mena Date: Thu, 2 Nov 2023 10:32:47 +0100 Subject: [PATCH 2/5] Fix problem with KMP 1.9.20 --- .../arrow/fx/coroutines/CircuitBreaker.kt | 51 +++++++++---------- .../kotlin/arrow/resilience/CircuitBreaker.kt | 26 ++++++---- 2 files changed, 38 insertions(+), 39 deletions(-) diff --git a/arrow-libs/fx/arrow-fx-coroutines/src/commonMain/kotlin/arrow/fx/coroutines/CircuitBreaker.kt b/arrow-libs/fx/arrow-fx-coroutines/src/commonMain/kotlin/arrow/fx/coroutines/CircuitBreaker.kt index 3395f32f401..ec07859b4a4 100644 --- a/arrow-libs/fx/arrow-fx-coroutines/src/commonMain/kotlin/arrow/fx/coroutines/CircuitBreaker.kt +++ b/arrow-libs/fx/arrow-fx-coroutines/src/commonMain/kotlin/arrow/fx/coroutines/CircuitBreaker.kt @@ -621,26 +621,31 @@ private constructor( onClosed: suspend () -> Unit = { }, onHalfOpen: suspend () -> Unit = { }, onOpen: suspend () -> Unit = { }, - ): CircuitBreaker = - CircuitBreaker( + ): CircuitBreaker { + require(maxFailures >= 0) { + "maxFailures expected to be greater than or equal to 0, but was $maxFailures" + } + require(resetTimeoutNanos > 0) { + "resetTimeout expected to be greater than 0, but was $resetTimeoutNanos" + } + require(exponentialBackoffFactor > 0) { + "exponentialBackoffFactor expected to be greater than 0, but was $exponentialBackoffFactor" + } + require(maxResetTimeoutNanos > 0) { + "maxResetTimeout expected to be greater than 0, but was $maxResetTimeoutNanos" + } + return CircuitBreaker( state = AtomicRef(Closed(0)), - maxFailures = maxFailures - .takeIf { it >= 0 } - .let { requireNotNull(it) { "maxFailures expected to be greater than or equal to 0, but was $maxFailures" } }, - resetTimeoutNanos = resetTimeoutNanos - .takeIf { it > 0 } - .let { requireNotNull(it) { "resetTimeout expected to be greater than 0, but was $resetTimeoutNanos" } }, - exponentialBackoffFactor = exponentialBackoffFactor - .takeIf { it > 0 } - .let { requireNotNull(it) { "exponentialBackoffFactor expected to be greater than 0, but was $exponentialBackoffFactor" } }, - maxResetTimeoutNanos = maxResetTimeoutNanos - .takeIf { it > 0 } - .let { requireNotNull(it) { "maxResetTimeout expected to be greater than 0, but was $maxResetTimeoutNanos" } }, + maxFailures = maxFailures, + resetTimeoutNanos = resetTimeoutNanos, + exponentialBackoffFactor = exponentialBackoffFactor, + maxResetTimeoutNanos = maxResetTimeoutNanos, onRejected = onRejected, onClosed = onClosed, onHalfOpen = onHalfOpen, onOpen = onOpen ) + } /** * Attempts to create a [CircuitBreaker]. @@ -682,20 +687,10 @@ private constructor( onOpen: suspend () -> Unit = suspend { }, ): CircuitBreaker = of( - maxFailures = maxFailures - .takeIf { it >= 0 } - .let { requireNotNull(it) { "maxFailures expected to be greater than or equal to 0, but was $maxFailures" } }, - resetTimeoutNanos = resetTimeout - .takeIf { it.isPositive() && it != Duration.ZERO } - .let { requireNotNull(it) { "resetTimeout expected to be greater than ${Duration.ZERO}, but was $resetTimeout" } } - .toDouble(DurationUnit.NANOSECONDS), - exponentialBackoffFactor = exponentialBackoffFactor - .takeIf { it > 0 } - .let { requireNotNull(it) { "exponentialBackoffFactor expected to be greater than 0, but was $exponentialBackoffFactor" } }, - maxResetTimeoutNanos = maxResetTimeout - .takeIf { it.isPositive() && it != Duration.ZERO } - .let { requireNotNull(it) { "maxResetTimeout expected to be greater than ${Duration.ZERO}, but was $maxResetTimeout" } } - .toDouble(DurationUnit.NANOSECONDS), + maxFailures = maxFailures, + resetTimeoutNanos = resetTimeout.toDouble(DurationUnit.NANOSECONDS), + exponentialBackoffFactor = exponentialBackoffFactor, + maxResetTimeoutNanos = maxResetTimeout.toDouble(DurationUnit.NANOSECONDS), onRejected = onRejected, onClosed = onClosed, onHalfOpen = onHalfOpen, diff --git a/arrow-libs/resilience/arrow-resilience/src/commonMain/kotlin/arrow/resilience/CircuitBreaker.kt b/arrow-libs/resilience/arrow-resilience/src/commonMain/kotlin/arrow/resilience/CircuitBreaker.kt index e56372e3285..e348f127c4c 100644 --- a/arrow-libs/resilience/arrow-resilience/src/commonMain/kotlin/arrow/resilience/CircuitBreaker.kt +++ b/arrow-libs/resilience/arrow-resilience/src/commonMain/kotlin/arrow/resilience/CircuitBreaker.kt @@ -520,24 +520,28 @@ private constructor( onClosed: suspend () -> Unit = suspend { }, onHalfOpen: suspend () -> Unit = suspend { }, onOpen: suspend () -> Unit = suspend { } - ): CircuitBreaker = - CircuitBreaker( + ): CircuitBreaker { + require(resetTimeout > Duration.ZERO) { + "resetTimeout expected to be greater than ${Duration.ZERO}, but was $resetTimeout" + } + require(exponentialBackoffFactor > 0) { + "exponentialBackoffFactor expected to be greater than 0, but was $exponentialBackoffFactor" + } + require(maxResetTimeout > Duration.ZERO) { + "maxResetTimeout expected to be greater than ${Duration.ZERO}, but was $maxResetTimeout" + } + return CircuitBreaker( state = AtomicRef(Closed(openingStrategy)), - resetTimeout = resetTimeout - .takeIf { it.isPositive() && it != Duration.ZERO } - .let { requireNotNull(it) { "resetTimeout expected to be greater than ${Duration.ZERO}, but was $resetTimeout" } }, - exponentialBackoffFactor = exponentialBackoffFactor - .takeIf { it > 0 } - .let { requireNotNull(it) { "exponentialBackoffFactor expected to be greater than 0, but was $exponentialBackoffFactor" } }, - maxResetTimeout = maxResetTimeout - .takeIf { it.isPositive() && it != Duration.ZERO } - .let { requireNotNull(it) { "maxResetTimeout expected to be greater than ${Duration.ZERO}, but was $maxResetTimeout" } }, + resetTimeout = resetTimeout, + exponentialBackoffFactor = exponentialBackoffFactor, + maxResetTimeout = maxResetTimeout, timeSource = timeSource, onRejected = onRejected, onClosed = onClosed, onHalfOpen = onHalfOpen, onOpen = onOpen ) + } } public sealed class OpeningStrategy { From 1e241bf66200e9c51af6cc6dc990847061202a25 Mon Sep 17 00:00:00 2001 From: Alejandro Serrano Mena Date: Thu, 2 Nov 2023 10:37:53 +0100 Subject: [PATCH 3/5] Update -dev version --- .github/workflows/pull_request.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index 7cdfe17bbc4..831e18ae9ff 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -179,7 +179,7 @@ jobs: - name: jvmTest (K2 enabled) uses: gradle/gradle-build-action@v2 with: - arguments: "jvmTest -Pkotlin_version=2.0.0-dev-5387 -Pkotlin_repo_url=https://maven.pkg.jetbrains.space/kotlin/p/kotlin/bootstrap -Pkotlin_language_version=2.0" + arguments: "jvmTest -Pkotlin_version=2.0.0-dev-6573 -Pkotlin_repo_url=https://maven.pkg.jetbrains.space/kotlin/p/kotlin/bootstrap -Pkotlin_language_version=2.0 -Pkotlin_api_version=2.0" - name: Upload reports if: failure() From 6300def6deb649b35463219f0059780b3a05cb66 Mon Sep 17 00:00:00 2001 From: Alejandro Serrano Date: Fri, 3 Nov 2023 22:24:53 +0100 Subject: [PATCH 4/5] Update libs.versions.toml --- gradle/libs.versions.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 8930b47d064..97b2a2c3c6a 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -8,8 +8,8 @@ dokka = "1.9.10" jUnit = "4.13.2" jUnitJupiter = "5.10.0" jUnitVintage = "5.10.0" -kotest = "5.7.2" -kotestGradle = "5.7.2" +kotest = "5.8.0" +kotestGradle = "5.8.0" kover = "0.7.4" kotlin = "1.9.20" kotlinxSerializationPlugin = "1.9.20" From dffee465a3a9e03ef7a3377a9cea088050f14f65 Mon Sep 17 00:00:00 2001 From: Alejandro Serrano Mena Date: Sat, 4 Nov 2023 09:27:41 +0100 Subject: [PATCH 5/5] (Weird) fix for new -dev --- .../arrow-core/src/commonTest/kotlin/arrow/core/IterableTest.kt | 2 ++ .../src/commonTest/kotlin/arrow/core/SequenceKTest.kt | 2 ++ gradle/libs.versions.toml | 2 +- 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/arrow-libs/core/arrow-core/src/commonTest/kotlin/arrow/core/IterableTest.kt b/arrow-libs/core/arrow-core/src/commonTest/kotlin/arrow/core/IterableTest.kt index 7a1fe712366..06880e53fa7 100644 --- a/arrow-libs/core/arrow-core/src/commonTest/kotlin/arrow/core/IterableTest.kt +++ b/arrow-libs/core/arrow-core/src/commonTest/kotlin/arrow/core/IterableTest.kt @@ -1,3 +1,5 @@ +@file:Suppress("DUPLICATE_PARAMETER_NAME_IN_FUNCTION_TYPE") + package arrow.core import arrow.core.test.either diff --git a/arrow-libs/core/arrow-core/src/commonTest/kotlin/arrow/core/SequenceKTest.kt b/arrow-libs/core/arrow-core/src/commonTest/kotlin/arrow/core/SequenceKTest.kt index e7a315b4ed3..f6ff9ec73aa 100644 --- a/arrow-libs/core/arrow-core/src/commonTest/kotlin/arrow/core/SequenceKTest.kt +++ b/arrow-libs/core/arrow-core/src/commonTest/kotlin/arrow/core/SequenceKTest.kt @@ -1,3 +1,5 @@ +@file:Suppress("DUPLICATE_PARAMETER_NAME_IN_FUNCTION_TYPE") + package arrow.core import arrow.core.test.laws.MonoidLaws diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 97b2a2c3c6a..b368df8aa8d 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -16,7 +16,7 @@ kotlinxSerializationPlugin = "1.9.20" kotlinBinaryCompatibilityValidator = "0.13.2" kotlinCompileTesting = "1.5.0" knit = "0.4.0" -kspVersion = "1.9.20-1.0.13" +kspVersion = "1.9.20-1.0.14" kotlinxSerialization = "1.6.0" mockWebServer = "4.12.0" retrofit = "2.9.0"