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
28 changes: 6 additions & 22 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
# Copyright 2020 EPAM Systems
# Copyright 2025 EPAM Systems
#
# 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
# https://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,
Expand All @@ -29,23 +30,6 @@ on:

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up JDK 11
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '11'

- name: Build with Gradle
timeout-minutes: 20
run: ./gradlew build

- name: Codecov upload
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
uses: reportportal/.github/.github/workflows/agent-java-ci.yml@main
secrets:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
104 changes: 7 additions & 97 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
# Copyright 2020 EPAM Systems
# Copyright 2025 EPAM Systems
#
# 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
# https://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,
Expand All @@ -24,100 +25,9 @@ on:

workflow_dispatch:

env:
VERSION_FILE: gradle.properties
VERSION_EXTRACT_PATTERN: '(?<=version=).+'
REPOSITORY_URL: 'https://maven.pkg.github.com/'
CHANGE_LOG_FILE: CHANGELOG.md
CHANGE_LOG_TMP_FILE: CHANGELOG_updated.md
README_FILE: README.md
README_TEMPLATE_FILE: README_TEMPLATE.md
README_VERSION_PLACEHOLDER: $LATEST_VERSION

jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
ref: 'master'
fetch-depth: 0

- name: Set up JDK 11
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '11'

- name: Generate versions
uses: HardNorth/github-version-generate@v1
with:
version-source: file
version-file: ${{ env.VERSION_FILE }}
version-file-extraction-pattern: ${{ env.VERSION_EXTRACT_PATTERN }}

- name: Setup git credentials
uses: oleksiyrudenko/gha-git-credentials@v2-latest
with:
name: 'reportportal.io'
email: 'support@reportportal.io'
token: ${{ secrets.GITHUB_TOKEN }}

- name: Release with Gradle
id: release
run: |
./gradlew release -Prelease.useAutomaticVersion=true -Prelease.releaseVersion=${{ env.RELEASE_VERSION }} \
-Prelease.newVersion=${{ env.NEXT_VERSION }} -PpublishRepo=${{ env.REPOSITORY_URL }}${{ github.repository }} \
-PgithubUserName=${{ github.actor }} -PgithubToken=${{ secrets.GITHUB_TOKEN }} \
-PgpgPassphrase=${{ secrets.GPG_PASSPHRASE }} -PgpgPrivateKey="${{ secrets.GPG_PRIVATE_KEY }}"

- name: Update README.md
id: readmeUpdate
run: |
sed 's/${{ env.README_VERSION_PLACEHOLDER }}/${{ env.RELEASE_VERSION }}/g' ${{ env.README_TEMPLATE_FILE }} > ${{ env.README_FILE }}
git add ${{ env.README_FILE }}
git commit -m "Readme update"

- name: Update CHANGELOG.md
id: changelogUpdate
run: |
sed '/\[Unreleased\]/q' ${{ env.CHANGE_LOG_FILE }} >> ${{ env.CHANGE_LOG_TMP_FILE }}
sed -E '1,/#?#\s*\[Unreleased\]/d' ${{ env.CHANGE_LOG_FILE }} | sed -E '/#?#\s*\[/q' | \
{ echo -e '\n## [${{env.RELEASE_VERSION}}]'; sed '$d'; } >> ${{ env.CHANGE_LOG_TMP_FILE }}
grep -E '#?#\s*\[[0-9]' ${{ env.CHANGE_LOG_FILE }} | head -n1 >> ${{ env.CHANGE_LOG_TMP_FILE }}
sed -E '1,/#?#\s*\[[0-9]/d' ${{ env.CHANGE_LOG_FILE }} >> ${{ env.CHANGE_LOG_TMP_FILE }}
rm ${{ env.CHANGE_LOG_FILE }}
mv ${{ env.CHANGE_LOG_TMP_FILE }} ${{ env.CHANGE_LOG_FILE }}
git add ${{ env.CHANGE_LOG_FILE }}
git commit -m "Changelog update"
git push

- name: Read changelog Entry
id: readChangelogEntry
uses: mindsers/changelog-reader-action@v2
with:
version: ${{ env.RELEASE_VERSION }}
path: ./${{ env.CHANGE_LOG_FILE }}

- name: Create Release
id: createRelease
uses: ncipollo/release-action@v1
with:
tag: ${{ env.RELEASE_VERSION }}
name: Release ${{ env.RELEASE_VERSION }}
body: ${{ steps.readChangelogEntry.outputs.changes }}

- name: Checkout develop branch
uses: actions/checkout@v4
with:
ref: 'develop'
fetch-depth: 0

- name: Merge release branch into develop
id: mergeIntoDevelop
run: |
git merge -m 'Merge master branch into develop after a release' origin/master
git status | (! grep -Fq 'both modified:') || git status | grep -F 'both modified:' \
| { echo -e 'Unable to merge master into develop, merge conflicts:'; (! grep -Eo '[^ ]+$') }
git push origin develop
uses: reportportal/.github/.github/workflows/agent-java-release.yml@main
secrets:
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# Changelog

## [Unreleased]
### Added
- Attribute number truncation, by @HardNorth
- Binary character replacement in basic text fields, by @HardNorth

## [5.4.11]
### Changed
Expand Down
20 changes: 11 additions & 9 deletions README_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -188,15 +188,17 @@ rp.project=project-name
| rp.http.timeout.write.value | Integer | Default: 10 seconds<br> Data write timeout for new HTTP connections. |
| rp.http.timeout.write.unit | Enum | Default: `MILLISECONDS`<br> Timeout value time unit. Should be one of values from `java.util.concurrent.TimeUnit` class |

### Truncation parameters

| **Property name** | **Type** | **Description** |
|-------------------------------|----------|--------------------------------------------------------------------------------------------------------------|
| rp.truncation.field | Boolean | Default: `true`<br> Enable / disable certain field truncation to avoid API failures. |
| rp.truncation.replacement | String | Default: `...`<br> Replacement pattern for truncated fields |
| rp.truncation.item.name.limit | Integer | Default: `1024`<br> Maximum item names length before truncation. |
| rp.truncation.attribute.limit | Integer | Default: `128`<br> Maximum attribute key and value limit (counts separately) |
| rp.truncation.exception | Boolean | Default: `true`<br> Enable / disable Stack Trace truncation of exceptions that being logged to ReportPortal. |
### Truncation and sanitization parameters

| **Property name** | **Type** | **Description** |
|--------------------------------|----------|----------------------------------------------------------------------------------------------------|
| rp.truncation.field | Boolean | Default: `true`<br> Toggle certain field truncation to avoid API failures. |
| rp.truncation.replacement | String | Default: `...`<br> Replacement pattern for truncated fields |
| rp.truncation.item.name.limit | Integer | Default: `1024`<br> Maximum item names length before truncation. |
| rp.truncation.attribute.limit | Integer | Default: `128`<br> Maximum attribute key and value limit (counts separately) |
| rp.truncation.exception | Boolean | Default: `true`<br> Toggle Stack Trace truncation of exceptions that being logged to ReportPortal. |
| rp.attribute.limit | Integer | Default: `256`<br> Maximum number of attributes sent in request. |
| rp.sanitization.replace.binary | Boolean | Default: `true`<br> Toggle replacement of basic binary characters with \uFFFD char. |

### Bug Tracking System parameters

Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
version=5.4.12-SNAPSHOT
description=EPAM ReportPortal. Client
description=EPAM ReportPortal. Asynchronous client for Java-based agents.
retrofit_version=2.11.0
okhttp_version=4.12.0
jackson_version=2.18.6
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@ public class ListenerParameters implements Cloneable {
private static final boolean DEFAULT_TRUNCATE = true;
private static final int DEFAULT_TRUNCATE_ITEM_NAMES_LIMIT = 1024;
private static final int DEFAULT_TRUNCATE_ATTRIBUTE_LIMIT = 128;
private static final int DEFAULT_ATTRIBUTE_NUMBER_LIMIT = 256;
private static final boolean DEFAULT_REPLACE_BINARY_CHARACTERS = true;

public static final boolean DEFAULT_EXCEPTION_TRUNCATE = true;

Expand Down Expand Up @@ -139,6 +141,8 @@ public class ListenerParameters implements Cloneable {
private int truncateItemNamesLimit;
private String truncateReplacement;
private int attributeLengthLimit;
private int attributeNumberLimit;
private boolean replaceBinaryCharacters;

private boolean exceptionTruncate;

Expand Down Expand Up @@ -226,14 +230,16 @@ public ListenerParameters() {
this.truncateItemNamesLimit = DEFAULT_TRUNCATE_ITEM_NAMES_LIMIT;
this.truncateReplacement = CommonConstants.DEFAULT_TRUNCATE_REPLACEMENT;
this.attributeLengthLimit = DEFAULT_TRUNCATE_ATTRIBUTE_LIMIT;
this.exceptionTruncate = DEFAULT_EXCEPTION_TRUNCATE;
this.attributeNumberLimit = DEFAULT_ATTRIBUTE_NUMBER_LIMIT;
this.replaceBinaryCharacters = DEFAULT_REPLACE_BINARY_CHARACTERS;

this.printLaunchUuid = DEFAULT_LAUNCH_UUID_PRINT;
this.printLaunchUuidOutput = OutputTypes.valueOf(DEFAULT_LAUNCH_UUID_OUTPUT.toUpperCase(Locale.ROOT)).getOutput();
this.isLaunchUuidCreationSkip = DEFAULT_LAUNCH_CREATION_SKIP;

this.btsIssueFail = DEFAULT_BTS_ISSUE_FAIL;

this.exceptionTruncate = DEFAULT_EXCEPTION_TRUNCATE;
}

/**
Expand Down Expand Up @@ -314,8 +320,9 @@ public ListenerParameters(PropertiesLoader properties) {
this.truncateItemNamesLimit = properties.getPropertyAsInt(TRUNCATE_ITEM_NAME_LIMIT, DEFAULT_TRUNCATE_ITEM_NAMES_LIMIT);
this.truncateReplacement = properties.getProperty(TRUNCATE_REPLACEMENT, CommonConstants.DEFAULT_TRUNCATE_REPLACEMENT);
this.attributeLengthLimit = properties.getPropertyAsInt(TRUNCATE_ATTRIBUTE_LIMIT, DEFAULT_TRUNCATE_ATTRIBUTE_LIMIT);

this.exceptionTruncate = properties.getPropertyAsBoolean(EXCEPTION_TRUNCATE, DEFAULT_EXCEPTION_TRUNCATE);
this.attributeNumberLimit = properties.getPropertyAsInt(ATTRIBUTE_NUMBER_LIMIT, DEFAULT_ATTRIBUTE_NUMBER_LIMIT);
this.replaceBinaryCharacters = properties.getPropertyAsBoolean(REPLACE_BINARY_CHARACTERS, DEFAULT_REPLACE_BINARY_CHARACTERS);

this.launchUuid = properties.getProperty(LAUNCH_UUID);
this.isLaunchUuidCreationSkip = properties.getPropertyAsBoolean(LAUNCH_UUID_CREATION_SKIP, DEFAULT_LAUNCH_CREATION_SKIP);
Expand Down Expand Up @@ -767,6 +774,22 @@ public void setExceptionTruncate(boolean exceptionTruncate) {
this.exceptionTruncate = exceptionTruncate;
}

public int getAttributeNumberLimit() {
return attributeNumberLimit;
}

public void setAttributeNumberLimit(int attributeNumberLimit) {
this.attributeNumberLimit = attributeNumberLimit;
}

public boolean isReplaceBinaryCharacters() {
return replaceBinaryCharacters;
}

public void setReplaceBinaryCharacters(boolean replaceBinaryCharacters) {
this.replaceBinaryCharacters = replaceBinaryCharacters;
}

public void setHttpCallTimeout(@Nullable Duration httpCallTimeout) {
this.httpCallTimeout = httpCallTimeout;
}
Expand Down
Loading
Loading