diff --git a/.github/workflows/dev-release-docker-publish.yml b/.github/workflows/build-dev-release.yml similarity index 60% rename from .github/workflows/dev-release-docker-publish.yml rename to .github/workflows/build-dev-release.yml index 290caef8..59d4309c 100644 --- a/.github/workflows/dev-release-docker-publish.yml +++ b/.github/workflows/build-dev-release.yml @@ -1,17 +1,14 @@ -name: Build and publish Docker distributions to Github Container Registry ghcr.io +name: Build and publish dev release Docker image to Github Container Registry ghcr.io -on: - workflow_dispatch: - push: - tags: - - \d+.\d+.\d+-dev +on: workflow_dispatch jobs: - build-job: + build: uses: th2-net/.github/.github/workflows/compound-java.yml@main with: build-target: 'Docker' - docker-username: ${{ github.actor }} devRelease: true + createTag: true + docker-username: ${{ github.actor }} secrets: docker-password: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/.github/workflows/build-release.yml b/.github/workflows/build-release.yml new file mode 100644 index 00000000..8f357426 --- /dev/null +++ b/.github/workflows/build-release.yml @@ -0,0 +1,14 @@ +name: Build and publish release Docker image to Github Container Registry ghcr.io + +on: workflow_dispatch + +jobs: + build: + uses: th2-net/.github/.github/workflows/compound-java.yml@main + with: + build-target: 'Docker' + devRelease: false + createTag: true + docker-username: ${{ github.actor }} + secrets: + docker-password: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/.github/workflows/dev-docker-publish.yml b/.github/workflows/build-sanpshot.yml similarity index 69% rename from .github/workflows/dev-docker-publish.yml rename to .github/workflows/build-sanpshot.yml index 858077b6..1618698e 100644 --- a/.github/workflows/dev-docker-publish.yml +++ b/.github/workflows/build-sanpshot.yml @@ -1,10 +1,13 @@ -name: Dev build and publish Docker distributions to Github Container Registry ghcr.io +name: Build and publish Docker image to Github Container Registry ghcr.io on: push: branches-ignore: - master - version-* + - dependabot** + paths-ignore: + - README.md jobs: build-job: diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml deleted file mode 100644 index 56d891de..00000000 --- a/.github/workflows/docker-publish.yml +++ /dev/null @@ -1,18 +0,0 @@ -name: Build and publish Docker distributions to Github Container Registry ghcr.io - -on: - push: - branches: - - master - - version-* - paths: - - gradle.properties - -jobs: - build-job: - uses: th2-net/.github/.github/workflows/compound-java.yml@main - with: - build-target: 'Docker' - docker-username: ${{ github.actor }} - secrets: - docker-password: ${{ secrets.GITHUB_TOKEN }} diff --git a/README.md b/README.md index 86c889fb..4db00367 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Report data provider (5.9.4) +# Report data provider (5.10.0) # Overview This component serves as a backend for rpt-viewer. It will connect to the cassandra database via cradle api and expose the data stored in there as REST resources. @@ -295,6 +295,12 @@ spec: # Release notes +## 5.10.0 ++ Updated cradle api: `5.2.0-dev` ++ Updated common: `5.8.0-dev` ++ Updated common-utils: `2.2.2-dev` ++ Disabled unsupported [Cassandra driver metrics](https://docs.datastax.com/en/developer/java-driver/4.10/manual/core/metrics/) + ## 5.9.4 + Fix problem with incorrect events order when requesting search in previous direction diff --git a/build.gradle b/build.gradle index 30c3bd44..17dcb9ed 100644 --- a/build.gradle +++ b/build.gradle @@ -7,7 +7,7 @@ plugins { id 'org.jetbrains.kotlin.jvm' version '1.8.22' id 'application' id 'com.palantir.docker' version '0.25.0' - id "org.owasp.dependencycheck" version "8.3.1" + id "org.owasp.dependencycheck" version "9.0.9" id "com.gorylenko.gradle-git-properties" version "2.4.1" id 'com.github.jk1.dependency-license-report' version '2.5' id "de.undercouch.download" version "5.4.0" @@ -15,7 +15,7 @@ plugins { ext { dockerImageVersion = release_version - cradleVersion = '5.1.4-dev' + cradleVersion = '5.2.0-dev' } group 'com.exactpro.th2' @@ -47,11 +47,11 @@ dependencies { implementation 'org.apache.commons:commons-lang3' - implementation('com.exactpro.th2:common:5.4.0-dev') { + implementation('com.exactpro.th2:common:5.8.0-dev') { exclude group: 'com.exactpro.th2', module: 'cradle-core' exclude group: 'com.exactpro.th2', module: 'cradle-cassandra' } - implementation 'com.exactpro.th2:common-utils:2.2.0-dev' + implementation 'com.exactpro.th2:common-utils:2.2.2-dev' implementation "com.exactpro.th2:cradle-core:${cradleVersion}" @@ -73,10 +73,10 @@ dependencies { testImplementation('org.jetbrains.kotlin:kotlin-reflect') { because('mockk needs it') } - testImplementation 'org.junit.jupiter:junit-jupiter-api:5.10.0' - testImplementation "org.junit.jupiter:junit-jupiter-params:5.10.0" + testImplementation 'org.junit.jupiter:junit-jupiter-api:5.10.2' + testImplementation "org.junit.jupiter:junit-jupiter-params:5.10.2" - testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.10.0' + testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.10.2' } tasks.withType(KotlinCompile).configureEach { diff --git a/gradle.properties b/gradle.properties index de8c8757..c6d83db7 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,5 +1,5 @@ ################################################################################ -# Copyright 2009-2023 Exactpro (Exactpro Systems Limited) +# Copyright 2009-2024 Exactpro (Exactpro Systems Limited) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -16,6 +16,6 @@ kotlin.code.style=official -release_version=5.9.4 +release_version=5.10.0 -docker_image_name= \ No newline at end of file +docker_image_name= diff --git a/src/main/kotlin/com/exactpro/th2/rptdataprovider/services/rabbitmq/RabbitMqService.kt b/src/main/kotlin/com/exactpro/th2/rptdataprovider/services/rabbitmq/RabbitMqService.kt index a4281cf0..b58176e8 100644 --- a/src/main/kotlin/com/exactpro/th2/rptdataprovider/services/rabbitmq/RabbitMqService.kt +++ b/src/main/kotlin/com/exactpro/th2/rptdataprovider/services/rabbitmq/RabbitMqService.kt @@ -182,7 +182,7 @@ abstract class RabbitMqService( } K_LOGGER.error(e) { "unexpected exception while trying to send a codec request" } } - }.also { K_LOGGER.info { "${request.requestId} mqRequestSenderScope ${it}ms" } } + }.also { K_LOGGER.debug { "${request.requestId} mqRequestSenderScope ${it}ms" } } } pendingRequest diff --git a/src/main/resources/application.conf b/src/main/resources/application.conf index 829ea8f5..cc05c64f 100644 --- a/src/main/resources/application.conf +++ b/src/main/resources/application.conf @@ -1,5 +1,5 @@ ################################################################################ -# Copyright 2021-2023 Exactpro (Exactpro Systems Limited) +# Copyright 2021-2024 Exactpro (Exactpro Systems Limited) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -28,20 +28,12 @@ datastax-java-driver { cql-requests, cql-client-timeouts, cql-prepared-cache-size, - throttling.delay, - throttling.queue-size, - throttling.errors ] cql-requests { highest-latency = 3 seconds significant-digits = 3 refresh-interval = 5 minutes } - throttling.delay { - highest-latency = 3 seconds - significant-digits = 3 - refresh-interval = 5 minutes - } } node { diff --git a/src/test/kotlin/handlers/events/TestEventPipeline.kt b/src/test/kotlin/handlers/events/TestEventPipeline.kt index 736181fd..5b779d98 100644 --- a/src/test/kotlin/handlers/events/TestEventPipeline.kt +++ b/src/test/kotlin/handlers/events/TestEventPipeline.kt @@ -1,5 +1,5 @@ /* - * Copyright 2022-2023 Exactpro (Exactpro Systems Limited) + * Copyright 2022-2024 Exactpro (Exactpro Systems Limited) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -63,7 +63,7 @@ class TestEventPipeline { private val endTimestamp = Instant.parse("2022-04-21T01:15:00Z") private val batchSize = 4096 - private val pageId = PageId(BookId("testBook"), "testPage") + private val pageId = PageId(BookId("testBook"), startTimestamp,"testPage") private val scope = "testScope" private val eventsFromStartToEnd11 = createEvents("1", startTimestamp, endTimestamp) diff --git a/src/test/kotlin/handlers/messages/ExtractorTest.kt b/src/test/kotlin/handlers/messages/ExtractorTest.kt index a217bd1f..1d5ea1a9 100644 --- a/src/test/kotlin/handlers/messages/ExtractorTest.kt +++ b/src/test/kotlin/handlers/messages/ExtractorTest.kt @@ -1,5 +1,5 @@ /* - * Copyright 2022-2023 Exactpro (Exactpro Systems Limited) + * Copyright 2022-2024 Exactpro (Exactpro Systems Limited) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -37,6 +37,7 @@ import com.exactpro.th2.rptdataprovider.services.cradle.CradleService import io.mockk.coEvery import io.mockk.every import io.mockk.mockk +import kotlinx.coroutines.DelicateCoroutinesApi import kotlinx.coroutines.GlobalScope import kotlinx.coroutines.cancelChildren import kotlinx.coroutines.channels.Channel @@ -65,7 +66,7 @@ class ExtractorTest { private val baseStreamName = "test_stream" private val streamDirection = "FIRST" - private val BOOK = BookId("") + private val bookId = BookId("") private val fullStreamName = "${baseStreamName}:${streamDirection}" private val streamNameObject = StreamName(baseStreamName, Direction.valueOf(streamDirection), BookId("")) @@ -93,7 +94,7 @@ class ExtractorTest { "direction" to listOf(streamDirection), "startTimestamp" to listOf(startTimestamp.toEpochMilli().toString()), "endTimestamp" to listOf(endTimestamp.toEpochMilli().toString()), - "bookId" to listOf(BOOK.name) + "bookId" to listOf(bookId.name) ) if (resumeId != null) { parameters["messageId"] = listOf(resumeId.toString()) @@ -113,10 +114,10 @@ class ExtractorTest { every { msg.sessionAlias } answers { fullStreamName } every { msg.protocol } answers { "protocol" } every { msg.direction } answers { Direction.FIRST } - every { msg.getContent() } answers { byteArrayOf(1, 1, 1) } - every { msg.getId() } answers { + every { msg.content } answers { byteArrayOf(1, 1, 1) } + every { msg.id } answers { StoredMessageId( - BOOK, + bookId, baseStreamName, Direction.valueOf(streamDirection), timestamp, @@ -128,6 +129,7 @@ class ExtractorTest { return msg } + @OptIn(DelicateCoroutinesApi::class) private fun mockContextWithCradleService(batch: StoredMessageBatch): ProtoContext { val context: ProtoContext = mockk() @@ -187,7 +189,7 @@ class ExtractorTest { startTimestamp = endTimestamp.plusNanos(1) } - return StoredMessageBatch(allMessages, PageId(BookId("1"), "1"), Instant.now()) + return StoredMessageBatch(allMessages, PageId(BookId("1"), start,"1"), Instant.now()) } @@ -250,7 +252,7 @@ class ExtractorTest { allMessages.add(getMessage(endTimestamp, index)) - return StoredMessageBatch(allMessages, PageId(BookId("1"), "1"), Instant.now()) + return StoredMessageBatch(allMessages, PageId(BookId("1"), startTimestamp, "1"), Instant.now()) } private fun testBorders(