Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 12 additions & 38 deletions .github/workflows/dev-docker-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,43 +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:
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/compound-java-dev.yml@main
with:
build-target: 'Docker'
docker-username: ${{ github.actor }}
secrets:
docker-password: ${{ secrets.GITHUB_TOKEN }}
41 changes: 13 additions & 28 deletions .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}

2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
9 changes: 3 additions & 6 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,11 @@ 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.4.4"
}

dependencyCheck {
format='HTML'
failBuildOnCVSS=5
}

ext {
Expand Down Expand Up @@ -56,13 +55,11 @@ jar {
}

dependencies {
api platform('com.exactpro.th2:bom:4.0.1')
api platform('com.exactpro.th2:bom:4.1.0')

implementation 'com.exactpro.th2:common:3.41.0'
implementation 'com.exactpro.th2:common:3.44.0'
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'

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/exactpro/th2/codec/csv/CodecFactory.java
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
8 changes: 7 additions & 1 deletion src/main/java/com/exactpro/th2/codec/csv/CsvCodec.java
Original file line number Diff line number Diff line change
@@ -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.
Expand Down Expand Up @@ -89,6 +89,12 @@ public MessageGroup decode(@NotNull MessageGroup messageGroup) {
continue;
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add protocol check. Codec should decode / encode message with empty or csv (case insensitive) protocol

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<String[]> data = decodeValues(body);
if (data.isEmpty()) {
Expand Down
Original file line number Diff line number Diff line change
@@ -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.
Expand Down