Skip to content

Commit

Permalink
Merge pull request #22 from th2-net/dev-version-2
Browse files Browse the repository at this point in the history
  • Loading branch information
Nikita-Smirnov-Exactpro authored May 15, 2024
2 parents 92a22b4 + b8cb56c commit f886c92
Show file tree
Hide file tree
Showing 26 changed files with 962 additions and 344 deletions.
15 changes: 15 additions & 0 deletions .github/workflows/build-dev-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: Build and publish dev 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: true
createTag: true
docker-username: ${{ github.actor }}
secrets:
docker-password: ${{ secrets.GITHUB_TOKEN }}
nvd-api-key: ${{ secrets.NVD_APIKEY }}
Original file line number Diff line number Diff line change
@@ -1,20 +1,15 @@
name: Build and publish Docker distributions to Github Container Registry ghcr.io
name: Build and publish release Docker image to Github Container Registry ghcr.io

on:
push:
branches:
- master
- version-*
paths:
- gradle.properties
# - package_info.json
on: workflow_dispatch

jobs:
build-job:
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 }}

nvd-api-key: ${{ secrets.NVD_APIKEY }}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
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:
Expand All @@ -17,3 +17,4 @@ jobs:
docker-username: ${{ github.actor }}
secrets:
docker-password: ${{ secrets.GITHUB_TOKEN }}
nvd-api-key: ${{ secrets.NVD_APIKEY }}
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
FROM gradle:6.6-jdk11 AS build
FROM gradle:7.6-jdk11 AS build
ARG release_version
COPY ./ .
RUN gradle clean build dockerPrepare -Prelease_version=${release_version}

FROM adoptopenjdk/openjdk11:alpine
WORKDIR /home
COPY --from=build /home/gradle/build/docker .
ENTRYPOINT ["/home/service/bin/service"]
ENTRYPOINT ["/home/service/bin/service"]
61 changes: 50 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Csv Reader User Manual 1.2.1
# Csv Reader User Manual 2.4.0

## Document Information

Expand All @@ -17,22 +17,22 @@ Csv reader read csv files, results are sending to RabbitMQ.
##### Reader configuration

```yaml
apiVersion: th2.exactpro.com/v1
apiVersion: th2.exactpro.com/v2
kind: Th2Box
metadata:
name: read-csv
spec:
image-name: ghcr.io/th2-net/th2-read-csv
image-version: <image version>
imageName: ghcr.io/th2-net/th2-read-csv
imageVersion: <image version>
type: th2-read
custom-config:
customConfig:
sourceDirectory: "dir/with/csv/"
aliases:
A:
nameRegexp: "fileA.*\\.log"
nameRegexp: "fileA.*\\.csv"
# delimiter: ","
B:
nameRegexp: "fileB.*\\.log"
nameRegexp: "fileB.*\\.csv"
delimiter: ";"
header: ['ColumnA', 'ColumnB', 'ColumnC']
common:
Expand All @@ -46,11 +46,15 @@ spec:
pullingInterval: "PT5S"
validateContent: true
validateOnlyExtraData: false
useTransport: true
pins:
- name: read_csv_out
connection-type: mq
attributes: ['raw', 'publish', 'store']
extended-settings:
mq:
publishers:
- name: to_mstore
attributes:
- publish
- transport-group
extendedSettings:
service:
enabled: false
envVariables:
Expand Down Expand Up @@ -83,9 +87,44 @@ spec:
The default value is `true`;
+ validateOnlyExtraData - disables validation when the content size is less than the header size (probably some columns were not set on purpose).
Works only with `validateContent` set to `true`. The default value is `false`
+ useTransport - enables using th2 transport protocol. The default value is `true`

## Changes

### 2.4.0

#### Updated:
+ Migrate to th2 gradle plugin `0.0.6`
+ bom: `4.6.1`
+ common: `5.11.0-dev`
+ read-file-common-core: `3.3.0-dev`
+ jakarta.annotation-api: `3.0.0`

### 2.3.0

#### Updated:
* read-file-common-core: `3.2.0-dev`
*
### 2.2.0

#### Fixed:
read-csv throws the IndexOutOfBoundsException when it works in `useTransport` mode and calculates header by the first line in a CSV file

#### Changed:
* Default value for `useTransport` option is `true`

#### Added:
* netty-bytebuf-utils: `0.2.0`

#### Updated:
* common: `5.7.1-dev`
* read-file-common-core: `3.1.0-dev`
* opencsv: `5.9`

### 2.1.0

+ th2 transport protocol support

### 1.2.1
+ Updated `bom` from 4.1.0 to 4.2.0
+ Updated `common` form 3.44.0 to 3.44.1
Expand Down
102 changes: 23 additions & 79 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,38 +1,18 @@
/*
* Copyright 2020-2020 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.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

plugins {
id 'java-library'
id 'application'
id 'com.palantir.docker' version '0.25.0'
id 'org.jetbrains.kotlin.jvm' version '1.6.21'
id "org.owasp.dependencycheck" version "8.1.0"
}

dependencyCheck {
format='HTML'
failBuildOnCVSS=5
id 'org.jetbrains.kotlin.jvm' version '1.8.22'
id 'com.exactpro.th2.gradle.component' version '0.0.6'
}

group 'com.exactpro.th2'
version release_version

kotlin {
jvmToolchain(11)
}

repositories {
mavenCentral()

maven {
name 'Sonatype_snapshots'
url 'https://s01.oss.sonatype.org/content/repositories/snapshots/'
Expand All @@ -41,82 +21,46 @@ repositories {
name 'Sonatype_releases'
url 'https://s01.oss.sonatype.org/content/repositories/releases/'
}

mavenLocal()

configurations.all {
configurations.configureEach {
resolutionStrategy.cacheChangingModulesFor 0, 'seconds'
resolutionStrategy.cacheDynamicVersionsFor 0, 'seconds'
}
}

dependencies {
api platform('com.exactpro.th2:bom:4.2.0')
implementation ('com.exactpro.th2:common:3.44.1') {
exclude group: 'com.fasterxml.jackson.dataformat', module: 'jackson-dataformat-yaml' // because of the vulnerability
exclude group: 'org.slf4j', module: 'slf4j-log4j12' // because of the vulnerability
implementation ("com.exactpro.th2:common:5.11.0-dev")
implementation "org.slf4j:slf4j-api"

api "com.exactpro.th2:read-file-common-core:3.3.0-dev"
implementation('com.exactpro.th2:netty-bytebuf-utils:0.2.0') {
because("'asExpandable' method is used")
}
api 'com.exactpro.th2:read-file-common-core:1.5.1'
implementation 'com.opencsv:opencsv:5.7.0'

implementation 'javax.annotation:javax.annotation-api:1.3.2'
implementation "org.jetbrains.kotlin:kotlin-stdlib"
implementation "com.opencsv:opencsv:5.9"

implementation 'jakarta.annotation:jakarta.annotation-api:3.0.0'
implementation "org.jetbrains.kotlin:kotlin-reflect"

implementation 'com.fasterxml.jackson.core:jackson-databind'
implementation('com.fasterxml.jackson.datatype:jackson-datatype-jsr310') {
implementation "com.fasterxml.jackson.core:jackson-databind"
implementation("com.fasterxml.jackson.datatype:jackson-datatype-jsr310") {
because("Deserialization of java.time.Duration")
}
implementation 'com.fasterxml.jackson.module:jackson-module-kotlin'
implementation "com.fasterxml.jackson.module:jackson-module-kotlin"

testImplementation 'org.junit.jupiter:junit-jupiter:5.6.2'
testImplementation 'org.mockito:mockito-core:3.6.0'
testImplementation "org.junit.jupiter:junit-jupiter:5.10.2"
testImplementation "org.mockito:mockito-core:5.12.0"
}

test {
useJUnitPlatform()
}

jar {
manifest {
attributes(
'Created-By': "${System.getProperty('java.version')} (${System.getProperty('java.vendor')})",
'Specification-Title': '',
'Specification-Vendor': 'Exactpro Systems LLC',
'Implementation-Title': project.archivesBaseName,
'Implementation-Vendor': 'Exactpro Systems LLC',
'Implementation-Vendor-Id': 'com.exactpro',
'Implementation-Version': project.version
)
}
}

description = 'CSV reader client'
sourceCompatibility = '11'
applicationName = 'service'

distTar {
archiveName "${applicationName}.tar"
}

dockerPrepare {
dependsOn distTar
}

docker {
copySpec.from(tarTree("$buildDir/distributions/${applicationName}.tar"))
}

application {
mainClassName = "com.exactpro.th2.readcsv.Main"
}

dependencyCheck {
formats=['SARIF', 'JSON', 'HTML']
failBuildOnCVSS=5

analyzers {
assemblyEnabled = false
nugetconfEnabled = false
nodeEnabled = false
}}
suppressionFile = file('suppressions.xml')
}
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
release_version=1.2.1
release_version = 2.4.0
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading

0 comments on commit f886c92

Please sign in to comment.