Skip to content

Commit

Permalink
Release 5.12.0
Browse files Browse the repository at this point in the history
  • Loading branch information
APiankouski authored Sep 2, 2024
2 parents 4d7eaa4 + 02ab653 commit d34f50d
Show file tree
Hide file tree
Showing 199 changed files with 2,548 additions and 1,412 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ on:

env:
GH_USER_NAME: github.actor
SCRIPTS_VERSION: 5.11.0
BOM_VERSION: 5.11.7
MIGRATIONS_VERSION: 5.11.0
RELEASE_VERSION: 5.11.6
SCRIPTS_VERSION: 5.12.0
BOM_VERSION: 5.12.0
MIGRATIONS_VERSION: 5.12.0
RELEASE_VERSION: 5.12.0

jobs:
release:
Expand Down
46 changes: 16 additions & 30 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,24 +1,9 @@
import org.owasp.dependencycheck.reporting.ReportGenerator

/*
* Copyright 2019 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
*
* 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 'io.spring.dependency-management' version '1.0.9.RELEASE'
id 'java'
id 'java-library'
id 'nu.studer.jooq' version '3.0.3'
id 'org.owasp.dependencycheck' version '5.3.1'
}
Expand All @@ -41,33 +26,34 @@ repositories {

dependencyManagement {
imports {
mavenBom(releaseMode ? 'com.epam.reportportal:commons-bom:' + getProperty('bom.version') : 'com.github.reportportal:commons-bom:b929af1e08')
mavenBom('io.zonky.test.postgres:embedded-postgres-binaries-bom:12.9.0')
mavenBom(releaseMode ? 'com.epam.reportportal:commons-bom:5.12.0' : 'com.epam.reportportal:commons-bom:5.12.0')
mavenBom('io.zonky.test.postgres:embedded-postgres-binaries-bom:16.2.0')
}
}

dependencies {
if (releaseMode) {
compile 'com.epam.reportportal:commons'
compile 'com.epam.reportportal:commons-rules'
compile 'com.epam.reportportal:commons-model'
} else {
compile 'com.github.reportportal:commons:07566b8e'
compile 'com.epam.reportportal:commons-rules'
compile 'com.github.reportportal:commons-model:83f012f'
implementation 'com.github.reportportal:commons:d4be022'
}

implementation 'org.springframework.security:spring-security-core'
implementation 'org.springframework:spring-webmvc'
implementation 'org.apache.tika:tika-core'

//https://nvd.nist.gov/vuln/detail/CVE-2020-10683 (dom4j 2.1.3 version dependency) AND https://nvd.nist.gov/vuln/detail/CVE-2019-14900
compile('org.springframework.boot:spring-boot-starter-data-jpa') {
exclude group: 'org.hibernate', module: 'hibernate-core'
}
compile('org.hibernate:hibernate-core:5.4.18.Final')
implementation 'org.springframework:spring-jdbc:5.3.33'
implementation 'org.hibernate:hibernate-core:5.6.15.Final'
//

//https://nvd.nist.gov/vuln/detail/CVE-2020-13692
compile 'org.postgresql:postgresql:42.2.13'
compile 'org.postgresql:postgresql:42.7.3'
compile 'org.jooq:jooq'
jooqRuntime 'org.postgresql:postgresql:42.2.13'
jooqRuntime 'org.postgresql:postgresql:42.7.3'

compile 'io.minio:minio:6.0.13'

Expand All @@ -83,7 +69,7 @@ dependencies {

compile 'org.jasypt:jasypt:1.9.3'

compile 'io.zonky.test:embedded-postgres:1.2.6'
compile 'io.zonky.test:embedded-postgres:2.0.6'
//Fix CVE-2024-25710, CVE-2024-26308
compile 'org.apache.commons:commons-compress:1.26.0'
compile 'org.flywaydb:flyway-core:6.3.1'
Expand All @@ -100,9 +86,9 @@ dependencies {
implementation 'org.springframework.boot:spring-boot-starter-cache'
implementation 'com.github.ben-manes.caffeine:caffeine'

testCompile 'org.springframework.boot:spring-boot-starter-test'
testCompile 'org.flywaydb.flyway-test-extensions:flyway-spring-test:6.1.0'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
testImplementation 'org.flywaydb.flyway-test-extensions:flyway-spring-test:6.1.0'

}

dependencyCheck {
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
version=5.11.7
version=5.12.0
lombokVersion=1.18.30
17 changes: 15 additions & 2 deletions jooq.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,22 @@ jooq {
}
database {
name = 'org.jooq.meta.postgres.PostgresDatabase'
inputSchema = 'public'
inputSchema = (hasDBSchema ? getProperty('DB_SCHEMA_POSTGRES') : 'public')
// ...
excludes = 'batch_.*|schema_migrations'
forcedTypes {
forcedType {

// Specify the Java type of your custom type. This corresponds to the Converter's <U> type.
userType = "java.time.Instant"

// Associate that custom type with your converter.
converter = "com.epam.ta.reportportal.dao.converters.JooqInstantConverter"

// A Java regex matching fully-qualified columns, attributes, parameters. Use the pipe to separate several expressions.
types = "TIMESTAMP"
}
}
}
generate {
pojos = false
Expand All @@ -36,4 +49,4 @@ jooq {

generateSampleJooqSchemaSource {
enabled = false
}
}
20 changes: 15 additions & 5 deletions project-properties.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,10 @@ project.ext {
publishRepo = "https://maven.pkg.github.com/reportportal/commons-dao"
dependencyRepos = ["commons", "commons-rules", "commons-model", "commons-bom"]
releaseMode = project.hasProperty("releaseMode")
scriptsUrl = commonScriptsUrl + (releaseMode ? getProperty('scripts.version') : 'master')
migrationsUrl = migrationsScriptsUrl + (releaseMode ? getProperty('migrations.version') : 'feature/settings')
hasDBSchema = project.hasProperty("DB_SCHEMA_POSTGRES")
scriptsUrl = commonScriptsUrl + (releaseMode ? getProperty('scripts.version') : 'develop')
migrationsUrl = migrationsScriptsUrl + (releaseMode ? getProperty('migrations.version') : 'develop')

//TODO refactor with archive download
testScriptsSrc = [
(migrationsUrl + '/migrations/0_extensions.up.sql') : 'V001__extensions.sql',
Expand Down Expand Up @@ -78,6 +80,9 @@ project.ext {
(migrationsUrl + '/migrations/76_user_bid_extension.up.sql') : 'V076__user_bid_extension.sql',
(migrationsUrl + '/migrations/77_email_server_documentation_link.up.sql') : 'V077__email_server_documentation_link.sql',
(migrationsUrl + '/migrations/78_drop_redundant_index.up.sql') : 'V078__drop_redundant_index.sql',
(migrationsUrl + '/migrations/84_notication_update.up.sql') : 'V084__notication_update.sql',
(migrationsUrl + '/migrations/86_add_retention_policy_launch.up.sql') : 'V086__add_retention_policy_launch.sql',
(migrationsUrl + '/migrations/88_analytics_data_table.up.sql') : 'V088__analytics_data_table.sql',

]
excludeTests = [
Expand All @@ -89,11 +94,16 @@ project.ext {
'com/epam/ta/reportportal/entity/oauth',
'com/epam/ta/reportportal/entity/bts',
'com/epam/ta/reportportal/entity/ldap',
'com/epam/ta/reportportal/entity/widget/content/**'
'com/epam/ta/reportportal/entity/jasper',
'com/epam/ta/reportportal/entity/widget/content/**',
'com/epam/reportportal/rules/exception',
'com/epam/ta/reportportal/dao/custom',
'com/epam/ta/reportportal/entity/log',
'com/epam/ta/reportportal/entity/item'
]
limits = [
'instruction': 70,
'branch' : 34,
'instruction': 75,
'branch' : 35,
'line' : 60,
'complexity' : 49,
'method' : 55,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@

package com.epam.ta.reportportal.binary;

import com.epam.reportportal.rules.exception.ErrorType;
import com.epam.reportportal.rules.exception.ReportPortalException;
import com.epam.ta.reportportal.dao.LogRepository;
import com.epam.ta.reportportal.entity.attachment.Attachment;
import com.epam.ta.reportportal.entity.log.Log;
import com.epam.ta.reportportal.exception.ReportPortalException;
import com.epam.ta.reportportal.ws.model.ErrorType;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,9 @@

package com.epam.ta.reportportal.binary.impl;

import static com.epam.ta.reportportal.binary.impl.DataStoreUtils.PROJECT_PATH;
import static com.epam.ta.reportportal.binary.impl.DataStoreUtils.isContentTypePresent;
import static com.epam.ta.reportportal.binary.impl.DataStoreUtils.resolveExtension;
import static com.epam.ta.reportportal.commons.validation.BusinessRule.expect;
import static com.epam.ta.reportportal.commons.validation.Suppliers.formattedSupplier;

import com.epam.reportportal.commons.ContentTypeResolver;
import com.epam.reportportal.rules.exception.ErrorType;
import com.epam.reportportal.rules.exception.ReportPortalException;
import com.epam.ta.reportportal.binary.AttachmentBinaryDataService;
import com.epam.ta.reportportal.binary.CreateLogAttachmentService;
import com.epam.ta.reportportal.binary.DataStoreService;
Expand All @@ -33,18 +29,8 @@
import com.epam.ta.reportportal.entity.attachment.AttachmentMetaInfo;
import com.epam.ta.reportportal.entity.attachment.BinaryData;
import com.epam.ta.reportportal.entity.enums.FeatureFlag;
import com.epam.ta.reportportal.exception.ReportPortalException;
import com.epam.ta.reportportal.filesystem.FilePathGenerator;
import com.epam.ta.reportportal.util.FeatureFlagHandler;
import com.epam.ta.reportportal.ws.model.ErrorType;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.nio.file.Paths;
import java.util.Optional;
import java.util.function.Predicate;
import java.util.stream.Collectors;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
Expand All @@ -54,6 +40,19 @@
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.multipart.commons.CommonsMultipartFile;

import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.nio.file.Paths;
import java.util.Optional;
import java.util.function.Predicate;
import java.util.stream.Collectors;

import static com.epam.reportportal.rules.commons.validation.BusinessRule.expect;
import static com.epam.reportportal.rules.commons.validation.Suppliers.formattedSupplier;
import static com.epam.ta.reportportal.binary.impl.DataStoreUtils.*;

/**
* @author <a href="mailto:ihar_kahadouski@epam.com">Ihar Kahadouski</a>
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,28 +16,16 @@

package com.epam.ta.reportportal.binary.impl;

import static com.epam.ta.reportportal.binary.impl.DataStoreUtils.ATTACHMENT_CONTENT_TYPE;
import static com.epam.ta.reportportal.binary.impl.DataStoreUtils.PHOTOS_PATH;
import static com.epam.ta.reportportal.binary.impl.DataStoreUtils.ROOT_USER_PHOTO_DIR;
import static com.epam.ta.reportportal.binary.impl.DataStoreUtils.USER_DATA_PATH;
import static com.epam.ta.reportportal.binary.impl.DataStoreUtils.buildThumbnailFileName;
import static java.util.Optional.ofNullable;

import com.epam.reportportal.rules.exception.ErrorType;
import com.epam.reportportal.rules.exception.ReportPortalException;
import com.epam.ta.reportportal.binary.DataStoreService;
import com.epam.ta.reportportal.binary.UserBinaryDataService;
import com.epam.ta.reportportal.entity.Metadata;
import com.epam.ta.reportportal.entity.attachment.BinaryData;
import com.epam.ta.reportportal.entity.enums.FeatureFlag;
import com.epam.ta.reportportal.entity.user.User;
import com.epam.ta.reportportal.exception.ReportPortalException;
import com.epam.ta.reportportal.util.FeatureFlagHandler;
import com.epam.ta.reportportal.ws.model.ErrorType;
import com.google.common.collect.Maps;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.nio.file.Paths;
import java.util.Optional;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
Expand All @@ -48,6 +36,15 @@
import org.springframework.util.StreamUtils;
import org.springframework.web.multipart.MultipartFile;

import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.nio.file.Paths;
import java.util.Optional;

import static com.epam.ta.reportportal.binary.impl.DataStoreUtils.*;
import static java.util.Optional.ofNullable;

/**
* @author <a href="mailto:ihar_kahadouski@epam.com">Ihar Kahadouski</a>
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
import com.epam.ta.reportportal.entity.activity.EventPriority;
import com.epam.ta.reportportal.entity.activity.EventSubject;
import com.epam.ta.reportportal.entity.activity.HistoryField;
import java.time.LocalDateTime;
import java.time.Instant;
import java.util.Optional;
import java.util.function.Supplier;

Expand Down Expand Up @@ -87,13 +87,13 @@ public ActivityBuilder addHistoryField(Optional<HistoryField> historyField) {
return this;
}

public ActivityBuilder addCreatedAt(LocalDateTime localDateTime) {
activity.setCreatedAt(localDateTime);
public ActivityBuilder addCreatedAt(Instant instant) {
activity.setCreatedAt(instant);
return this;
}

public ActivityBuilder addCreatedNow() {
activity.setCreatedAt(LocalDateTime.now());
activity.setCreatedAt(Instant.now());
return this;
}

Expand Down Expand Up @@ -127,4 +127,4 @@ public Activity get() {
activity.setDetails(details);
return activity;
}
}
}
14 changes: 14 additions & 0 deletions src/main/java/com/epam/ta/reportportal/commons/EntityUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
import static java.util.Optional.ofNullable;

import com.google.common.base.Preconditions;
import java.sql.Timestamp;
import java.time.Instant;
import java.time.LocalDateTime;
import java.time.ZoneOffset;
import java.util.Date;
Expand All @@ -38,9 +40,21 @@ public class EntityUtils {
date).map(d -> LocalDateTime.ofInstant(d.toInstant(),
ZoneOffset.UTC
)).orElse(null);

public static final Function<LocalDateTime, Date> TO_DATE = localDateTime -> ofNullable(
localDateTime).map(l -> Date.from(l.atZone(
ZoneOffset.UTC).toInstant())).orElse(null);

public static final Function<Instant, LocalDateTime> INSTANT_TO_LDT = instant ->
ofNullable(instant)
.map(i -> i.atZone(ZoneOffset.UTC).toLocalDateTime())
.orElse(null);

public static final Function<Instant, Timestamp> INSTANT_TO_TIMESTAMP = instant ->
ofNullable(instant)
.map(i -> i.atZone(ZoneOffset.UTC).toLocalDateTime())
.map(Timestamp::valueOf)
.orElse(null);
/**
* Remove leading and trailing spaces from list of string
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

package com.epam.ta.reportportal.commons;

import com.epam.ta.reportportal.exception.ReportPortalException;
import com.epam.reportportal.rules.exception.ReportPortalException;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.ObjectMapper;
Expand Down
Loading

0 comments on commit d34f50d

Please sign in to comment.