Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add view logs support, bold button for start/pause, bump Kotlin/Gradle #415

Open
wants to merge 11 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion backfila-embedded/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import com.vanniktech.maven.publish.KotlinJvm
import com.vanniktech.maven.publish.MavenPublishBaseExtension

plugins {
kotlin("jvm")
id("org.jetbrains.kotlin.jvm")
`java-library`
id("com.vanniktech.maven.publish.base")
}
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion bin/gradle
9 changes: 5 additions & 4 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import com.vanniktech.maven.publish.SonatypeHost
import org.gradle.api.tasks.testing.logging.TestExceptionFormat
import org.jetbrains.dokka.gradle.DokkaTask
import org.jetbrains.kotlin.allopen.gradle.AllOpenExtension
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

buildscript {
Expand Down Expand Up @@ -39,14 +40,14 @@ subprojects {

tasks.withType<KotlinCompile> {
dependsOn("spotlessKotlinApply")
kotlinOptions {
jvmTarget = "11"
compilerOptions {
jvmTarget = JvmTarget.JVM_17
}
}

tasks.withType<JavaCompile> {
sourceCompatibility = JavaVersion.VERSION_11.toString()
targetCompatibility = JavaVersion.VERSION_11.toString()
sourceCompatibility = JavaVersion.VERSION_17.toString()
targetCompatibility = JavaVersion.VERSION_17.toString()
}

configure<AllOpenExtension> {
Expand Down
2 changes: 1 addition & 1 deletion client-base/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import com.vanniktech.maven.publish.KotlinJvm
import com.vanniktech.maven.publish.MavenPublishBaseExtension

plugins {
kotlin("jvm")
id("org.jetbrains.kotlin.jvm")
`java-library`
id("com.vanniktech.maven.publish.base")
}
Expand Down
2 changes: 1 addition & 1 deletion client-dynamodb-v2/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import com.vanniktech.maven.publish.KotlinJvm
import com.vanniktech.maven.publish.MavenPublishBaseExtension

plugins {
kotlin("jvm")
id("org.jetbrains.kotlin.jvm")
`java-library`
id("com.vanniktech.maven.publish.base")
}
Expand Down
2 changes: 1 addition & 1 deletion client-dynamodb/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import com.vanniktech.maven.publish.KotlinJvm
import com.vanniktech.maven.publish.MavenPublishBaseExtension

plugins {
kotlin("jvm")
id("org.jetbrains.kotlin.jvm")
`java-library`
id("com.vanniktech.maven.publish.base")
}
Expand Down
2 changes: 1 addition & 1 deletion client-jooq/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ buildscript {
}

plugins {
kotlin("jvm")
id("org.jetbrains.kotlin.jvm")
`java-library`
id("org.flywaydb.flyway") version "7.15.0"
id("nu.studer.jooq") version "8.1"
Expand Down
2 changes: 1 addition & 1 deletion client-misk-dynamodb/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import com.vanniktech.maven.publish.KotlinJvm
import com.vanniktech.maven.publish.MavenPublishBaseExtension

plugins {
kotlin("jvm")
id("org.jetbrains.kotlin.jvm")
`java-library`
id("com.vanniktech.maven.publish.base")
}
Expand Down
2 changes: 1 addition & 1 deletion client-misk-hibernate/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import com.vanniktech.maven.publish.KotlinJvm
import com.vanniktech.maven.publish.MavenPublishBaseExtension

plugins {
kotlin("jvm")
id("org.jetbrains.kotlin.jvm")
`java-library`
id("com.vanniktech.maven.publish.base")
}
Expand Down
2 changes: 1 addition & 1 deletion client-misk-jooq/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import com.vanniktech.maven.publish.KotlinJvm
import com.vanniktech.maven.publish.MavenPublishBaseExtension

plugins {
kotlin("jvm")
id("org.jetbrains.kotlin.jvm")
`java-library`
id("com.vanniktech.maven.publish.base")
}
Expand Down
2 changes: 1 addition & 1 deletion client-misk-static/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import com.vanniktech.maven.publish.KotlinJvm
import com.vanniktech.maven.publish.MavenPublishBaseExtension

plugins {
kotlin("jvm")
id("org.jetbrains.kotlin.jvm")
`java-library`
id("com.vanniktech.maven.publish.base")
}
Expand Down
2 changes: 1 addition & 1 deletion client-misk/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import com.vanniktech.maven.publish.KotlinJvm
import com.vanniktech.maven.publish.MavenPublishBaseExtension

plugins {
kotlin("jvm")
id("org.jetbrains.kotlin.jvm")
`java-library`
id("com.vanniktech.maven.publish.base")
}
Expand Down
2 changes: 1 addition & 1 deletion client-s3/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import com.vanniktech.maven.publish.KotlinJvm
import com.vanniktech.maven.publish.MavenPublishBaseExtension

plugins {
kotlin("jvm")
id("org.jetbrains.kotlin.jvm")
`java-library`
id("com.vanniktech.maven.publish.base")
}
Expand Down
2 changes: 1 addition & 1 deletion client-sqldelight-gradle-plugin/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import com.vanniktech.maven.publish.MavenPublishBaseExtension

plugins {
id("java-gradle-plugin")
kotlin("jvm")
id("org.jetbrains.kotlin.jvm")
id("com.github.gmazzo.buildconfig")
id("com.vanniktech.maven.publish.base")
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import java.io.Serializable
import org.gradle.api.NamedDomainObjectContainer
import org.gradle.api.Plugin
import org.gradle.api.Project
import org.gradle.api.file.Directory
import org.gradle.api.provider.Property
import org.gradle.api.provider.Provider
import org.gradle.api.tasks.TaskProvider
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package app.cash.backfila.client.sqldelight.plugin

import java.io.File
import org.gradle.api.DefaultTask
import org.gradle.api.file.DirectoryProperty
import org.gradle.api.provider.Property
import org.gradle.api.tasks.Input
import org.gradle.api.tasks.OutputDirectory
import org.gradle.api.tasks.TaskAction
import java.io.File

abstract class GenerateBackfilaRecordSourceSqlTask : DefaultTask() {
@get:Input
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import app.cash.backfila.client.sqldelight.plugin.SqlDelightRecordSource
plugins {
id("app.cash.backfila.client.sqldelight")
id("app.cash.sqldelight")
kotlin("jvm")
id("org.jetbrains.kotlin.jvm")
}

sqldelight {
Expand All @@ -13,7 +13,7 @@ sqldelight {
dialect(libs.sqldelightMysqlDialect)
srcDirs.setFrom(listOf("resources/migrations"))
deriveSchemaFromMigrations.set(true)
migrationOutputDirectory.set(file("$buildDir/resources/main/migrations"))
migrationOutputDirectory.set(layout.buildDirectory.dir("resources/main/migrations"))
verifyMigrations.set(true)
}
}
Expand All @@ -36,4 +36,8 @@ dependencies {
implementation("app.cash.backfila:client-sqldelight:${project.property("backfilaVersion")}")
implementation("app.cash.backfila:client:${project.property("backfilaVersion")}")
implementation(libs.sqldelightJdbcDriver)
}
}

tasks.named { it == "generateMainHockeyDataDatabaseInterface" }.configureEach {
dependsOn("generateBackfilaRecordSourceSqlHockeyPlayerOrigin")
}
16 changes: 14 additions & 2 deletions client-sqldelight-test/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
plugins {
kotlin("jvm")
id("org.jetbrains.kotlin.jvm")
id("app.cash.sqldelight")
id("app.cash.backfila.client.sqldelight")
}
Expand All @@ -12,7 +12,7 @@ sqldelight {
dialect(libs.sqldelightMysqlDialect)
srcDirs.setFrom(listOf("src/main/sqldelight", "src/main/resources/migrations"))
deriveSchemaFromMigrations.set(true)
migrationOutputDirectory.set(file("$buildDir/resources/main/migrations"))
migrationOutputDirectory.set(layout.buildDirectory.dir("resources/main/migrations"))
verifyMigrations.set(true)
}
}
Expand All @@ -35,6 +35,18 @@ val compileKotlin by tasks.getting {
dependsOn("generateMainHockeyDataDatabaseMigrations")
}

tasks.named { it == "generateMainHockeyDataDatabaseInterface" }.configureEach {
dependsOn("generateBackfilaRecordSourceSqlHockeyPlayersBackfill")
}

tasks.named { it == "generateBackfilaRecordSourceSqlHockeyPlayersBackfill" }.configureEach {
dependsOn("generateMainHockeyDataDatabaseMigrations")
}

tasks.named { it == "generateMainHockeyDataDatabaseMigrations" }.configureEach {
dependsOn("spotlessKotlin")
}

dependencies {
implementation(libs.guava)
implementation(libs.moshiCore)
Expand Down
2 changes: 1 addition & 1 deletion client-sqldelight/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import com.vanniktech.maven.publish.KotlinJvm
import com.vanniktech.maven.publish.MavenPublishBaseExtension

plugins {
kotlin("jvm")
id("org.jetbrains.kotlin.jvm")
`java-library`
id("com.vanniktech.maven.publish.base")
}
Expand Down
2 changes: 1 addition & 1 deletion client-static/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import com.vanniktech.maven.publish.KotlinJvm
import com.vanniktech.maven.publish.MavenPublishBaseExtension

plugins {
kotlin("jvm")
id("org.jetbrains.kotlin.jvm")
`java-library`
id("com.vanniktech.maven.publish.base")
}
Expand Down
2 changes: 1 addition & 1 deletion client-testing/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import com.vanniktech.maven.publish.KotlinJvm
import com.vanniktech.maven.publish.MavenPublishBaseExtension

plugins {
kotlin("jvm")
id("org.jetbrains.kotlin.jvm")
`java-library`
id("com.vanniktech.maven.publish.base")
}
Expand Down
4 changes: 2 additions & 2 deletions client/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ import com.vanniktech.maven.publish.KotlinJvm
import com.vanniktech.maven.publish.MavenPublishBaseExtension

plugins {
kotlin("jvm")
id("org.jetbrains.kotlin.jvm")
`java-library`
id("com.squareup.wire")
id("com.vanniktech.maven.publish.base")
}

sourceSets {
val main by getting {
java.srcDir("$buildDir/generated/source/wire/")
java.srcDir(layout.buildDirectory.dir("generated/source/wire"))
}
}

Expand Down
26 changes: 13 additions & 13 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
[versions]
jooq = "3.18.1"
jooq = "3.18.25"
kotlin = "2.1.10"
ktlint = "0.47.1"
kotlin = "1.9.23"
misk = "2025.01.09.184726-680bca2"
misk = "2025.01.29.125750-6f470ec"
okhttp = "5.0.0-alpha.14"
wire = "5.0.0"
sqldelight = "2.0.2"
wire = "5.2.1"

[libraries]
apacheCommonsLang3 = { module = "org.apache.commons:commons-lang3", version = "3.12.0" }
Expand Down Expand Up @@ -40,15 +40,15 @@ moshiKotlin = { module = "com.squareup.moshi:moshi-kotlin", version = "1.13.0" }
mysql = { module = "mysql:mysql-connector-java", version = "8.0.30" }
okHttp = { module = "com.squareup.okhttp3:okhttp", version.ref = "okhttp" }
okHttpMockWebServer = { module = "com.squareup.okhttp3:mockwebserver", version.ref = "okhttp" }
okio = { module = "com.squareup.okio:okio", version = "3.9.0" }
okio = { module = "com.squareup.okio:okio", version = "3.9.1" }
openTracing = { module = "io.opentracing:opentracing-api", version = "0.33.0" }
openTracingMock = { module = "io.opentracing:opentracing-mock", version = "0.33.0" }
openTracingOkHttp = { module = "io.opentracing.contrib:opentracing-okhttp3", version = "3.0.0" }
retrofit = { module = "com.squareup.retrofit2:retrofit", version = "2.9.0" }
retrofitGuavaAdapter = { module = "com.squareup.retrofit2:adapter-guava", version = "2.9.0" }
retrofitMock = { module = "com.squareup.retrofit2:retrofit-mock", version = "2.9.0" }
retrofitMoshi = { module = "com.squareup.retrofit2:converter-moshi", version = "2.9.0" }
retrofitWire = { module = "com.squareup.retrofit2:converter-wire", version = "2.9.0" }
retrofit = { module = "com.squareup.retrofit2:retrofit", version = "2.11.0" }
retrofitGuavaAdapter = { module = "com.squareup.retrofit2:adapter-guava", version = "2.11.0" }
retrofitMock = { module = "com.squareup.retrofit2:retrofit-mock", version = "2.11.0" }
retrofitMoshi = { module = "com.squareup.retrofit2:converter-moshi", version = "2.11.0" }
retrofitWire = { module = "com.squareup.retrofit2:converter-wire", version = "2.11.0" }
shadowJarPlugin = { module = "gradle.plugin.com.github.johnrengelman:shadow", version = "7.1.2" }
slf4jApi = { module = "org.slf4j:slf4j-api", version = "2.0.3" }
sqldelightGradlePlugin = { module = "app.cash.sqldelight:gradle-plugin", version.ref = "sqldelight" }
Expand All @@ -63,9 +63,9 @@ kotlinPoet = { module = "com.squareup:kotlinpoet", version = "1.18.1" }
kotlinReflection = { module = "org.jetbrains.kotlin:kotlin-reflect", version.ref = "kotlin" }
kotlinStdLib = { module = "org.jetbrains.kotlin:kotlin-stdlib", version.ref = "kotlin" }
kotlinTest = { module = "org.jetbrains.kotlin:kotlin-test", version.ref = "kotlin" }
kotlinxCoroutines = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-core", version = "1.6.3" }
kotlinxCoroutinesLogging = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-slf4j", version = "1.6.3" }
kotlinxCoroutinesTest = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-test", version = "1.6.3" }
kotlinxCoroutines = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-core", version = "1.9.0" }
kotlinxCoroutinesLogging = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-slf4j", version = "1.9.0" }
kotlinxCoroutinesTest = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-test", version = "1.9.0" }
kotlinxHtml = { module = "org.jetbrains.kotlinx:kotlinx-html-jvm", version = "0.12.0" }
misk = { module = "com.squareup.misk:misk", version.ref = "misk" }
miskActions = { module = "com.squareup.misk:misk-actions", version.ref = "misk" }
Expand Down
2 changes: 1 addition & 1 deletion service-self-backfill/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import com.vanniktech.maven.publish.KotlinJvm
import com.vanniktech.maven.publish.MavenPublishBaseExtension

plugins {
kotlin("jvm")
id("org.jetbrains.kotlin.jvm")
`java-library`
id("com.diffplug.spotless")
id("com.vanniktech.maven.publish.base")
Expand Down
2 changes: 1 addition & 1 deletion service/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import com.vanniktech.maven.publish.MavenPublishBaseExtension

plugins {
id("com.github.johnrengelman.shadow")
kotlin("jvm")
id("org.jetbrains.kotlin.jvm")
id("com.diffplug.spotless")
id("com.vanniktech.maven.publish.base")
id("com.squareup.wire")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,17 @@ class ViewLogsAction @Inject constructor(
fun viewLogs(
@PathParam id: Long,
): Response<ResponseBody> {
val url = transacter.transaction { session ->
val backfillRun = session.loadOrNull<DbBackfillRun>(Id(id))
?: throw BadRequestException("backfill $id doesn't exist")
viewLogsUrlProvider.getUrl(session, backfillRun)
}
val url = getUrl(id)
return Response(
body = "go to $url".toResponseBody(),
statusCode = HttpURLConnection.HTTP_MOVED_TEMP,
headers = Headers.headersOf("Location", url),
)
}

fun getUrl(id: Long) = transacter.transaction { session ->
val backfillRun = session.loadOrNull<DbBackfillRun>(Id(id))
?: throw BadRequestException("backfill $id doesn't exist")
viewLogsUrlProvider.getUrl(session, backfillRun)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -84,5 +84,6 @@ class BackfillShowButtonHandlerAction @Inject constructor(
companion object {
const val PATH = "/api/backfill/{id}/update"
fun path(id: String) = PATH.replace("{id}", id)
fun path(id: Long) = PATH.replace("{id}", id.toString())
}
}
Loading
Loading