Skip to content

Commit

Permalink
Version bumps
Browse files Browse the repository at this point in the history
  • Loading branch information
chrissearle committed Nov 20, 2024
1 parent d8464ae commit 13efe04
Show file tree
Hide file tree
Showing 13 changed files with 4,766 additions and 3,777 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ jobs:
- name: Checkout
uses: actions/checkout@v4

- name: Set up JDK 21
- name: Set up JDK
uses: actions/setup-java@v4
with:
java-version: '21'
java-version: '22'
distribution: 'temurin'

- name: Build
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM eclipse-temurin:21-jre
FROM eclipse-temurin:22-jre

RUN mkdir -p /opt/app
COPY build/libs/history.jar /opt/app
Expand Down
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ application {
}

kotlin {
jvmToolchain(21)
jvmToolchain(22)
}

repositories {
Expand Down
2 changes: 1 addition & 1 deletion docker-compose-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ services:
- discovery.type=single-node
- xpack.security.http.ssl.enabled=false
- xpack.license.self_generated.type=trial
image: docker.elastic.co/elasticsearch/elasticsearch:8.15.1
image: docker.elastic.co/elasticsearch/elasticsearch:8.16.0
mem_limit: 1gb
networks:
- history
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ services:
- discovery.type=single-node
- xpack.security.http.ssl.enabled=false
- xpack.license.self_generated.type=trial
image: docker.elastic.co/elasticsearch/elasticsearch:8.15.1
image: docker.elastic.co/elasticsearch/elasticsearch:8.16.0
8,460 changes: 4,730 additions & 3,730 deletions frontend/package-lock.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
"postinstall": "nuxt prepare"
},
"dependencies": {
"@nuxt/icon": "^1.5.6",
"@nuxt/icon": "^1.8.1",
"@nuxt/scripts": "^0.9.5",
"nuxt": "^3.13.0",
"nuxt": "^3.14.1592",
"vue": "latest",
"vue-router": "latest",
"vuetify-nuxt-module": "^0.18.3"
Expand Down
12 changes: 6 additions & 6 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@

[versions]
ktor-version = "2.3.12"
kotlin-version = "2.0.20"
logback-version = "1.5.8"
prometheus-version = "1.13.5"
ktor-version = "3.0.1"
kotlin-version = "2.0.21"
logback-version = "1.5.12"
prometheus-version = "1.14.1"
gradle_versions_filter_version = "0.1.16"
detekt_version = "1.23.7"
kotlinter_version = "4.4.1"
kotlinter_version = "4.5.0"
kotlin_logging_version = "7.0.0"
arrow_version = "1.2.4"
search_client_version = "2.2.2"
search_client_version = "2.3.1"
kotlinx_serialization_version = "1.7.3"
node_version = "7.1.0"

Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.11-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
2 changes: 1 addition & 1 deletion src/main/kotlin/no/java/conf/plugins/Monitoring.kt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import io.ktor.server.application.install
import io.ktor.server.metrics.micrometer.MicrometerMetrics
import io.ktor.server.plugins.callid.CallId
import io.ktor.server.plugins.callid.callIdMdc
import io.ktor.server.plugins.callloging.CallLogging
import io.ktor.server.plugins.calllogging.CallLogging
import io.ktor.server.request.path
import io.ktor.server.response.respond
import io.ktor.server.routing.get
Expand Down
10 changes: 4 additions & 6 deletions src/main/kotlin/no/java/conf/plugins/Respond.kt
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,22 @@ package no.java.conf.plugins

import arrow.core.Either
import io.ktor.http.HttpStatusCode
import io.ktor.server.application.ApplicationCall
import io.ktor.server.application.call
import io.ktor.server.response.respond
import io.ktor.server.response.respondRedirect
import io.ktor.util.pipeline.PipelineContext
import io.ktor.server.routing.RoutingContext
import no.java.conf.model.ApiError

context(PipelineContext<Unit, ApplicationCall>)
context(RoutingContext)
suspend inline fun <reified A : Any> Either<ApiError, A>.respond(status: HttpStatusCode = HttpStatusCode.OK) =
when (this) {
is Either.Left -> respond(value)
is Either.Right -> call.respond(status, value)
}

suspend fun PipelineContext<Unit, ApplicationCall>.respond(error: ApiError) =
suspend fun RoutingContext.respond(error: ApiError) =
call.respond(error.statusCode, error.messageMap())

context(PipelineContext<Unit, ApplicationCall>)
context(RoutingContext)
suspend inline fun <reified A : Any> Either<ApiError, A>.respondRedirect(url: String) =
when (this) {
is Either.Left -> respond(value)
Expand Down
25 changes: 0 additions & 25 deletions src/main/kotlin/no/java/conf/plugins/Security.kt
Original file line number Diff line number Diff line change
@@ -1,32 +1,7 @@
package no.java.conf.plugins

import io.ktor.server.application.Application
import io.ktor.server.application.call
import io.ktor.server.application.install
import io.ktor.server.response.respondText
import io.ktor.server.routing.get
import io.ktor.server.routing.routing
import io.ktor.server.sessions.Sessions
import io.ktor.server.sessions.cookie
import io.ktor.server.sessions.get
import io.ktor.server.sessions.sessions
import io.ktor.server.sessions.set

fun Application.configureSecurity() {
data class MySession(
val count: Int = 0,
)

install(Sessions) {
cookie<MySession>("MY_SESSION") {
cookie.extensions["SameSite"] = "lax"
}
}
routing {
get("/session/increment") {
val session = call.sessions.get<MySession>() ?: MySession()
call.sessions.set(session.copy(count = session.count + 1))
call.respondText("Counter is ${session.count}. Refresh to increment.")
}
}
}
16 changes: 16 additions & 0 deletions src/main/kotlin/no/java/conf/service/SearchService.kt
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,17 @@ class SearchService(
private var readyState = State.NEW

suspend fun setup() {
logger.debug { "Setting up SearchService" }

if (readyState != State.NEW) {
logger.debug { "Incorrect search state - was $readyState" }

return
}

if (!skipIndex) {
logger.debug { "Creating index" }

client.deleteIndex(INDEX_NAME, ignoreUnavailable = true)

client.createIndex(INDEX_NAME) {
Expand All @@ -98,15 +104,23 @@ class SearchService(
}
}

logger.debug { "State -> Mapped" }

readyState = State.MAPPED
}

suspend fun ingest(sessions: List<Session>) {
logger.debug { "Ingesting" }

if (readyState != State.MAPPED) {
logger.debug { "Incorrect search state - was $readyState" }

return
}

if (!skipIndex) {
logger.debug { "Bulk" }

val itemCallBack =
object : BulkItemCallBack {
override fun bulkRequestFailed(
Expand Down Expand Up @@ -151,6 +165,8 @@ class SearchService(
logger.info { "Indexing skipped" }
}

logger.debug { "State -> Indexed" }

readyState = State.INDEXED
}

Expand Down

0 comments on commit 13efe04

Please sign in to comment.