From 7e028b2fb2b300a55bc30128a160fd36a04fa2d7 Mon Sep 17 00:00:00 2001 From: APiankouski <109206864+APiankouski@users.noreply.github.com> Date: Wed, 18 Sep 2024 11:50:00 +0300 Subject: [PATCH 1/6] EPMRPP-95322 || Job 'CleanLaunchcron' doesn't clean the attachments for 'Regular' launches (#144) --- .../com/epam/reportportal/jobs/clean/CleanAttachmentJob.java | 4 ++-- .../java/com/epam/reportportal/jobs/clean/CleanLogJob.java | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/epam/reportportal/jobs/clean/CleanAttachmentJob.java b/src/main/java/com/epam/reportportal/jobs/clean/CleanAttachmentJob.java index a2f6fc7..80a0b0e 100644 --- a/src/main/java/com/epam/reportportal/jobs/clean/CleanAttachmentJob.java +++ b/src/main/java/com/epam/reportportal/jobs/clean/CleanAttachmentJob.java @@ -22,8 +22,8 @@ WITH moved_rows AS ( DELETE FROM attachment\s WHERE project_id = ?\s AND creation_date <= ?::TIMESTAMP\s - AND launch_id IN ( - SELECT id FROM launch WHERE retention_policy='REGULAR' + AND launch_id NOT IN ( + SELECT id FROM launch WHERE retention_policy='IMPORTANT' )\s RETURNING * ) diff --git a/src/main/java/com/epam/reportportal/jobs/clean/CleanLogJob.java b/src/main/java/com/epam/reportportal/jobs/clean/CleanLogJob.java index 55fa6c1..8d5da38 100644 --- a/src/main/java/com/epam/reportportal/jobs/clean/CleanLogJob.java +++ b/src/main/java/com/epam/reportportal/jobs/clean/CleanLogJob.java @@ -60,7 +60,6 @@ public CleanLogJob(JdbcTemplate jdbcTemplate, CleanAttachmentJob cleanAttachment @SchedulerLock(name = "cleanLog", lockAtMostFor = "24h") public void execute() { removeLogs(); - cleanAttachmentJob.moveAttachments(); } void removeLogs() { @@ -83,6 +82,7 @@ void removeLogs() { } } }); + cleanAttachmentJob.moveAttachments(); } private void deleteLogsFromSearchEngineByLaunchIdsAndProjectId(List launchIds, From 8a5314f25338fd29d9cccb6bb4664bd23eae5201 Mon Sep 17 00:00:00 2001 From: Reingold Shekhtel <13565058+raikbitters@users.noreply.github.com> Date: Thu, 19 Sep 2024 13:13:55 +0200 Subject: [PATCH 2/6] Update Dockerfile --- Dockerfile | 1 - 1 file changed, 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 7208af9..ba3c618 100644 --- a/Dockerfile +++ b/Dockerfile @@ -9,7 +9,6 @@ RUN if [ "${RELEASE_MODE}" = true ]; then \ -Dorg.gradle.project.version=${APP_VERSION}; \ else gradle build --exclude-task test -Dorg.gradle.project.version=${APP_VERSION}; fi -# For ARM build use flag: `--platform linux/arm64` FROM amazoncorretto:21.0.4 LABEL version=${APP_VERSION} description="EPAM Report portal. Jobs Service" maintainer="Andrei Varabyeu , Hleb Kanonik " ARG APP_VERSION=${APP_VERSION} From 0e9b3c73ea9237ea5648459dfc9b5f15b29586a6 Mon Sep 17 00:00:00 2001 From: Andrei Piankouski Date: Tue, 29 Oct 2024 14:43:29 +0300 Subject: [PATCH 3/6] EPMRPP-96325 || Update to Spring Boot 3 --- Dockerfile | 4 +- build.gradle | 46 ++++++++----------- gradle/wrapper/gradle-wrapper.properties | 2 +- .../calculation/RetryCalculation.java | 23 ---------- .../config/rabbit/RabbitMqConfiguration.java | 10 ---- 5 files changed, 21 insertions(+), 64 deletions(-) delete mode 100644 src/main/java/com/epam/reportportal/calculation/RetryCalculation.java diff --git a/Dockerfile b/Dockerfile index ba3c618..dab977c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM --platform=$BUILDPLATFORM gradle:8.10.0-jdk21 AS build +FROM --platform=$BUILDPLATFORM gradle:8.10.2-jdk21 AS build ARG RELEASE_MODE ARG APP_VERSION WORKDIR /usr/app @@ -9,7 +9,7 @@ RUN if [ "${RELEASE_MODE}" = true ]; then \ -Dorg.gradle.project.version=${APP_VERSION}; \ else gradle build --exclude-task test -Dorg.gradle.project.version=${APP_VERSION}; fi -FROM amazoncorretto:21.0.4 +FROM amazoncorretto:21.0.5 LABEL version=${APP_VERSION} description="EPAM Report portal. Jobs Service" maintainer="Andrei Varabyeu , Hleb Kanonik " ARG APP_VERSION=${APP_VERSION} ENV APP_DIR=/usr/app diff --git a/build.gradle b/build.gradle index 365b30b..6368c92 100644 --- a/build.gradle +++ b/build.gradle @@ -1,5 +1,5 @@ plugins { - id 'org.springframework.boot' version '2.7.18' + id 'org.springframework.boot' version '3.3.5' id 'io.spring.dependency-management' version '1.1.4' id 'java' } @@ -15,7 +15,6 @@ def scriptsUrl = 'https://raw.githubusercontent.com/reportportal/gradle-scripts/ apply from: "$scriptsUrl/build-commons.gradle" apply from: "$scriptsUrl/build-info.gradle" -//apply from: "$scriptsUrl/build-quality.gradle" apply from: "$scriptsUrl/release-service.gradle" apply from: "$scriptsUrl/signing.gradle" @@ -25,7 +24,7 @@ tasks.withType(JavaCompile).configureEach { } wrapper { - gradleVersion = '8.10' + gradleVersion = '8.10.2' } bootJar { @@ -47,63 +46,54 @@ processResources { } } -//https://nvd.nist.gov/vuln/detail/CVE-2020-9488 and https://nvd.nist.gov/vuln/detail/CVE-2021-44228 and https://nvd.nist.gov/vuln/detail/CVE-2021-45046 and -//https://nvd.nist.gov/vuln/detail/CVE-2021-45105 ext['log4j2.version'] = '2.21.1' ext['log4j-to-slf4j.version'] = '2.21.1' -//https://nvd.nist.gov/vuln/detail/CVE-2022-26520 ext['postgresql.version'] = '42.6.1' ext['snakeyaml.version'] = '2.2' -ext['spring-boot.version'] = '2.7.18' +ext['spring-boot.version'] = '3.3.5' // dependencies { implementation 'org.json:json:20231013' - implementation 'net.javacrumbs.shedlock:shedlock-spring:4.46.0' + implementation 'net.javacrumbs.shedlock:shedlock-spring:5.16.0' implementation 'net.javacrumbs.shedlock:shedlock-provider-jdbc-template:4.46.0' // https://mvnrepository.com/artifact/org.apache.commons/commons-lang3 implementation 'org.apache.commons:commons-lang3:3.12.0' - // Fix CVE-2023-46589, CVE-2024-24549 - implementation 'org.apache.tomcat.embed:tomcat-embed-core:9.0.86' - implementation 'org.apache.tomcat.embed:tomcat-embed-el:9.0.86' - implementation 'org.apache.tomcat.embed:tomcat-embed-websocket:9.0.86' + implementation 'org.apache.tomcat.embed:tomcat-embed-core:9.0.96' + implementation 'org.apache.tomcat.embed:tomcat-embed-el:9.0.96' + implementation 'org.apache.tomcat.embed:tomcat-embed-websocket:9.0.96' - //Fix CVE-2023-6378, CVE-2023-6481, CVE-2023-6378, CVE-2023-6481 - implementation 'ch.qos.logback:logback-classic:1.2.13' - implementation 'ch.qos.logback:logback-core:1.2.13' - - //Fix CVE-2023-40827, CVE-2023-40828, CVE-2023-40826 - implementation 'org.springframework:spring-webmvc:5.3.33' - implementation 'org.springframework:spring-web:5.3.33' - - // Fix CVE-2024-25710, CVE-2024-26308 + implementation 'ch.qos.logback:logback-classic' + implementation 'ch.qos.logback:logback-core' + implementation 'org.springframework:spring-webmvc' + implementation 'org.springframework:spring-web' implementation 'org.apache.commons:commons-compress:1.26.0' + implementation 'javax.xml.bind:jaxb-api:2.3.1' - //Fix CVE-2023-34050 - implementation 'org.springframework.amqp:spring-amqp:2.4.17' + implementation 'org.springframework.amqp:spring-amqp' implementation 'org.springframework.boot:spring-boot-starter-aop' implementation 'org.springframework.boot:spring-boot-starter-actuator' implementation 'org.springframework.boot:spring-boot-starter-jdbc' implementation 'org.springframework.boot:spring-boot-starter-web' implementation 'org.springframework.boot:spring-boot-starter-amqp' - implementation 'org.springframework:spring-jdbc:6.1.5' + implementation 'org.springframework:spring-jdbc' implementation 'org.apache.jclouds.api:s3:2.5.0' implementation 'org.apache.jclouds.provider:aws-s3:2.5.0' implementation 'org.apache.jclouds.api:filesystem:2.5.0' //Needed for correct jcloud work implementation 'com.google.code.gson:gson:2.8.9' - implementation 'org.apache.httpcomponents:httpclient:4.5.14' -// https://avd.aquasec.com/nvd/cve-2020-8908 + implementation ('org.apache.httpcomponents:httpclient:4.5.14') { + exclude group: 'commons-logging', module: 'commons-logging' + } implementation 'com.google.guava:guava:32.1.3-jre' implementation "com.rabbitmq:http-client:5.2.0" - //Fix CVE - implementation 'com.fasterxml.jackson.core:jackson-databind:2.15.3' + implementation 'com.fasterxml.jackson.core:jackson-databind:2.15.4' runtimeOnly 'org.postgresql:postgresql' diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 9355b41..df97d72 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.10-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-bin.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME diff --git a/src/main/java/com/epam/reportportal/calculation/RetryCalculation.java b/src/main/java/com/epam/reportportal/calculation/RetryCalculation.java deleted file mode 100644 index 64c5289..0000000 --- a/src/main/java/com/epam/reportportal/calculation/RetryCalculation.java +++ /dev/null @@ -1,23 +0,0 @@ -package com.epam.reportportal.calculation; - - -import org.springframework.scheduling.concurrent.DefaultManagedTaskScheduler; -import org.springframework.stereotype.Component; - -@Component -// example of usage -public class RetryCalculation { - - private final RetryProcessing retryProcessing; - - public RetryCalculation() { - retryProcessing = new RetryProcessing(5, 3000, new DefaultManagedTaskScheduler()); - } - - /* example of using fill be removed during integration - @RabbitListener(queues = "some_queue") - public void calculate(Object retryItem) { - retryProcessing.add(retryItem); - } - */ -} diff --git a/src/main/java/com/epam/reportportal/config/rabbit/RabbitMqConfiguration.java b/src/main/java/com/epam/reportportal/config/rabbit/RabbitMqConfiguration.java index 7c4c1f4..22fb270 100644 --- a/src/main/java/com/epam/reportportal/config/rabbit/RabbitMqConfiguration.java +++ b/src/main/java/com/epam/reportportal/config/rabbit/RabbitMqConfiguration.java @@ -29,7 +29,6 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.beans.factory.annotation.Value; -import org.springframework.boot.autoconfigure.amqp.SimpleRabbitListenerContainerFactoryConfigurer; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; @@ -74,15 +73,6 @@ public RabbitAdmin rabbitAdmin( return new RabbitAdmin(connectionFactory); } - @Bean - SimpleRabbitListenerContainerFactory rabbitListenerContainerFactory( - SimpleRabbitListenerContainerFactoryConfigurer configurer, - @Qualifier("connectionFactory") ConnectionFactory connectionFactory) { - SimpleRabbitListenerContainerFactory factory = new SimpleRabbitListenerContainerFactory(); - configurer.configure(factory, connectionFactory); - return factory; - } - @Bean(name = "rabbitTemplate") public RabbitTemplate rabbitTemplate( @Autowired @Qualifier("connectionFactory") ConnectionFactory connectionFactory, From 7fad46982a95639706cdb999fda475b82b0c375b Mon Sep 17 00:00:00 2001 From: APiankouski <109206864+APiankouski@users.noreply.github.com> Date: Fri, 29 Nov 2024 12:05:21 +0300 Subject: [PATCH 4/6] EPMRPP-97124 || Fix Health endpoint (#147) --- Dockerfile | 2 +- build.gradle | 4 ---- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index dab977c..308f708 100644 --- a/Dockerfile +++ b/Dockerfile @@ -17,5 +17,5 @@ ENV JAVA_OPTS="-Xmx1g -XX:+UseG1GC -XX:InitiatingHeapOccupancyPercent=70 -Djava. WORKDIR $APP_DIR COPY --from=build $APP_DIR/build/libs/service-jobs-*exec.jar . VOLUME ["/tmp"] -EXPOSE 8080 +EXPOSE 8686 ENTRYPOINT exec java ${JAVA_OPTS} -jar ${APP_DIR}/service-jobs-*exec.jar diff --git a/build.gradle b/build.gradle index 6368c92..adf195b 100644 --- a/build.gradle +++ b/build.gradle @@ -63,10 +63,6 @@ dependencies { // https://mvnrepository.com/artifact/org.apache.commons/commons-lang3 implementation 'org.apache.commons:commons-lang3:3.12.0' - implementation 'org.apache.tomcat.embed:tomcat-embed-core:9.0.96' - implementation 'org.apache.tomcat.embed:tomcat-embed-el:9.0.96' - implementation 'org.apache.tomcat.embed:tomcat-embed-websocket:9.0.96' - implementation 'ch.qos.logback:logback-classic' implementation 'ch.qos.logback:logback-core' implementation 'org.springframework:spring-webmvc' From 6b3aef669e9de082984a6f49edfbda5164c3f482 Mon Sep 17 00:00:00 2001 From: "hleb_kanonik@epam.com" Date: Mon, 2 Dec 2024 15:02:49 +0100 Subject: [PATCH 5/6] Add 'runs-on: ubuntu-latest' to workflow configuration files --- .github/workflows/build-dev-image.yml | 1 + .github/workflows/build-feature-image.yaml | 1 + .github/workflows/build-rc-image.yaml | 1 + .github/workflows/java-checks.yml | 1 + 4 files changed, 4 insertions(+) diff --git a/.github/workflows/build-dev-image.yml b/.github/workflows/build-dev-image.yml index 9dbee6b..e884bc8 100644 --- a/.github/workflows/build-dev-image.yml +++ b/.github/workflows/build-dev-image.yml @@ -32,4 +32,5 @@ jobs: image-tag: 'develop-${{ github.run_number }}' version: 'develop-${{ github.run_number }}' date: ${{ needs.variables-setup.outputs.date }} + runs-on: ubuntu-latest secrets: inherit diff --git a/.github/workflows/build-feature-image.yaml b/.github/workflows/build-feature-image.yaml index 757cf2e..f386094 100644 --- a/.github/workflows/build-feature-image.yaml +++ b/.github/workflows/build-feature-image.yaml @@ -34,4 +34,5 @@ jobs: version: ${{ needs.variables-setup.outputs.tag }} branch: ${{ github.head_ref }} date: ${{ needs.variables-setup.outputs.date }} + runs-on: ubuntu-latest secrets: inherit diff --git a/.github/workflows/build-rc-image.yaml b/.github/workflows/build-rc-image.yaml index 31dc2ff..c8528f3 100644 --- a/.github/workflows/build-rc-image.yaml +++ b/.github/workflows/build-rc-image.yaml @@ -40,4 +40,5 @@ jobs: build-platforms: ${{ needs.variables-setup.outputs.platforms }} version: ${{ needs.variables-setup.outputs.version }} date: ${{ needs.variables-setup.outputs.date }} + runs-on: ubuntu-latest secrets: inherit diff --git a/.github/workflows/java-checks.yml b/.github/workflows/java-checks.yml index fec9a27..4a25264 100644 --- a/.github/workflows/java-checks.yml +++ b/.github/workflows/java-checks.yml @@ -22,3 +22,4 @@ jobs: uses: reportportal/.github/.github/workflows/java-checks.yaml@main with: java-version: '21' + runs-on: ubuntu-latest From a7dbbb28d4430f718985ba68d92f72912f626e89 Mon Sep 17 00:00:00 2001 From: Pavel_Bortnik Date: Thu, 5 Dec 2024 17:34:26 +0300 Subject: [PATCH 6/6] 5.13.0 || Update release version --- build.gradle | 4 ++++ gradle.properties | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index adf195b..230dde2 100644 --- a/build.gradle +++ b/build.gradle @@ -109,3 +109,7 @@ test { publish.dependsOn build publish.mustRunAfter build + +tasks.preTagCommit.enabled = false +tasks.updateVersion.enabled = false +tasks.commitNewVersion.enabled = false diff --git a/gradle.properties b/gradle.properties index 278054c..6a29b1b 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,4 +1,4 @@ -version=5.12.1 +version=5.13.0 description=EPAM Report portal. Service jobs dockerServerUrl=unix:///var/run/docker.sock dockerPrepareEnvironment=