Skip to content

Commit

Permalink
[Th2 5119][TH2-5122] Added lwdp-utils lib with message searcher, upda…
Browse files Browse the repository at this point in the history
…ted grpc-service-generator (#74)
  • Loading branch information
Nikita-Smirnov-Exactpro authored Nov 10, 2023
1 parent 08d597d commit 8fb1c85
Show file tree
Hide file tree
Showing 21 changed files with 575 additions and 9 deletions.
19 changes: 19 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ jobs:
- 'gradle.properties'
grpc:
- 'grpc/gradle.properties'
utils:
- 'utils/gradle.properties'
build-and-publish-grpc-java:
name: Build and publish Java gRPC distributions
needs:
Expand All @@ -55,6 +57,23 @@ jobs:
project-path: grpc
secrets:
pypi_password: ${{ secrets.PYPI_PASSWORD }}

build-and-publish-utils:
name: Build and publish utils library
needs:
- changes
if: ${{ needs.changes.outputs.utils == 'true' }}
uses: th2-net/.github/.github/workflows/compaund-java-multi-project-build.yml@main
with:
projectPath: utils
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:
uses: th2-net/.github/.github/workflows/owasp-gradle-scan.yml@main
with:
Expand Down
12 changes: 12 additions & 0 deletions .github/workflows/dev-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,18 @@ jobs:
sonatypePassword: ${{ secrets.SONATYPE_NEXUS_PASSWORD }}
sonatypeSigningKey: ${{ secrets.SONATYPE_GPG_ARMORED_KEY }}
sonatypeSigningPassword: ${{ secrets.SONATYPE_SIGNING_PASSWORD }}
build-and-publish-utils:
name: Build and publish lw-data-provider-utils
uses: th2-net/.github/.github/workflows/compaund-java-multi-project-build.yml@main
with:
projectPath: utils
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 }}
build-and-publish-grpc-python:
name: Build and publish Python distributions to PyPI
needs:
Expand Down
38 changes: 37 additions & 1 deletion .github/workflows/dev-release-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ jobs:
- 'gradle.properties'
grpc:
- 'grpc/gradle.properties'
utils:
- 'utils/gradle.properties'
grpc-version:
name: Extract gRPC version
needs:
Expand All @@ -54,6 +56,14 @@ jobs:
uses: th2-net/.github/.github/workflows/compound-prebuild-java-workflow.yml@main
with:
project-path: grpc
utils-version:
name: Extract utils version
needs:
- changes
if: ${{ needs.changes.outputs.utils == 'true' }}
uses: th2-net/.github/.github/workflows/compound-prebuild-java-workflow.yml@main
with:
project-path: utils
build-and-publish-grpc-java:
name: Build and publish Java gRPC distributions
runs-on: 'ubuntu-20.04'
Expand All @@ -70,7 +80,7 @@ jobs:
- name: Setup Gradle
uses: gradle/gradle-build-action@v2
- name: Build with Gradle
run: ./gradlew --info -Pversion_suffix='dev' clean build publish closeAndReleaseSonatypeStagingRepository
run: ./gradlew -p grpc --info -Pversion_suffix='dev' clean build publish closeAndReleaseSonatypeStagingRepository
env:
ORG_GRADLE_PROJECT_sonatypeUsername: ${{ secrets.SONATYPE_NEXUS_USERNAME }}
ORG_GRADLE_PROJECT_sonatypePassword: ${{ secrets.SONATYPE_NEXUS_PASSWORD }}
Expand All @@ -91,6 +101,32 @@ jobs:
secrets:
pypi_password: ${{ secrets.PYPI_PASSWORD }}

build-and-publish-utils:
name: Build and publish utils library
runs-on: 'ubuntu-20.04'
needs:
- build-and-publish-grpc-java
- changes
if: |
always() &&
(needs.changes.outputs.utils == 'true' || needs.changes.outputs.grpc == 'true')
steps:
- uses: actions/checkout@v3
- 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 -p utils --info -Pversion_suffix='dev' clean build 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:
uses: th2-net/.github/.github/workflows/owasp-gradle-scan.yml@main
with:
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ derby.log
*.iml
*.iws
.idea
!.idea/copyright
*/build
out

Expand Down
3 changes: 3 additions & 0 deletions .idea/copyright/profiles_settings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/copyright/th2.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Lightweight data provider (2.4.1)
# Lightweight data provider (2.5.0)

# Overview
This component serves as a data provider for [th2-data-services](https://github.com/th2-net/th2-data-services). It will connect to the cassandra database via [cradle api](https://github.com/th2-net/cradleapi) and expose the data stored in there as REST resources.
Expand Down Expand Up @@ -224,6 +224,12 @@ spec:
# Release notes:
## 2.5.0
### Updated:
+ common: `5.7.1-dev`
+ grpc-lw-data-provider: `2.3.0`

## 2.4.1

### Fixed:
Expand Down
1 change: 0 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ plugins {
ext {
dockerImageVersion = release_version
cradleApiVersion = '5.1.4-dev'
commonVersion = '5.4.0-dev'
javalin = '5.4.2'
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ plugins {
group 'com.exactpro.th2'
version release_version

ext {
commonVersion = '5.7.1-dev'
}

sourceCompatibility = 11
targetCompatibility = 11

Expand All @@ -29,7 +33,7 @@ if (!suffix.isEmpty()) {
dependencies {
implementation platform('com.exactpro.th2:bom:4.5.0')
implementation 'org.slf4j:slf4j-api'
implementation 'io.github.microutils:kotlin-logging:2.1.23'
implementation 'io.github.microutils:kotlin-logging:3.0.5'

testImplementation('org.apache.logging.log4j:log4j-slf4j2-impl') {
because('logging in testing')
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

kotlin.code.style=official

release_version=2.4.1
release_version=2.5.0
description='th2 Lightweight data provider component'
vcs_url=https://github.com/th2-net/th2-lw-data-provider
docker_image_name=
Expand Down
9 changes: 8 additions & 1 deletion grpc/README.md
Original file line number Diff line number Diff line change
@@ -1 +1,8 @@
# gRPC for lw-data-provider
# gRPC for lw-data-provider (2.3.0)

## Release notes:

### 2.3.0

#### Updated:
+ grpc-service-generator: `3.5.1`
2 changes: 1 addition & 1 deletion grpc/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ plugins {
ext {
grpcVersion = '1.56.0'
protobufVersion = '3.23.2'
serviceGeneratorVersion = '3.4.0'
serviceGeneratorVersion = '3.5.1'
genBaseDir = file("${buildDir}/generated/source/proto") // from protobuf plugin
}

Expand Down
2 changes: 1 addition & 1 deletion grpc/gradle.properties
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
kotlin.code.style=official
release_version=2.2.0
release_version=2.3.0
2 changes: 1 addition & 1 deletion grpc/package_info.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"package_name": "th2_grpc_lw_data_provider",
"package_version": "2.2.0"
"package_version": "2.3.0"
}
2 changes: 2 additions & 0 deletions settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,10 @@
rootProject.name = 'lw-data-provider'

include 'grpc'
include 'utils'

project(':grpc').name = 'grpc-lw-data-provider'
project(':utils').name = 'lw-data-provider-utils'

dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
Expand Down
8 changes: 8 additions & 0 deletions utils/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# utils for lw-data-provider (0.0.1)

# Release notes:

# 0.0.1

## Feature:
+ Added MessageSearcher class
21 changes: 21 additions & 0 deletions utils/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
plugins {
id 'com.exactpro.th2.artifacts-convensions'
id 'java-library'
}

dependencies {
api project(':grpc-lw-data-provider')
implementation("com.exactpro.th2:common:${commonVersion}") {
exclude group: 'com.exactpro.th2', module: 'cradle-core'
exclude group: 'com.exactpro.th2', module: 'cradle-cassandra'
}

implementation 'io.github.microutils:kotlin-logging:3.0.5'

testImplementation 'org.mockito.kotlin:mockito-kotlin:5.1.0'
testImplementation 'org.jetbrains.kotlin:kotlin-test-junit5'
}

test {
useJUnitPlatform()
}
5 changes: 5 additions & 0 deletions utils/gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
kotlin.code.style=official
release_version=0.0.1

description='th2 Lightweight data provider utils'
vcs_url=https://github.com/th2-net/th2-lw-data-provider
Loading

0 comments on commit 8fb1c85

Please sign in to comment.