Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
Nikita-Smirnov-Exactpro committed Apr 8, 2024
2 parents 653db09 + 1bcab2c commit 049ec9d
Show file tree
Hide file tree
Showing 37 changed files with 1,181 additions and 139 deletions.
46 changes: 44 additions & 2 deletions .github/workflows/build-dev-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ jobs:
app: ${{ steps.filter.outputs.app }}
grpc: ${{ steps.filter.outputs.grpc }}
core: ${{ steps.filter.outputs.core }}
oracle: ${{ steps.filter.outputs.oracle }}
steps:
- uses: actions/checkout@v3
- uses: dorny/paths-filter@v2
Expand All @@ -41,6 +42,8 @@ jobs:
- 'grpc/gradle.properties'
core:
- 'core/gradle.properties'
oracle:
- 'oracle/gradle.properties'
grpc-version:
name: Extract grpc version
uses: th2-net/.github/.github/workflows/compound-prebuild-java-workflow.yml@main
Expand All @@ -51,6 +54,11 @@ jobs:
uses: th2-net/.github/.github/workflows/compound-prebuild-java-workflow.yml@main
with:
project-path: app
oracle-version:
name: Extract oracle version
uses: th2-net/.github/.github/workflows/compound-prebuild-java-workflow.yml@main
with:
project-path: oracle

build-and-publish-grpc-java:
name: Build and publish Java gRPC distributions
Expand Down Expand Up @@ -112,6 +120,32 @@ jobs:
ORG_GRADLE_PROJECT_sonatypePassword: ${{ secrets.SONATYPE_NEXUS_PASSWORD }}
ORG_GRADLE_PROJECT_signingKey: ${{ secrets.SONATYPE_GPG_ARMORED_KEY }}
ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.SONATYPE_SIGNING_PASSWORD }}

build-and-publish-oracle-extension-java:
name: Build and publish Java oracle extension distributions
runs-on: 'ubuntu-20.04'
needs:
- build-and-publish-core-java
- changes
if: |
always() &&
(needs.changes.outputs.oracle == 'true' || needs.changes.outputs.core == 'true')
steps:
- uses: actions/checkout@v4
- name: Set up JDK 'zulu' '11'
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: '11'
- name: Setup Gradle
uses: gradle/gradle-build-action@v2
- name: Build with Gradle
run: ./gradlew --info -Pversion_suffix='dev' clean build :read-db-oracle-extension:publish closeAndReleaseSonatypeStagingRepository
env:
ORG_GRADLE_PROJECT_sonatypeUsername: ${{ secrets.SONATYPE_NEXUS_USERNAME }}
ORG_GRADLE_PROJECT_sonatypePassword: ${{ secrets.SONATYPE_NEXUS_PASSWORD }}
ORG_GRADLE_PROJECT_signingKey: ${{ secrets.SONATYPE_GPG_ARMORED_KEY }}
ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.SONATYPE_SIGNING_PASSWORD }}
owasp-scan:
if: "!cancelled()"
uses: th2-net/.github/.github/workflows/owasp-gradle-scan.yml@main
Expand All @@ -122,11 +156,11 @@ jobs:
publish-docker:
name: Build and publish docker image
needs:
- build-and-publish-core-java
- build-and-publish-oracle-extension-java
- app-version
- changes
if: |
(needs.changes.outputs.app == 'true' || needs.changes.outputs.grpc == 'true' || needs.changes.outputs.core == 'true')
(needs.changes.outputs.app == 'true' || needs.changes.outputs.grpc == 'true' || needs.changes.outputs.core == 'true' || needs.changes.outputs.oracle == 'true')
&& !cancelled()
uses: th2-net/.github/.github/workflows/compaund-java-docker-push.yml@main
with:
Expand Down Expand Up @@ -157,6 +191,14 @@ jobs:
with:
runsOn: ${{ inputs.runsOn }}
tagName: ${{ needs.grpc-version.outputs.version }}-grpc-dev
create-oracle-tag:
if: needs.build-and-publish-oracle-extension-java.result == 'success'&& !cancelled()
name: Create and push oracle extension tag
needs: [ build-and-publish-oracle-extension-java ]
uses: th2-net/.github/.github/workflows/compaund-git-tag-push.yml@main
with:
runsOn: ${{ inputs.runsOn }}
tagName: ${{ needs.oracle-version.outputs.version }}-oracle-dev
create-app-tag:
if: needs.publish-docker.result == 'success' && needs.build-and-publish-core-java.result == 'success' && !cancelled()
name: Create and push app tag
Expand Down
35 changes: 34 additions & 1 deletion .github/workflows/build-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ jobs:
uses: th2-net/.github/.github/workflows/compound-prebuild-java-workflow.yml@main
with:
project-path: grpc
oracle-version:
name: Extract app version
uses: th2-net/.github/.github/workflows/compound-prebuild-java-workflow.yml@main
with:
project-path: oracle
app-version:
name: Extract app version
uses: th2-net/.github/.github/workflows/compound-prebuild-java-workflow.yml@main
Expand All @@ -20,6 +25,7 @@ jobs:
app: ${{ steps.filter.outputs.app }}
grpc: ${{ steps.filter.outputs.grpc }}
core: ${{ steps.filter.outputs.core }}
oracle: ${{ steps.filter.outputs.oracle }}
steps:
- uses: dorny/paths-filter@v2
id: filter
Expand All @@ -31,6 +37,8 @@ jobs:
- 'grpc/gradle.properties'
core:
- 'core/gradle.properties'
oracle:
- 'oracle/gradle.properties'
build-and-publish-grpc-java:
name: Build and publish Java gRPC distributions
needs:
Expand Down Expand Up @@ -72,6 +80,22 @@ jobs:
sonatypePassword: ${{ secrets.SONATYPE_NEXUS_PASSWORD }}
sonatypeSigningKey: ${{ secrets.SONATYPE_GPG_ARMORED_KEY }}
sonatypeSigningPassword: ${{ secrets.SONATYPE_SIGNING_PASSWORD }}
build-and-publish-oracle-extension-java:
name: Build and publish Java oracle extension distributions
needs:
- changes
- build-and-publish-core-java
if: ${{ needs.changes.outputs.oracle == 'true' }}
uses: th2-net/.github/.github/workflows/compaund-java-multi-project-build-release.yml@main
with:
projectPath: oracle
release: true
additionalTasks: '["publish"]'
secrets:
sonatypeUsername: ${{ secrets.SONATYPE_NEXUS_USERNAME }}
sonatypePassword: ${{ secrets.SONATYPE_NEXUS_PASSWORD }}
sonatypeSigningKey: ${{ secrets.SONATYPE_GPG_ARMORED_KEY }}
sonatypeSigningPassword: ${{ secrets.SONATYPE_SIGNING_PASSWORD }}
owasp-scan:
if: "!cancelled()"
uses: th2-net/.github/.github/workflows/owasp-gradle-scan.yml@main
Expand All @@ -82,12 +106,13 @@ jobs:
publish-docker:
name: Build and publish docker image
if: |
(needs.changes.outputs.app == 'true' || needs.changes.outputs.grpc == 'true' || needs.changes.outputs.core == 'true')
(needs.changes.outputs.app == 'true' || needs.changes.outputs.grpc == 'true' || needs.changes.outputs.core == 'true' || needs.changes.outputs.oracle == 'true')
&& !cancelled()
needs:
- build-and-publish-grpc-python
- build-and-publish-grpc-java
- build-and-publish-core-java
- build-and-publish-oracle-extension-java
- app-version
uses: th2-net/.github/.github/workflows/compaund-java-docker-push.yml@main
with:
Expand Down Expand Up @@ -118,6 +143,14 @@ jobs:
with:
runsOn: ${{ inputs.runsOn }}
tagName: ${{ needs.grpc-version.outputs.version }}-grpc
create-oracle-tag:
if: needs.build-and-publish-oracle-extension-java.result == 'success' && !cancelled()
name: Create and push oracle extension tag
needs: [ build-and-publish-oracle-extension-java ]
uses: th2-net/.github/.github/workflows/compaund-git-tag-push.yml@main
with:
runsOn: ${{ inputs.runsOn }}
tagName: ${{ needs.oracle-version.outputs.version }}-oracle
create-app-tag:
if: needs.publish-docker.result == 'success' && needs.build-and-publish-core-java.result == 'success' && !cancelled()
name: Create and push app tag
Expand Down
12 changes: 12 additions & 0 deletions .github/workflows/build-sanpshot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,18 @@ jobs:
sonatypePassword: ${{ secrets.SONATYPE_NEXUS_PASSWORD }}
sonatypeSigningKey: ${{ secrets.SONATYPE_GPG_ARMORED_KEY }}
sonatypeSigningPassword: ${{ secrets.SONATYPE_SIGNING_PASSWORD }}
build-and-publish-oracle-extension-java:
name: Build and publish Java oracle extension distributions
uses: th2-net/.github/.github/workflows/compaund-java-multi-project-build.yml@main
with:
projectPath: oracle
additionalTasks: '["publish"]'
release: false
secrets:
sonatypeUsername: ${{ secrets.SONATYPE_NEXUS_USERNAME }}
sonatypePassword: ${{ secrets.SONATYPE_NEXUS_PASSWORD }}
sonatypeSigningKey: ${{ secrets.SONATYPE_GPG_ARMORED_KEY }}
sonatypeSigningPassword: ${{ secrets.SONATYPE_SIGNING_PASSWORD }}
owasp-scan:
if: "!cancelled()"
uses: th2-net/.github/.github/workflows/owasp-gradle-scan.yml@main
Expand Down
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# th2-read-db 0.9.0
# th2-read-db 0.9.1

The read-db is a component for extracting data from databases using JDBC technology. If database has JDBC driver the read can work with the database

Expand Down Expand Up @@ -339,6 +339,10 @@ spec:

## Changes

### 0.9.1

+ fixed the pull continuation failure when column with oracle DATE type is used for update query.

### 0.9.0

+ implemented gRPC backpressure for the `Execute` method
Expand Down
24 changes: 18 additions & 6 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
plugins {
id("application")
id("com.exactpro.th2.gradle.component")
alias(libs.plugins.th2.component)
}

configurations.all {
Expand All @@ -11,17 +11,29 @@ configurations.all {
dependencies {
implementation(project(":read-db-core"))

//region Drivers
runtimeOnly("org.postgresql:postgresql:42.7.3") {
//region postgresql
runtimeOnly(libs.postgresql) {
because("prostresql support")
}
runtimeOnly("com.mysql:mysql-connector-j:8.3.0") {
//endregion

//region mysql
runtimeOnly(libs.mysql.connector.j) {
because("mysql support")
}
runtimeOnly("com.oracle.database.jdbc:ojdbc11:23.3.0.23.09") {
//endregion

//region oracle
runtimeOnly(libs.ojdbc11) {
because("oracle support")
}
runtimeOnly(project(":read-db-oracle-extension")) {
because("oracle support")
}
runtimeOnly("com.microsoft.sqlserver:mssql-jdbc:12.4.0.jre11") {
//endregion

//region mssql
runtimeOnly(libs.mssql.jdbc) {
because("mssql support")
}
//endregion
Expand Down
2 changes: 1 addition & 1 deletion app/gradle.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
kotlin.code.style=official
release_version=0.9.0
release_version=0.9.1
description=read-db component for extracting data from databases using JDBC technology
11 changes: 6 additions & 5 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
plugins {
id("com.exactpro.th2.gradle.base") version "0.0.4"
id("com.exactpro.th2.gradle.publish") version "0.0.4"
alias(libs.plugins.th2.base)
alias(libs.plugins.th2.publish)

kotlin("jvm") version "1.8.22" apply false
id("com.exactpro.th2.gradle.grpc") version "0.0.4" apply false
id("com.exactpro.th2.gradle.component") version "0.0.4" apply false
alias(libs.plugins.kotlin) apply false
alias(libs.plugins.kapt) apply false
alias(libs.plugins.th2.grpc) apply false
alias(libs.plugins.th2.component) apply false
}

allprojects {
Expand Down
39 changes: 19 additions & 20 deletions core/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
plugins {
kotlin("jvm")
id("java-library")
id("maven-publish")
alias(libs.plugins.kotlin)
`java-library`
`maven-publish`
}

val coroutinesVersion by extra("1.7.3")

kotlin {
jvmToolchain(11)
}
Expand All @@ -18,43 +16,44 @@ configurations.all {
dependencies {
implementation(project(":grpc-read-db"))

implementation("com.exactpro.th2:common:5.10.0-dev")
implementation("com.exactpro.th2:common-utils:2.2.2-dev")
implementation("com.exactpro.th2:lw-data-provider-utils:0.0.1-dev")
implementation(libs.th2.common)
implementation(libs.th2.common.utils)
implementation(libs.th2.lw.data.provider.utils)

implementation("org.slf4j:slf4j-api")

implementation("org.apache.commons:commons-dbcp2:2.9.0") {
implementation(libs.commons.dbcp2) {
because("connection pool")
}
implementation("org.apache.commons:commons-text")
implementation("com.opencsv:opencsv:5.9") {
implementation(libs.opencsv) {
because("publishes raw messages in csv format")
}

implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutinesVersion")
implementation("io.github.microutils:kotlin-logging:3.0.5")
implementation(libs.kotlinx.coroutines.core)
implementation(libs.kotlin.logging)
implementation(libs.kotlin.logging)
implementation("com.fasterxml.jackson.core:jackson-databind")

testImplementation("org.junit.jupiter:junit-jupiter:5.10.0")
testImplementation(libs.junit.jupiter)
testImplementation("org.jetbrains.kotlin:kotlin-test-junit")
testImplementation("org.jetbrains.kotlinx:kotlinx-coroutines-test:$coroutinesVersion")
testImplementation("org.mockito.kotlin:mockito-kotlin:5.1.0")
testImplementation("io.strikt:strikt-core:0.34.1")
testImplementation(libs.kotlinx.coroutines.test)
testImplementation(libs.mockito.kotlin)
testImplementation(libs.strikt.core)

testImplementation(platform("org.testcontainers:testcontainers-bom:1.19.7"))
testImplementation(platform(libs.testcontainers.bom))
testImplementation("org.testcontainers:testcontainers")
testImplementation("org.testcontainers:mysql")
testImplementation("org.testcontainers:oracle-xe")
testImplementation("io.grpc:grpc-testing")
testImplementation("io.grpc:grpc-inprocess")

testImplementation("com.exactpro.th2:junit-jupiter-integration:0.0.1")
testImplementation(libs.th2.junit.jupiter.integration)

testRuntimeOnly("com.mysql:mysql-connector-j:8.3.0") {
testRuntimeOnly(libs.mysql.connector.j) {
because("mysql support")
}
testRuntimeOnly("com.oracle.database.jdbc:ojdbc11:23.3.0.23.09") {
testRuntimeOnly(libs.ojdbc11) {
because("oracle support")
}
}
Expand Down
2 changes: 1 addition & 1 deletion core/gradle.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
kotlin.code.style=official
release_version=0.9.0
release_version=0.9.1
description=core part of read db to create an application with required JDBC drivers in the classpath
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import com.exactpro.th2.read.db.core.RowListener
import com.exactpro.th2.read.db.core.TableRow
import com.exactpro.th2.read.db.core.TaskId
import com.exactpro.th2.read.db.core.UpdateListener
import com.exactpro.th2.read.db.core.ValueTransformProvider
import com.exactpro.th2.read.db.core.impl.DataBaseMonitorServiceImpl
import com.exactpro.th2.read.db.core.impl.DataBaseServiceImpl
import com.exactpro.th2.read.db.core.impl.BaseDataSourceProvider
Expand Down Expand Up @@ -210,7 +211,8 @@ class DataBaseReader(
): DataBaseReader {
val sourceProvider: DataSourceProvider = BaseDataSourceProvider(configuration.dataSources)
val queryProvider: QueryProvider = BaseQueryProvider(configuration.queries)
val dataBaseService: DataBaseService = DataBaseServiceImpl(sourceProvider, queryProvider)
val transformProvider: ValueTransformProvider = ValueTransformProvider.create(configuration.dataSources)
val dataBaseService: DataBaseService = DataBaseServiceImpl(sourceProvider, queryProvider, transformProvider)
val hashService: HashService = BaseHashServiceImpl(sourceProvider, queryProvider)
val monitorService: DataBaseMonitorService = DataBaseMonitorServiceImpl(dataBaseService, hashService, clock)
return DataBaseReader(
Expand Down
Loading

0 comments on commit 049ec9d

Please sign in to comment.