From d2d2213d4c4bb999a7d6c31844087cfcfea3bca0 Mon Sep 17 00:00:00 2001 From: "fiodar.rekish" Date: Fri, 21 Oct 2022 12:53:55 +0400 Subject: [PATCH 1/5] [TH2-4347] dependency update --- .github/workflows/dev-docker-publish.yml | 40 +++--------------------- build.gradle | 8 ++--- 2 files changed, 7 insertions(+), 41 deletions(-) diff --git a/.github/workflows/dev-docker-publish.yml b/.github/workflows/dev-docker-publish.yml index 6433f4f..7979e75 100644 --- a/.github/workflows/dev-docker-publish.yml +++ b/.github/workflows/dev-docker-publish.yml @@ -7,39 +7,7 @@ on: - version-* jobs: - build: - runs-on: ubuntu-20.04 - steps: - - uses: actions/checkout@v2 -# Prepare custom build version - - name: Get branch name - id: branch - run: echo ::set-output name=branch_name::${GITHUB_REF#refs/*/} - - name: Get release_version - id: ver - uses: christian-draeger/read-properties@1.0.1 - with: - path: gradle.properties - property: release_version - - name: Build custom release version - id: release_ver - run: echo ::set-output name=value::"${{ steps.ver.outputs.value }}-${{ steps.branch.outputs.branch_name }}-${{ github.run_id }}" - - name: Show custom release version - run: echo ${{ steps.release_ver.outputs.value }} -# Build and publish image - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v1 - - uses: docker/login-action@v1 - with: - registry: ghcr.io - username: ${{ github.repository_owner }} - password: ${{ secrets.CR_PAT }} - - run: echo "::set-output name=REPOSITORY_NAME::$(echo '${{ github.repository }}' | awk -F '/' '{print $2}')" - id: meta - - name: Build and push - id: docker_build - uses: docker/build-push-action@v2 - with: - push: true - tags: ghcr.io/${{ github.repository }}:${{ steps.release_ver.outputs.value }} - labels: com.exactpro.th2.${{ steps.meta.outputs.REPOSITORY_NAME }}=${{ steps.ver.outputs.value }} + build-job: + uses: th2-net/.github/.github/workflows/dev-java-docker-publish.yml@main + secrets: + CR_PAT: ${{ secrets.CR_PAT }} diff --git a/build.gradle b/build.gradle index b8736f7..ad066e5 100644 --- a/build.gradle +++ b/build.gradle @@ -2,7 +2,7 @@ plugins { id 'java-library' id 'application' id 'com.palantir.docker' version '0.25.0' - id "org.owasp.dependencycheck" version "7.2.0" + id "org.owasp.dependencycheck" version "7.3.0" } dependencyCheck { @@ -56,13 +56,11 @@ jar { } dependencies { - api platform('com.exactpro.th2:bom:4.0.1') + api platform('com.exactpro.th2:bom:4.0.2') - implementation 'com.exactpro.th2:common:3.41.0' + implementation 'com.exactpro.th2:common:3.41.1' implementation 'com.exactpro.th2:codec:4.7.4' - implementation "org.slf4j:slf4j-api" - implementation 'net.sourceforge.javacsv:javacsv:2.0' implementation 'org.jetbrains:annotations:23.0.0' From 24e9e53241ec797d6979c3a5d681ecae6ad9c725 Mon Sep 17 00:00:00 2001 From: Alexey Khudyakov Date: Fri, 6 Jan 2023 00:53:19 +0000 Subject: [PATCH 2/5] [TH2-4566] reusable workflow 2 --- .github/workflows/dev-docker-publish.yml | 14 +++++--- .github/workflows/docker-publish.yml | 41 ++++++++---------------- 2 files changed, 23 insertions(+), 32 deletions(-) diff --git a/.github/workflows/dev-docker-publish.yml b/.github/workflows/dev-docker-publish.yml index 7979e75..6f77755 100644 --- a/.github/workflows/dev-docker-publish.yml +++ b/.github/workflows/dev-docker-publish.yml @@ -3,11 +3,17 @@ name: Dev build and publish Docker distributions to Github Container Registry gh on: push: branches-ignore: - - master - - version-* + - master + - version-* + - dependabot** + paths-ignore: + - README.md jobs: build-job: - uses: th2-net/.github/.github/workflows/dev-java-docker-publish.yml@main + uses: th2-net/.github/.github/workflows/compound-java-dev.yml@main + with: + build-target: 'Docker' + docker-username: ${{ github.actor }} secrets: - CR_PAT: ${{ secrets.CR_PAT }} + docker-password: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index 9274060..cec50a6 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -3,33 +3,18 @@ name: Build and publish Docker distributions to Github Container Registry ghcr.i on: push: branches: - - master - - version-* + - master + - version-* + paths: + - gradle.properties +# - package_info.json jobs: - build: - runs-on: ubuntu-20.04 - steps: - - uses: actions/checkout@v2 - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v1 - - uses: docker/login-action@v1 - with: - registry: ghcr.io - username: ${{ github.repository_owner }} - password: ${{ secrets.CR_PAT }} - - run: echo "::set-output name=REPOSITORY_NAME::$(echo '${{ github.repository }}' | awk -F '/' '{print $2}')" - id: meta - - name: Read version from gradle.properties - id: read_property - uses: christian-draeger/read-properties@1.0.1 - with: - path: ./gradle.properties - property: release_version - - name: Build and push - id: docker_build - uses: docker/build-push-action@v2 - with: - push: true - tags: ghcr.io/${{ github.repository }}:${{ steps.read_property.outputs.value }} - labels: com.exactpro.th2.${{ steps.meta.outputs.REPOSITORY_NAME }}=${{ steps.read_property.outputs.value }} + 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 }} + \ No newline at end of file From 875443f0cbefa6ee9719aaceb53102f277d03457 Mon Sep 17 00:00:00 2001 From: "fiodar.rekish" Date: Mon, 23 Jan 2023 15:19:01 +0400 Subject: [PATCH 3/5] common bump --- build.gradle | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/build.gradle b/build.gradle index ad066e5..c5a922e 100644 --- a/build.gradle +++ b/build.gradle @@ -2,12 +2,11 @@ plugins { id 'java-library' id 'application' id 'com.palantir.docker' version '0.25.0' - id "org.owasp.dependencycheck" version "7.3.0" + id "org.owasp.dependencycheck" version "7.4.4" } dependencyCheck { format='HTML' - failBuildOnCVSS=5 } ext { @@ -56,9 +55,9 @@ jar { } dependencies { - api platform('com.exactpro.th2:bom:4.0.2') + api platform('com.exactpro.th2:bom:4.1.0') - implementation 'com.exactpro.th2:common:3.41.1' + implementation 'com.exactpro.th2:common:3.44.0' implementation 'com.exactpro.th2:codec:4.7.4' implementation 'net.sourceforge.javacsv:javacsv:2.0' From f7bf2ced8a7b16000d80c839a649820c4a1e2d90 Mon Sep 17 00:00:00 2001 From: "fiodar.rekish" Date: Thu, 26 Jan 2023 13:40:37 +0400 Subject: [PATCH 4/5] readme update --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 7b11bff..f6a7a92 100644 --- a/README.md +++ b/README.md @@ -133,6 +133,8 @@ spec: ### 4.0.0 + Migrated to `th2-codec` core part. Uses the standard configuration format and pins for th2-codec ++ Updated `bom`: `3.1.0` -> `4.1.0` ++ Updated `common`: `3.37.1` -> `3.44.0` ### 3.2.1 From c46e077189c847ce7ac9bc0ca76c67e16c4d37f3 Mon Sep 17 00:00:00 2001 From: "fiodar.rekish" Date: Tue, 31 Jan 2023 12:40:38 +0400 Subject: [PATCH 5/5] copyright update, added protocol check --- .../java/com/exactpro/th2/codec/csv/CodecFactory.java | 2 +- src/main/java/com/exactpro/th2/codec/csv/CsvCodec.java | 8 +++++++- .../exactpro/th2/codec/csv/cfg/CsvCodecConfiguration.java | 2 +- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/exactpro/th2/codec/csv/CodecFactory.java b/src/main/java/com/exactpro/th2/codec/csv/CodecFactory.java index 7a9f27f..e0c860f 100644 --- a/src/main/java/com/exactpro/th2/codec/csv/CodecFactory.java +++ b/src/main/java/com/exactpro/th2/codec/csv/CodecFactory.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Exactpro (Exactpro Systems Limited) + * Copyright 2023 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. diff --git a/src/main/java/com/exactpro/th2/codec/csv/CsvCodec.java b/src/main/java/com/exactpro/th2/codec/csv/CsvCodec.java index acc2709..a047bec 100644 --- a/src/main/java/com/exactpro/th2/codec/csv/CsvCodec.java +++ b/src/main/java/com/exactpro/th2/codec/csv/CsvCodec.java @@ -1,5 +1,5 @@ /* - * Copyright 2020-2022 Exactpro (Exactpro Systems Limited) + * Copyright 2020-2023 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. @@ -89,6 +89,12 @@ public MessageGroup decode(@NotNull MessageGroup messageGroup) { continue; } RawMessage rawMessage = anyMessage.getRawMessage(); + String protocol = rawMessage.getMetadata().getProtocol(); + if (!"".equals(protocol) && !"csv".equalsIgnoreCase(protocol)) { + LOGGER.error("Wrong protocol: message should have empty or 'csv' protocol but has {}", protocol); + continue; + } + ByteString body = rawMessage.getBody(); List data = decodeValues(body); if (data.isEmpty()) { diff --git a/src/main/java/com/exactpro/th2/codec/csv/cfg/CsvCodecConfiguration.java b/src/main/java/com/exactpro/th2/codec/csv/cfg/CsvCodecConfiguration.java index f1afa3d..acfdcf4 100644 --- a/src/main/java/com/exactpro/th2/codec/csv/cfg/CsvCodecConfiguration.java +++ b/src/main/java/com/exactpro/th2/codec/csv/cfg/CsvCodecConfiguration.java @@ -1,5 +1,5 @@ /* - * Copyright 2020-2022 Exactpro (Exactpro Systems Limited) + * Copyright 2020-2023 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.