Skip to content

Commit

Permalink
V0.11.4 (#181)
Browse files Browse the repository at this point in the history
* Bump libs version
* upgrade gradle to 8.0.1
* upgrade kotlin to 1.8.10
* bump libs version
* bump infinitic version to 0.11.4
* introduce RequestBy in ExistingWorkflowProxyHandler
* Complete client tests
* Bump lib versions in storage
* fix bug introduced by apache/pulsar#8484
* bump jedis version
* fixing gradle wrapper
  • Loading branch information
geomagilles authored Apr 18, 2023
1 parent 977019f commit 1a4a24a
Show file tree
Hide file tree
Showing 67 changed files with 5,219 additions and 678 deletions.
42 changes: 20 additions & 22 deletions buildSrc/src/main/kotlin/Ci.kt
Original file line number Diff line number Diff line change
@@ -1,43 +1,41 @@
/**
* "Commons Clause" License Condition v1.0
*
* The Software is provided to you by the Licensor under the License, as defined
* below, subject to the following condition.
* The Software is provided to you by the Licensor under the License, as defined below, subject to
* the following condition.
*
* Without limiting other conditions in the License, the grant of rights under the
* License will not include, and the License does not grant to you, the right to
* Sell the Software.
* Without limiting other conditions in the License, the grant of rights under the License will not
* include, and the License does not grant to you, the right to Sell the Software.
*
* For purposes of the foregoing, “Sell” means practicing any or all of the rights
* granted to you under the License to provide to third parties, for a fee or
* other consideration (including without limitation fees for hosting or
* consulting/ support services related to the Software), a product or service
* whose value derives, entirely or substantially, from the functionality of the
* Software. Any license notice or attribution required by the License must also
* include this Commons Clause License Condition notice.
* For purposes of the foregoing, “Sell” means practicing any or all of the rights granted to you
* under the License to provide to third parties, for a fee or other consideration (including
* without limitation fees for hosting or consulting/ support services related to the Software), a
* product or service whose value derives, entirely or substantially, from the functionality of the
* Software. Any license notice or attribution required by the License must also include this
* Commons Clause License Condition notice.
*
* Software: Infinitic
*
* License: MIT License (https://opensource.org/licenses/MIT)
*
* Licensor: infinitic.io
*/

object Ci {

// this is the version used for building snapshots
// .GITHUB_RUN_NUMBER-snapshot will be appended
const val base = "0.11.3"
// this is the version used for building snapshots
// .GITHUB_RUN_NUMBER-snapshot will be appended
const val base = "0.11.4"

private val githubRunNumber = System.getenv("GITHUB_RUN_NUMBER")
private val githubRunNumber = System.getenv("GITHUB_RUN_NUMBER")

private val snapshotVersion = when (githubRunNumber) {
private val snapshotVersion =
when (githubRunNumber) {
null -> "$base-SNAPSHOT"
else -> "$base.$githubRunNumber-SNAPSHOT"
}
}

private val releaseVersion = System.getenv("RELEASE_VERSION")
private val releaseVersion = System.getenv("RELEASE_VERSION")

val isRelease = releaseVersion != null
val version = releaseVersion ?: snapshotVersion
val isRelease = releaseVersion != null
val version = releaseVersion ?: snapshotVersion
}
179 changes: 88 additions & 91 deletions buildSrc/src/main/kotlin/Libs.kt
Original file line number Diff line number Diff line change
@@ -1,106 +1,103 @@
/**
* "Commons Clause" License Condition v1.0
*
* The Software is provided to you by the Licensor under the License, as defined
* below, subject to the following condition.
* The Software is provided to you by the Licensor under the License, as defined below, subject to
* the following condition.
*
* Without limiting other conditions in the License, the grant of rights under the
* License will not include, and the License does not grant to you, the right to
* Sell the Software.
* Without limiting other conditions in the License, the grant of rights under the License will not
* include, and the License does not grant to you, the right to Sell the Software.
*
* For purposes of the foregoing, “Sell” means practicing any or all of the rights
* granted to you under the License to provide to third parties, for a fee or
* other consideration (including without limitation fees for hosting or
* consulting/ support services related to the Software), a product or service
* whose value derives, entirely or substantially, from the functionality of the
* Software. Any license notice or attribution required by the License must also
* include this Commons Clause License Condition notice.
* For purposes of the foregoing, “Sell” means practicing any or all of the rights granted to you
* under the License to provide to third parties, for a fee or other consideration (including
* without limitation fees for hosting or consulting/ support services related to the Software), a
* product or service whose value derives, entirely or substantially, from the functionality of the
* Software. Any license notice or attribution required by the License must also include this
* Commons Clause License Condition notice.
*
* Software: Infinitic
*
* License: MIT License (https://opensource.org/licenses/MIT)
*
* Licensor: infinitic.io
*/

object Libs {

const val org = "io.infinitic"

object Kotlin {
const val reflect = "org.jetbrains.kotlin:kotlin-reflect:$kotlinVersion"
}

object Coroutines {
private const val version = "1.6.4"
const val core = "org.jetbrains.kotlinx:kotlinx-coroutines-core:$version"
const val jdk8 = "org.jetbrains.kotlinx:kotlinx-coroutines-jdk8:$version"
}

object Caffeine {
const val caffeine = "com.github.ben-manes.caffeine:caffeine:3.1.1"
}

object Serialization {
const val json = "org.jetbrains.kotlinx:kotlinx-serialization-json:1.4.0"
}

object JsonPath {
const val jayway = "com.jayway.jsonpath:json-path:2.7.0"
}

object Jackson {
private const val version = "2.13.4"
const val core = "com.fasterxml.jackson.core:jackson-core:$version"
const val databind = "com.fasterxml.jackson.core:jackson-databind:$version"
const val kotlin = "com.fasterxml.jackson.module:jackson-module-kotlin:$version"
const val jsr310 = "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:$version"
}

object Kotest {
private const val version = "5.4.2"
const val property = "io.kotest:kotest-property-jvm:$version"
const val junit5 = "io.kotest:kotest-runner-junit5-jvm:$version"
}

object Mockk {
const val mockk = "io.mockk:mockk:1.12.7"
}

object Avro4k {
const val core = "com.github.avro-kotlin.avro4k:avro4k-core:1.6.0"
}

object Hoplite {
private const val version = "2.6.2"
const val core = "com.sksamuel.hoplite:hoplite-core:$version"
const val yaml = "com.sksamuel.hoplite:hoplite-yaml:$version"
}

object Pulsar {
private const val version = "2.10.2"
const val client = "org.apache.pulsar:pulsar-client:$version"
const val clientAdmin = "org.apache.pulsar:pulsar-client-admin:$version"
const val functions = "org.apache.pulsar:pulsar-functions-api:$version"
const val authAthenz = "org.apache.pulsar:pulsar-client-auth-athenz:$version"
const val authSasl = "org.apache.pulsar:pulsar-client-auth-sasl:$version"
}

object Kweb {
const val core = "com.github.kwebio:kweb-core:0.12.5"
}

object EasyRandom {
const val core = "org.jeasy:easy-random-core:5.0.0"
}

object Slf4j {
private const val version = "2.0.3"
const val simple = "org.slf4j:slf4j-simple:$version"
const val api = "org.slf4j:slf4j-api:$version"
}

object Logging {
const val api = "io.github.microutils:kotlin-logging:3.0.0"
}
const val org = "io.infinitic"

object Kotlin {
const val reflect = "org.jetbrains.kotlin:kotlin-reflect:$kotlinVersion"
}

object Coroutines {
private const val version = "1.6.4"
const val core = "org.jetbrains.kotlinx:kotlinx-coroutines-core:$version"
const val jdk8 = "org.jetbrains.kotlinx:kotlinx-coroutines-jdk8:$version"
}

object Caffeine {
const val caffeine = "com.github.ben-manes.caffeine:caffeine:3.1.3"
}

object Serialization {
const val json = "org.jetbrains.kotlinx:kotlinx-serialization-json:1.5.0-RC"
}

object JsonPath {
const val jayway = "com.jayway.jsonpath:json-path:2.7.0"
}

object Jackson {
private const val version = "2.14.2"
const val core = "com.fasterxml.jackson.core:jackson-core:$version"
const val databind = "com.fasterxml.jackson.core:jackson-databind:$version"
const val kotlin = "com.fasterxml.jackson.module:jackson-module-kotlin:$version"
const val jsr310 = "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:$version"
}

object Kotest {
private const val version = "5.5.5"
const val property = "io.kotest:kotest-property-jvm:$version"
const val junit5 = "io.kotest:kotest-runner-junit5-jvm:$version"
}

object Mockk {
const val mockk = "io.mockk:mockk:1.13.4"
}

object Avro4k {
const val core = "com.github.avro-kotlin.avro4k:avro4k-core:1.6.0"
}

object Hoplite {
private const val version = "2.7.1"
const val core = "com.sksamuel.hoplite:hoplite-core:$version"
const val yaml = "com.sksamuel.hoplite:hoplite-yaml:$version"
}

object Pulsar {
private const val version = "2.11.0"
const val client = "org.apache.pulsar:pulsar-client:$version"
const val clientAdmin = "org.apache.pulsar:pulsar-client-admin:$version"
const val functions = "org.apache.pulsar:pulsar-functions-api:$version"
const val authAthenz = "org.apache.pulsar:pulsar-client-auth-athenz:$version"
const val authSasl = "org.apache.pulsar:pulsar-client-auth-sasl:$version"
}

object Kweb {
const val core = "io.kweb:kweb-core:1.3.7"
}

object EasyRandom {
const val core = "org.jeasy:easy-random-core:5.0.0"
}

object Slf4j {
private const val version = "2.0.6"
const val simple = "org.slf4j:slf4j-simple:$version"
const val api = "org.slf4j:slf4j-api:$version"
}

object Logging {
const val api = "io.github.microutils:kotlin-logging:3.0.0"
}
}
2 changes: 1 addition & 1 deletion buildSrc/src/main/kotlin/Plugins.kt
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
*
* Licensor: infinitic.io
*/
const val kotlinVersion = "1.7.10"
const val kotlinVersion = "1.8.10"

object Plugins {
object Kotlin {
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.1-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,11 @@ import io.infinitic.common.proxies.ExistingWorkflowProxyHandler
import io.infinitic.common.proxies.NewServiceProxyHandler
import io.infinitic.common.proxies.NewWorkflowProxyHandler
import io.infinitic.common.proxies.ProxyHandler
import io.infinitic.common.proxies.RequestByWorkflowId
import io.infinitic.common.proxies.RequestByWorkflowTag
import io.infinitic.common.tasks.data.TaskId
import io.infinitic.common.tasks.data.TaskMeta
import io.infinitic.common.workflows.data.methodRuns.MethodRunId
import io.infinitic.common.workflows.data.workflows.WorkflowId
import io.infinitic.common.workflows.data.workflows.WorkflowMeta
import io.infinitic.common.workflows.data.workflows.WorkflowTag
import io.infinitic.exceptions.clients.InvalidStubException
Expand Down Expand Up @@ -129,26 +130,26 @@ abstract class InfiniticClientAbstract : InfiniticClientInterface {

/** Create a stub for an existing workflow targeted by id */
override fun <T : Any> getWorkflowById(klass: Class<out T>, id: String): T =
ExistingWorkflowProxyHandler(klass = klass, WorkflowId(id), null) { dispatcher }.stub()
ExistingWorkflowProxyHandler(klass, RequestByWorkflowId.by(id)) { dispatcher }.stub()

/** Create a stub for existing workflow targeted by tag */
override fun <T : Any> getWorkflowByTag(klass: Class<out T>, tag: String): T =
ExistingWorkflowProxyHandler(klass = klass, null, WorkflowTag(tag)) { dispatcher }.stub()
ExistingWorkflowProxyHandler(klass, RequestByWorkflowTag.by(tag)) { dispatcher }.stub()

/** Await a workflow targeted by its id */
override fun await(stub: Any): Any? =
when (val handler = getProxyHandler(stub)) {
is ExistingWorkflowProxyHandler ->
when {
handler.workflowId != null ->
when (handler.requestBy) {
is RequestByWorkflowId ->
dispatcher.awaitWorkflow(
handler.returnType,
handler.workflowName,
handler.methodName,
handler.workflowId!!,
(handler.requestBy as RequestByWorkflowId).workflowId,
null,
false)
handler.workflowTag != null ->
is RequestByWorkflowTag ->
TODO("Not implemented as tag can target multiple workflows")
else -> thisShouldNotHappen()
}
Expand All @@ -159,16 +160,16 @@ abstract class InfiniticClientAbstract : InfiniticClientInterface {
override fun await(stub: Any, methodRunId: String): Any? =
when (val handler = getProxyHandler(stub)) {
is ExistingWorkflowProxyHandler ->
when {
handler.workflowId != null ->
when (handler.requestBy) {
is RequestByWorkflowId ->
dispatcher.awaitWorkflow(
handler.returnType,
handler.workflowName,
handler.methodName,
handler.workflowId!!,
(handler.requestBy as RequestByWorkflowId).workflowId,
MethodRunId(methodRunId),
false)
handler.workflowTag != null -> throw InvalidStubException("$stub")
is RequestByWorkflowTag -> throw InvalidStubException("$stub")
else -> thisShouldNotHappen()
}
else -> throw InvalidStubException("$stub")
Expand All @@ -178,17 +179,15 @@ abstract class InfiniticClientAbstract : InfiniticClientInterface {
override fun cancelAsync(stub: Any): CompletableFuture<Unit> =
when (val handler = getProxyHandler(stub)) {
is ExistingWorkflowProxyHandler ->
dispatcher.cancelWorkflowAsync(
handler.workflowName, handler.workflowId, null, handler.workflowTag)
dispatcher.cancelWorkflowAsync(handler.workflowName, handler.requestBy, null)
else -> throw InvalidStubException("$stub")
}

/** Retry a workflow task */
override fun retryWorkflowTaskAsync(stub: Any): CompletableFuture<Unit> =
when (val handler = getProxyHandler(stub)) {
is ExistingWorkflowProxyHandler ->
dispatcher.retryWorkflowTaskAsync(
handler.workflowName, handler.workflowId, handler.workflowTag)
dispatcher.retryWorkflowTaskAsync(handler.workflowName, handler.requestBy)
else -> throw InvalidStubException("$stub")
}

Expand All @@ -206,8 +205,7 @@ abstract class InfiniticClientAbstract : InfiniticClientInterface {
is ExistingWorkflowProxyHandler -> {
dispatcher.completeTimersAsync(
workflowName = handler.workflowName,
workflowId = handler.workflowId,
workflowTag = handler.workflowTag,
requestBy = handler.requestBy,
methodRunId = id?.let { MethodRunId(id) })
}
else -> throw InvalidStubException("$stub")
Expand All @@ -217,8 +215,7 @@ abstract class InfiniticClientAbstract : InfiniticClientInterface {
override fun <T : Any> getIds(stub: T): Set<String> =
when (val handler = getProxyHandler(stub)) {
is ExistingWorkflowProxyHandler ->
dispatcher.getWorkflowIdsByTag(
handler.workflowName, handler.workflowId, handler.workflowTag)
dispatcher.getWorkflowIdsByTag(handler.workflowName, handler.requestBy)
else -> throw InvalidStubException("$stub")
}

Expand Down Expand Up @@ -265,8 +262,7 @@ abstract class InfiniticClientAbstract : InfiniticClientInterface {

dispatcher.retryTaskAsync(
workflowName = handler.workflowName,
workflowId = handler.workflowId,
workflowTag = handler.workflowTag,
requestBy = handler.requestBy,
serviceName = taskName,
taskStatus = taskStatus,
taskId = taskId?.let { TaskId(it) })
Expand Down
Loading

0 comments on commit 1a4a24a

Please sign in to comment.