From 9330597d3d39b15790d8aabd94447aa7460efe18 Mon Sep 17 00:00:00 2001 From: Darwin D Wu Date: Wed, 21 Feb 2024 01:05:57 -0800 Subject: [PATCH 01/10] setup CI base --- .github/workflows/ci.yml | 27 +++++++++++++++++++++++++++ Makefile | 4 ++++ 2 files changed, 31 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 00000000..944e7cc4 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,27 @@ +name: CI + +on: + push: + branches: + - main + pull_request: + +jobs: + # TODO: build? + + lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + # TODO: install kotlin and ktlint + + # - name: Lint + # run: make lint + + + # note: do we need a separate fmt? + # ktlint seems to cover what we need + # fmt: + # runs-on: ubuntu-latest + # steps: + # - uses: actions/checkout@v3 diff --git a/Makefile b/Makefile index e244b187..ba7022e0 100644 --- a/Makefile +++ b/Makefile @@ -5,3 +5,7 @@ dev: .PHONY: test test: gradle test inngest-core:test + +.PHONY: lint +lint: + ktlint --color From 510f247cdd3321fd912a352390d58483dd47206b Mon Sep 17 00:00:00 2001 From: Darwin D Wu Date: Wed, 21 Feb 2024 22:22:47 -0800 Subject: [PATCH 02/10] add test for CI --- .editorconfig | 9 ++++++++- .github/workflows/ci.yml | 17 +++++++++++++++++ 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/.editorconfig b/.editorconfig index 1a424d53..6c2f5f6c 100644 --- a/.editorconfig +++ b/.editorconfig @@ -3,8 +3,15 @@ root = true [*] charset = utf-8 end_of_line = lf -indent_size = 4 +indent_size = 2 indent_style = space insert_final_newline = false max_line_length = 120 +tab_width = 2 + +[*.{kt,kts}] +indent_size = 4 tab_width = 4 + +[Makefile] +indent_style = tab diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 944e7cc4..803d6df1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -8,6 +8,23 @@ on: jobs: # TODO: build? + test: + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + java: ["8", "11", "17", "21"] + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-java@v4 + with: + distribution: temurin + java-version: ${{ matrix.java }} + java-package: jdk + cache: gradle + + - name: Test + run: make test lint: runs-on: ubuntu-latest From de0f3a4afb1c7a572b592e6f2cccd6706a8e6bba Mon Sep 17 00:00:00 2001 From: Darwin D Wu Date: Wed, 21 Feb 2024 22:29:08 -0800 Subject: [PATCH 03/10] update lint on CI --- .github/workflows/ci.yml | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 803d6df1..c83d95bf 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -7,8 +7,8 @@ on: pull_request: jobs: - # TODO: build? test: + name: Test (Java ${{ matrix.java }}) runs-on: ubuntu-latest strategy: fail-fast: false @@ -30,15 +30,8 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - # TODO: install kotlin and ktlint - - # - name: Lint - # run: make lint - - - # note: do we need a separate fmt? - # ktlint seems to cover what we need - # fmt: - # runs-on: ubuntu-latest - # steps: - # - uses: actions/checkout@v3 + - name: ktlint + uses: ScaCap/action-ktlint@master + with: + github_token: ${{ secrets.github_token }} + reporter: github-pr-review From 5a93c3b3e694d83f857049f936c3cbce95fc8878 Mon Sep 17 00:00:00 2001 From: Darwin D Wu Date: Wed, 21 Feb 2024 22:29:51 -0800 Subject: [PATCH 04/10] update lint task name --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c83d95bf..08088683 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -27,6 +27,7 @@ jobs: run: make test lint: + name: Lint runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 From ba27319a518f2b0631d5c8bae89142b7906fa198 Mon Sep 17 00:00:00 2001 From: Darwin D Wu Date: Wed, 21 Feb 2024 22:31:32 -0800 Subject: [PATCH 05/10] auto format with ktlint -F --- .editorconfig | 2 +- Makefile | 4 ++ .../src/main/kotlin/com/inngest/Comm.kt | 31 +++++----- .../src/main/kotlin/com/inngest/Event.kt | 2 +- .../src/main/kotlin/com/inngest/Function.kt | 57 ++++++++++--------- .../src/main/kotlin/com/inngest/Inngest.kt | 11 +--- .../src/main/kotlin/com/inngest/State.kt | 11 ++-- .../src/main/kotlin/com/inngest/Step.kt | 17 ++++-- .../src/test/kotlin/com/inngest/StateTest.kt | 27 ++++----- .../src/main/kotlin/com/inngest/App.kt | 9 ++- .../src/test/kotlin/com/inngest/AppTest.kt | 8 --- 11 files changed, 88 insertions(+), 91 deletions(-) diff --git a/.editorconfig b/.editorconfig index 6c2f5f6c..9ba0cc58 100644 --- a/.editorconfig +++ b/.editorconfig @@ -5,7 +5,7 @@ charset = utf-8 end_of_line = lf indent_size = 2 indent_style = space -insert_final_newline = false +insert_final_newline = true max_line_length = 120 tab_width = 2 diff --git a/Makefile b/Makefile index ba7022e0..9593ae7f 100644 --- a/Makefile +++ b/Makefile @@ -9,3 +9,7 @@ test: .PHONY: lint lint: ktlint --color + +.PHONY: fmt +fmt: + ktlint -F diff --git a/inngest-core/src/main/kotlin/com/inngest/Comm.kt b/inngest-core/src/main/kotlin/com/inngest/Comm.kt index f67e91a7..8f401761 100644 --- a/inngest-core/src/main/kotlin/com/inngest/Comm.kt +++ b/inngest-core/src/main/kotlin/com/inngest/Comm.kt @@ -45,7 +45,6 @@ data class CommError( ) class CommHandler(val functions: HashMap) { - private fun getHeaders(): Map { return mapOf( "Content-Type" to "application/json", @@ -54,7 +53,10 @@ class CommHandler(val functions: HashMap) { ) } - fun callFunction(functionId: String, requestBody: String): CommResponse { + fun callFunction( + functionId: String, + requestBody: String, + ): CommResponse { println(requestBody) try { @@ -62,13 +64,14 @@ class CommHandler(val functions: HashMap) { // TODO - check that payload is not null and throw error val function = functions[functionId] ?: throw Exception("Function not found") - val ctx = FunctionContext( - event = payload!!.event, - events = payload.events, - runId = payload.ctx.runId, - fnId = payload.ctx.fnId, - attempt = payload.ctx.attempt, - ) + val ctx = + FunctionContext( + event = payload!!.event, + events = payload.events, + runId = payload.ctx.runId, + fnId = payload.ctx.fnId, + attempt = payload.ctx.attempt, + ) val result = function.call( @@ -85,19 +88,19 @@ class CommHandler(val functions: HashMap) { return CommResponse( body = Klaxon().toJsonString(body), statusCode = result.statusCode, - headers = getHeaders() + headers = getHeaders(), ) } catch (e: Exception) { val err = CommError( name = e.toString(), message = e.message, - stack = e.stackTrace.joinToString(separator = "\n") + stack = e.stackTrace.joinToString(separator = "\n"), ) return CommResponse( body = Klaxon().toJsonString(err), statusCode = ResultStatusCode.Error, - headers = getHeaders() + headers = getHeaders(), ) } } @@ -118,7 +121,7 @@ class CommHandler(val functions: HashMap) { sdk = "kotlin", url = "http://localhost:8080/api/inngest", v = "0.0.1", - functions = getFunctionConfigs() + functions = getFunctionConfigs(), ) val requestBody = Klaxon().toJsonString(requestPayload) @@ -145,7 +148,7 @@ class CommHandler(val functions: HashMap) { sdk = "kotlin", url = "http://localhost:8080/api/inngest", v = "0.0.1", - functions = getFunctionConfigs() + functions = getFunctionConfigs(), ) return Klaxon().toJsonString(requestPayload) } diff --git a/inngest-core/src/main/kotlin/com/inngest/Event.kt b/inngest-core/src/main/kotlin/com/inngest/Event.kt index 16f2f259..84580716 100644 --- a/inngest-core/src/main/kotlin/com/inngest/Event.kt +++ b/inngest-core/src/main/kotlin/com/inngest/Event.kt @@ -11,4 +11,4 @@ data class Event( data class EventAPIResponse( val ids: Array, val status: String, -) \ No newline at end of file +) diff --git a/inngest-core/src/main/kotlin/com/inngest/Function.kt b/inngest-core/src/main/kotlin/com/inngest/Function.kt index f192be69..7cdb3bd5 100644 --- a/inngest-core/src/main/kotlin/com/inngest/Function.kt +++ b/inngest-core/src/main/kotlin/com/inngest/Function.kt @@ -24,7 +24,6 @@ enum class OpCode { // FUTURE: WaitForEvent, StepNotFound, - } enum class ResultStatusCode(val code: Int, val message: String) { @@ -33,7 +32,6 @@ enum class ResultStatusCode(val code: Int, val message: String) { Error(500, "Function Error"), } - abstract class StepOp( // The hashed ID of a step open val id: String = "", @@ -69,7 +67,7 @@ data class FunctionConfig( val id: String, val name: String, val triggers: Array, - val steps: Map + val steps: Map, ) /** @@ -86,6 +84,7 @@ data class FunctionContext( ) // TODO - Determine if we should merge config + trigger + /** * A function that can be called by the Inngest system * @@ -94,11 +93,14 @@ data class FunctionContext( */ open class InngestFunction( val config: FunctionOptions, - val handler: (ctx: FunctionContext, step: Step) -> kotlin.Any? + val handler: (ctx: FunctionContext, step: Step) -> kotlin.Any?, ) { // TODO - Validate options and trigger - fun call(ctx: FunctionContext, requestBody: String): StepOp { + fun call( + ctx: FunctionContext, + requestBody: String, + ): StepOp { val state = State(requestBody) val step = Step(state) @@ -112,16 +114,15 @@ open class InngestFunction( id = "", name = "", op = OpCode.StepRun, - statusCode = ResultStatusCode.FunctionComplete + statusCode = ResultStatusCode.FunctionComplete, ) } catch (e: StepInterruptSleepException) { return StepOptions( opts = hashMapOf("duration" to e.data), - id = e.hashedId, name = e.id, op = OpCode.Sleep, - statusCode = ResultStatusCode.StepComplete + statusCode = ResultStatusCode.StepComplete, ) } catch (e: StepInterruptException) { // NOTE - Currently this error could be caught in the user's own function @@ -132,7 +133,7 @@ open class InngestFunction( id = e.hashedId, name = e.id, op = OpCode.StepRun, - statusCode = ResultStatusCode.StepComplete + statusCode = ResultStatusCode.StepComplete, ) } catch (e: StepInvalidStateTypeException) { // TODO - Handle this with the proper op code @@ -141,7 +142,7 @@ open class InngestFunction( id = e.hashedId, name = e.id, op = OpCode.StepStateFailed, - statusCode = ResultStatusCode.Error + statusCode = ResultStatusCode.Error, ) } } @@ -152,24 +153,24 @@ open class InngestFunction( name = config.name, triggers = config.triggers, steps = - mapOf( - "step" to - StepConfig( - id = "step", - name = "step", - retries = - mapOf( - "attempts" to 3 - ), // TODO - Pull from FunctionOptions - runtime = - hashMapOf( - "type" to "http", - // TODO - Create correct URL - "url" to - "http://localhost:8080/api/inngest?fnId=${config.id}&stepId=step" - ) - ) - ) + mapOf( + "step" to + StepConfig( + id = "step", + name = "step", + retries = + mapOf( + "attempts" to 3, + ), // TODO - Pull from FunctionOptions + runtime = + hashMapOf( + "type" to "http", + // TODO - Create correct URL + "url" to + "http://localhost:8080/api/inngest?fnId=${config.id}&stepId=step", + ), + ), + ), ) } } diff --git a/inngest-core/src/main/kotlin/com/inngest/Inngest.kt b/inngest-core/src/main/kotlin/com/inngest/Inngest.kt index 8bceac7a..5256ef6c 100644 --- a/inngest-core/src/main/kotlin/com/inngest/Inngest.kt +++ b/inngest-core/src/main/kotlin/com/inngest/Inngest.kt @@ -1,16 +1,11 @@ package com.inngest -import com.beust.klaxon.Klaxon - -//import okhttp3.RequestBody.Companion.toRequestBody - +// import okhttp3.RequestBody.Companion.toRequestBody class Inngest { - constructor( app_id: String, - - ) { + ) { // TODO - Fetch INNGEST_EVENT_KEY env variable } @@ -26,4 +21,4 @@ class Inngest { // val body = Klaxon().parse(response) // return body; // } -} \ No newline at end of file +} diff --git a/inngest-core/src/main/kotlin/com/inngest/State.kt b/inngest-core/src/main/kotlin/com/inngest/State.kt index 49bdb291..8df9176f 100644 --- a/inngest-core/src/main/kotlin/com/inngest/State.kt +++ b/inngest-core/src/main/kotlin/com/inngest/State.kt @@ -1,14 +1,12 @@ package com.inngest -import com.fasterxml.jackson.databind.ObjectMapper import com.fasterxml.jackson.databind.JsonNode +import com.fasterxml.jackson.databind.ObjectMapper import java.security.MessageDigest - class StateNotFound() : Throwable("State not found for id") class State(val payloadJson: String) { - fun getHashFromId(id: String): String { val bytes = id.toByteArray(Charsets.UTF_8) val digest = MessageDigest.getInstance("SHA-1") @@ -26,14 +24,13 @@ class State(val payloadJson: String) { val stepResult = node.path("steps").get(hashedId) ?: throw StateNotFound() if (stepResult.has("data")) { val dataNode = stepResult.get("data") - return mapper.treeToValue(dataNode, T::class.java); + return mapper.treeToValue(dataNode, T::class.java) } else if (stepResult.has("error")) { // TODO - Parse the error and throw it return null } // NOTE - Sleep steps will be stored as null // TODO - Check the state is actually null - return null; + return null } - -} \ No newline at end of file +} diff --git a/inngest-core/src/main/kotlin/com/inngest/Step.kt b/inngest-core/src/main/kotlin/com/inngest/Step.kt index 583b6e75..f8fdfe53 100644 --- a/inngest-core/src/main/kotlin/com/inngest/Step.kt +++ b/inngest-core/src/main/kotlin/com/inngest/Step.kt @@ -6,26 +6,29 @@ typealias MemoizedRecord = HashMap typealias MemoizedState = HashMap class StepInvalidStateTypeException(val id: String, val hashedId: String) : Throwable("Step execution interrupted") + class StepStateTypeMismatchException(val id: String, val hashedId: String) : Throwable("Step execution interrupted") open class StepInterruptException(val id: String, val hashedId: String, open val data: kotlin.Any?) : - Throwable("Interrupt $id") {} + Throwable("Interrupt $id") class StepInterruptSleepException(id: String, hashedId: String, override val data: String) : - StepInterruptException(id, hashedId, data) {} + StepInterruptException(id, hashedId, data) // TODO: Add name, stack, etc. if poss class StepError(message: String) : Exception(message) class Step(val state: State) { - /** * Run a function * * @param id unique step id for memoization * @param fn the function to run */ - inline fun run(id: String, fn: () -> T): T { + inline fun run( + id: String, + fn: () -> T, + ): T { val hashedId = state.getHashFromId(id) try { @@ -50,7 +53,10 @@ class Step(val state: State) { * @param id unique step id for memoization * @param duration the duration of time to sleep for */ - fun sleep(id: String, duration: Duration) { + fun sleep( + id: String, + duration: Duration, + ) { val hashedId = state.getHashFromId(id) try { @@ -66,4 +72,3 @@ class Step(val state: State) { } } } - diff --git a/inngest-core/src/test/kotlin/com/inngest/StateTest.kt b/inngest-core/src/test/kotlin/com/inngest/StateTest.kt index 4eaaaa93..e68645f6 100644 --- a/inngest-core/src/test/kotlin/com/inngest/StateTest.kt +++ b/inngest-core/src/test/kotlin/com/inngest/StateTest.kt @@ -8,21 +8,21 @@ import kotlin.test.assertNotNull data class DummyClass( @JsonProperty("sum") - val sum: Int + val sum: Int, ) internal class StateTest { - @Test - fun testGetHashedId(): Unit { + fun testGetHashedId() { val state = State("{}") val hashedId = state.getHashFromId("add-ten") assertEquals("a5b1e458ee54a384e87fff1486df43e9b3e0c4b8", hashedId) } @Test - fun testNoExistingState(): Unit { - val json = """ + fun testNoExistingState() { + val json = + """ { "steps": { "a5b1e458ee54a384e87fff1486df43e9b3e0c4b8": { @@ -30,7 +30,7 @@ internal class StateTest { } } } - """.trimIndent() + """.trimIndent() val state = State(json) val hashedId = state.getHashFromId("something-not-in-state") assertFailsWith { @@ -39,8 +39,9 @@ internal class StateTest { } @Test - fun testGetIntState(): Unit { - val json = """ + fun testGetIntState() { + val json = + """ { "steps": { "a5b1e458ee54a384e87fff1486df43e9b3e0c4b8": { @@ -48,7 +49,7 @@ internal class StateTest { } } } - """.trimIndent() + """.trimIndent() val state = State(json) val hashedId = state.getHashFromId("add-ten") val stepState = state.getState(hashedId) @@ -56,8 +57,9 @@ internal class StateTest { } @Test - fun testGetStateAsClass(): Unit { - val json = """ + fun testGetStateAsClass() { + val json = + """ { "steps": { "a5b1e458ee54a384e87fff1486df43e9b3e0c4b8": { @@ -65,7 +67,7 @@ internal class StateTest { } } } - """.trimIndent() + """.trimIndent() val state = State(json) val hashedId = state.getHashFromId("add-ten") val stepState = state.getState(hashedId) @@ -73,4 +75,3 @@ internal class StateTest { assertEquals(30, stepState.sum, "state value should be correctly deserialized") } } - diff --git a/inngest-test-server/src/main/kotlin/com/inngest/App.kt b/inngest-test-server/src/main/kotlin/com/inngest/App.kt index f4045c67..41c9e352 100644 --- a/inngest-test-server/src/main/kotlin/com/inngest/App.kt +++ b/inngest-test-server/src/main/kotlin/com/inngest/App.kt @@ -1,5 +1,6 @@ package com.inngest.testserver +import com.fasterxml.jackson.annotation.JsonProperty import com.inngest.CommHandler import com.inngest.FunctionOptions import com.inngest.FunctionTrigger @@ -11,7 +12,6 @@ import io.ktor.server.netty.* import io.ktor.server.request.* import io.ktor.server.response.* import io.ktor.server.routing.* -import com.fasterxml.jackson.annotation.JsonProperty import java.time.Duration data class IngestData(val message: String) @@ -28,10 +28,10 @@ fun Application.module() { val response = comm.callFunction(functionId, body) call.response.header( HttpHeaders.ContentType, - ContentType.Application.Json.toString() + ContentType.Application.Json.toString(), ) call.response.status( - HttpStatusCode(response.statusCode.code, response.statusCode.message) + HttpStatusCode(response.statusCode.code, response.statusCode.message), ) println("response: " + response.body) call.respond(response.body) @@ -61,7 +61,7 @@ val fn = FunctionOptions( id = "fn-id-slug", name = "My function!", - triggers = arrayOf(FunctionTrigger(event = "user.signup")) + triggers = arrayOf(FunctionTrigger(event = "user.signup")), ), ) { ctx, step -> val x = 10 @@ -98,7 +98,6 @@ val fn = val comm = CommHandler(functions = hashMapOf("fn-id-slug" to fn)) fun main() { - var port = 8080 println("Test server running on port " + port) diff --git a/inngest-test-server/src/test/kotlin/com/inngest/AppTest.kt b/inngest-test-server/src/test/kotlin/com/inngest/AppTest.kt index 0f91b53a..0aac0923 100644 --- a/inngest-test-server/src/test/kotlin/com/inngest/AppTest.kt +++ b/inngest-test-server/src/test/kotlin/com/inngest/AppTest.kt @@ -6,14 +6,6 @@ package io.inngest.testserver // import kotlin.test.Test // import kotlin.test.assertNotNull - - - - - - - - // class AppTest { // @Test fun appHasAGreeting() { // val classUnderTest = App() From 8eeb7c30effa3c25660d17aa1f6702ebfb3a5311 Mon Sep 17 00:00:00 2001 From: Darwin D Wu Date: Wed, 21 Feb 2024 22:35:54 -0800 Subject: [PATCH 06/10] make lint task fail if there are errors --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 08088683..942ea958 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -34,5 +34,6 @@ jobs: - name: ktlint uses: ScaCap/action-ktlint@master with: + fail_on_error: true github_token: ${{ secrets.github_token }} reporter: github-pr-review From a0f3e1911e259ea0a5d8b953670ef84c33baa7ba Mon Sep 17 00:00:00 2001 From: Darwin D Wu Date: Wed, 21 Feb 2024 22:36:57 -0800 Subject: [PATCH 07/10] fix linter error --- inngest-core/src/main/kotlin/com/inngest/Function.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/inngest-core/src/main/kotlin/com/inngest/Function.kt b/inngest-core/src/main/kotlin/com/inngest/Function.kt index 7cdb3bd5..c34243a0 100644 --- a/inngest-core/src/main/kotlin/com/inngest/Function.kt +++ b/inngest-core/src/main/kotlin/com/inngest/Function.kt @@ -159,9 +159,10 @@ open class InngestFunction( id = "step", name = "step", retries = + // TODO - Pull from FunctionOptions mapOf( "attempts" to 3, - ), // TODO - Pull from FunctionOptions + ), runtime = hashMapOf( "type" to "http", From b32bc45d6371bd9b8119e47cee7ab33f2bf748bf Mon Sep 17 00:00:00 2001 From: Darwin D Wu Date: Wed, 21 Feb 2024 22:39:53 -0800 Subject: [PATCH 08/10] add dependabot for updates --- .github/dependabot.yml | 11 +++++++++++ .github/workflows/ci.yml | 3 +++ 2 files changed, 14 insertions(+) create mode 100644 .github/dependabot.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 00000000..b1ba36ad --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,11 @@ +# To get started with Dependabot version updates, you'll need to specify which +# package ecosystems to update and where the package manifests are located. +# Please see the documentation for all configuration options: +# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file + +version: 2 +updates: + - package-ecosystem: gradle + directory: "/" # Location of package manifests + schedule: + interval: "weekly" diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 942ea958..c5393667 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -37,3 +37,6 @@ jobs: fail_on_error: true github_token: ${{ secrets.github_token }} reporter: github-pr-review + + # TODO: run integration tests + # integration: \ No newline at end of file From e5aa187ef96a481a157ee2c9b2ae048ee7c305c3 Mon Sep 17 00:00:00 2001 From: Darwin D Wu Date: Wed, 21 Feb 2024 22:41:30 -0800 Subject: [PATCH 09/10] linter fixes --- inngest-core/src/main/kotlin/com/inngest/Comm.kt | 6 ++++-- inngest-core/src/main/kotlin/com/inngest/Function.kt | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/inngest-core/src/main/kotlin/com/inngest/Comm.kt b/inngest-core/src/main/kotlin/com/inngest/Comm.kt index 8f401761..bfa3d17f 100644 --- a/inngest-core/src/main/kotlin/com/inngest/Comm.kt +++ b/inngest-core/src/main/kotlin/com/inngest/Comm.kt @@ -48,8 +48,10 @@ class CommHandler(val functions: HashMap) { private fun getHeaders(): Map { return mapOf( "Content-Type" to "application/json", - "x-inngest-sdk" to "inngest-kt:v0.0.1", // TODO - Get this from the build - "x-inngest-framework" to "ktor", // TODO - Pull this from options + // TODO - Get this from the build + "x-inngest-sdk" to "inngest-kt:v0.0.1", + // TODO - Pull this from options + "x-inngest-framework" to "ktor", ) } diff --git a/inngest-core/src/main/kotlin/com/inngest/Function.kt b/inngest-core/src/main/kotlin/com/inngest/Function.kt index c34243a0..cece458f 100644 --- a/inngest-core/src/main/kotlin/com/inngest/Function.kt +++ b/inngest-core/src/main/kotlin/com/inngest/Function.kt @@ -159,8 +159,8 @@ open class InngestFunction( id = "step", name = "step", retries = - // TODO - Pull from FunctionOptions mapOf( + // TODO - Pull from FunctionOptions "attempts" to 3, ), runtime = From 83961e227ace481d11ca62aaf988b90ab609e7ff Mon Sep 17 00:00:00 2001 From: Darwin D Wu Date: Wed, 21 Feb 2024 22:49:49 -0800 Subject: [PATCH 10/10] new line --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c5393667..569daf19 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -39,4 +39,4 @@ jobs: reporter: github-pr-review # TODO: run integration tests - # integration: \ No newline at end of file + # integration: