Skip to content

Commit 9dbfac8

Browse files
pbortnikraikbittersEvelina02grabsefx
authored
Release 5.15.0 (#1182)
* EPMRPP-106335 || Added a flag for largest retry priority (#1135) * Add UUID and external ID search methods to UserRepository (#1136) * Add optimized methods for user authentication data retrieval by login… (#1140) * Add optimized methods for user authentication data retrieval by login and external ID * Add UserAuthProjection for optimized authentication data handling * Implement caching for user authentication data retrieval and eviction… (#1143) * Implement caching for user authentication data retrieval and eviction on save/delete * EPMRPP-106359 || Add max steps before failed query (#1142) * EPMRPP-106359 || Add max steps before failed query (#1145) * EPMRPP-106359 || Add max steps before failed query * EPMRPP-106359 || Added query findNestedLogsWithItemPathPattern * EPMRPP-106359 || Fix query * EPMRPP-106359 || Add cast ot lquery * EPMRPP-106359 || Add cast ot lquery * EPMRPP-106359 || Rename params * EPMRPP-106359 || Rename params * EPMRPP_106359 || Add start time sorting to the max steps before failed query * EPMRPP_106359 || Replace query with optimized one for searching nested logs of retry * EPMRPP-107835 || Select hasNestedSteps flag (#1157) * EPMRPP-107835 has nested steps * Update TestItemRepository.java * EPMRPP-107835 batch method * EPMRPP-108013 add log type (#1164) * EPMRPP-108032 || Add log type methods (#1166) * EPMRPP-108032 add log type methods * EPMRPP-108032 rewrite to native query * EPMRPP-108396 reporting (#1167) * EPMRPP-108716 || Add caching for project log types retrieval (#1168) * EPMRPP-108558 filtering with custom log types (#1170) * EPMRPP-108045 fix update checks (#1171) * EPMRPP-108466 log type events (#1172) * EPMRPP-107920 || Add analysis owner id column (#1173) * EPMRPP-107920 analysis owner column * EPMRPP-107920 roll back migrations branch * EPMRPP-109253 evict log type cache (#1174) * EPMRPP-109620 upgrade libs (#1179) * EPMRPP-110519 | Fix log locations (#1180) * EPMRPP-110519 fix log locations * EPMRPP-110519 small fixes * Update release version * 5.15.0 || Update release version * EPMRPP-110740 || Add launch id to the search query * 5.15.0 || Update versions --------- Co-authored-by: Reingold Shekhtel <13565058+raikbitters@users.noreply.github.com> Co-authored-by: Evelina Sarkisian <59954853+Evelina02@users.noreply.github.com> Co-authored-by: Siarhei Hrabko <45555481+grabsefx@users.noreply.github.com>
1 parent 9b69ec5 commit 9dbfac8

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+3895
-270
lines changed

.github/workflows/release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ env:
1313
GH_USER_NAME: github.actor
1414
SCRIPTS_VERSION: 5.14.0
1515
BOM_VERSION: 5.14.2
16-
MIGRATIONS_VERSION: 5.14.0
17-
RELEASE_VERSION: 5.14.5
16+
MIGRATIONS_VERSION: 5.15.0
17+
RELEASE_VERSION: 5.15.0
1818

1919
jobs:
2020
release:

build.gradle

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,7 @@ apply from: 'jooq.gradle'
1818

1919
repositories {
2020
mavenCentral { url "https://repo1.maven.org/maven2" }
21-
22-
if (!releaseMode) {
23-
maven { url 'https://jitpack.io' }
24-
}
21+
maven { url 'https://jitpack.io' }
2522
}
2623

2724
java {
@@ -39,11 +36,8 @@ dependencyManagement {
3936
}
4037

4138
dependencies {
42-
if (releaseMode) {
43-
implementation 'com.epam.reportportal:commons'
44-
} else {
45-
implementation 'com.github.reportportal:commons:c6f3174'
46-
}
39+
implementation 'com.github.reportportal:commons:5.15.0'
40+
4741
implementation "io.swagger.core.v3:swagger-annotations-jakarta:2.2.27"
4842
// jooq dependencies
4943
api "org.jooq:jooq:${jooqVersion}"
@@ -55,35 +49,35 @@ dependencies {
5549

5650
implementation 'org.springframework.security:spring-security-core'
5751
implementation 'org.springframework:spring-webmvc'
58-
implementation 'org.apache.tika:tika-core'
52+
implementation 'org.apache.tika:tika-core:3.2.2'
5953
api('org.springframework.boot:spring-boot-starter-data-jpa') {
6054
exclude group: 'org.hibernate', module: 'hibernate-core'
6155
}
6256
implementation 'org.springframework.boot:spring-boot-starter-cache'
6357
implementation 'com.github.ben-manes.caffeine:caffeine'
6458

65-
implementation 'io.minio:minio:8.5.17'
59+
implementation 'io.minio:minio:8.6.0'
6660

6761
api 'com.fasterxml.jackson.datatype:jackson-datatype-jsr310'
6862
implementation "org.hibernate.validator:hibernate-validator:${hibernateValidatorVersion}"
6963

7064
api 'org.apache.commons:commons-collections4:4.4'
71-
api ('commons-validator:commons-validator:1.9.0') { // for EmailValidator only
65+
api('commons-validator:commons-validator:1.10.0') { // for EmailValidator only
7266
exclude group: 'commons-beanutils', module: 'commons-beanutils'
7367
}
7468

7569
api 'org.jasypt:jasypt:1.9.3'
7670

77-
api 'io.zonky.test:embedded-postgres:2.0.7'
78-
api 'org.apache.commons:commons-compress:1.27.1'
71+
api 'io.zonky.test:embedded-postgres:2.2.0'
72+
api 'org.apache.commons:commons-compress:1.28.0'
7973
implementation 'org.flywaydb:flyway-core:10.15.2'
8074
implementation 'org.flywaydb:flyway-database-postgresql:10.20.0'
8175

8276
api "org.apache.jclouds.api:s3:${jcloudsVersion}"
8377
api "org.apache.jclouds.provider:aws-s3:${jcloudsVersion}"
8478
api "org.apache.jclouds.api:filesystem:${jcloudsVersion}"
85-
implementation 'software.amazon.awssdk:aws-core:2.29.50'
86-
implementation 'software.amazon.awssdk:sts:2.29.50'
79+
implementation 'software.amazon.awssdk:aws-core:2.38.9'
80+
implementation 'software.amazon.awssdk:sts:2.38.9'
8781
api 'com.google.guava:guava:33.2.1-jre'
8882

8983
// add lombok support

gradle.properties

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
version=5.14.5
2-
springBootVersion=3.4.2
3-
lombokVersion=1.18.36
1+
version=5.15.0
2+
springBootVersion=3.4.12
3+
lombokVersion=1.18.42
44
jooqVersion=3.19.18
5-
jdbcDriverVersion=42.7.5
5+
jdbcDriverVersion=42.7.8
66
jcloudsVersion=2.6.0
7-
hibernateValidatorVersion=8.0.2.Final
7+
hibernateValidatorVersion=8.0.2.Final

project-properties.gradle

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ project.ext {
77
releaseMode = project.hasProperty("releaseMode") ? project.releaseMode.toBoolean() : false
88
hasDBSchema = project.hasProperty("DB_SCHEMA_POSTGRES")
99
scriptsUrl = commonScriptsUrl + (releaseMode ? getProperty('scripts.version') : 'develop')
10-
migrationsUrl = migrationsScriptsUrl + (releaseMode ? getProperty('migrations.version') : 'develop')
10+
migrationsUrl = migrationsScriptsUrl + (releaseMode ? getProperty('migrations.version') : 'feature/upcoming')
1111

1212
//TODO refactor with archive download
1313
testScriptsSrc = [
@@ -86,6 +86,8 @@ project.ext {
8686
(migrationsUrl + '/migrations/96_create_groups_tables.up.sql') : 'V096__create_groups_tables.sql',
8787
(migrationsUrl + '/migrations/97_add_groups_uuid.up.sql') : 'V097__add_groups_uuid.up.sql',
8888
(migrationsUrl + '/migrations/98_add_plugin_type.up.sql') : 'V098__add_plugin_type.up.sql',
89+
(migrationsUrl + '/migrations/106_create_log_type_table.up.sql') : 'V106__create_log_type_table.sql',
90+
(migrationsUrl + '/migrations/107_add_analysis_owner.up.sql') : 'V107__add_analysis_owner.sql'
8991
]
9092
excludeTests = [
9193
'com/epam/ta/reportportal/jooq/**',

src/main/java/com/epam/ta/reportportal/commons/querygen/CriteriaHolder.java

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -175,14 +175,7 @@ public Object castValue(String oneValue, ErrorType errorType) {
175175
getDataType())) {
176176
castedValue = BooleanUtils.toBoolean(oneValue);
177177
} else if (LogLevel.class.isAssignableFrom(getDataType())) {
178-
Optional<LogLevel> level = LogLevel.toLevel(oneValue);
179-
BusinessRule.expect(level, Optional::isPresent)
180-
.verify(errorType,
181-
formattedSupplier("Cannot convert '{}' to valid 'LogLevel'", oneValue));
182-
castedValue = level.get().toInt();
183-
BusinessRule.expect(castedValue, Objects::nonNull)
184-
.verify(errorType,
185-
formattedSupplier("Cannot convert '{}' to valid 'LogLevel'", oneValue));
178+
castedValue = parseLong(oneValue, errorType);
186179
} else if (JStatusEnum.class.isAssignableFrom(getDataType())) {
187180

188181
Optional<StatusEnum> status = StatusEnum.fromValue(oneValue);

src/main/java/com/epam/ta/reportportal/commons/querygen/FilterTarget.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -957,6 +957,7 @@ private List<Field<?>> getSelectSimpleFields() {
957957
TEST_ITEM.HAS_STATS,
958958
TEST_ITEM.HAS_RETRIES,
959959
TEST_ITEM.LAUNCH_ID,
960+
TEST_ITEM.ANALYSIS_OWNER_ID,
960961
TEST_ITEM_RESULTS.STATUS,
961962
TEST_ITEM_RESULTS.END_TIME,
962963
TEST_ITEM_RESULTS.DURATION,
@@ -1079,6 +1080,7 @@ protected Collection<? extends SelectField> selectFields() {
10791080
LOG.LOG_LEVEL,
10801081
LOG.ITEM_ID,
10811082
LOG.LAUNCH_ID,
1083+
LOG.PROJECT_ID,
10821084
LOG.ATTACHMENT_ID,
10831085
ATTACHMENT.ID,
10841086
ATTACHMENT.FILE_ID,

src/main/java/com/epam/ta/reportportal/dao/LogRepository.java

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

1717
package com.epam.ta.reportportal.dao;
1818

19+
import com.epam.reportportal.model.analyzer.IndexLog;
1920
import com.epam.ta.reportportal.entity.log.Log;
2021
import java.sql.Timestamp;
2122
import java.util.Collection;
@@ -38,6 +39,39 @@ public interface LogRepository extends ReportPortalRepository<Log, Long>, LogRep
3839

3940
long countLogsByLaunchId(Long launchId);
4041

42+
@Query(value = """
43+
WITH ParentPath AS (
44+
SELECT path
45+
FROM test_item ti2
46+
WHERE ti2.item_id = (
47+
SELECT parent_id
48+
FROM test_item ti3
49+
WHERE ti3.item_id = :itemId
50+
)
51+
),
52+
TargetPath AS (
53+
SELECT cast(concat(pp.path, '.', :itemId) as ltree) AS path
54+
FROM ParentPath pp
55+
),
56+
FilteredItems AS (
57+
SELECT ti.item_id
58+
FROM test_item ti
59+
WHERE ti.path <@ (SELECT path FROM TargetPath)
60+
)
61+
SELECT
62+
log.id AS logId,
63+
log.log_level AS logLevel,
64+
log.log_time AS logTime,
65+
log.log_message AS message,
66+
clusters.index_id AS clusterId
67+
FROM log
68+
LEFT JOIN clusters ON log.cluster_id = clusters.id
69+
WHERE log.item_id IN (SELECT item_id FROM FilteredItems)
70+
AND log.log_level >= :logLevel;
71+
""", nativeQuery = true)
72+
List<IndexLog> findNestedLogsOfRetryItem(@Param("itemId") Long itemId,
73+
@Param("logLevel") int logLevel);
74+
4175
@Modifying
4276
@Query(value = "UPDATE log SET launch_id = :newLaunchId WHERE launch_id = :currentLaunchId", nativeQuery = true)
4377
void updateLaunchIdByLaunchId(@Param("currentLaunchId") Long currentLaunchId,

src/main/java/com/epam/ta/reportportal/dao/LogRepositoryCustom.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,18 @@ List<NestedItemPage> findNestedItemsWithPage(Long parentId, boolean excludeEmpty
202202
boolean excludeLogs,
203203
Queryable filter, Pageable pageable);
204204

205+
/**
206+
* Returns log ids with page numbers calculated in DB using provided pageable (sort + size).
207+
*
208+
* @param filter log filter
209+
* @param pageable page + sort used for page number calculation
210+
* @return list of entries (logId, pageNumber, logLevel)
211+
*/
212+
List<LogPageEntry> findLogIdsWithPage(Queryable filter, Pageable pageable);
213+
214+
record LogPageEntry(Long id, Integer pageNumber, Integer logLevel) {
215+
}
216+
205217
/**
206218
* Retrieves log message of specified test item with log level greather or equals than
207219
* {@code level}

src/main/java/com/epam/ta/reportportal/dao/LogRepositoryCustomImpl.java

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@
7979
import org.jooq.Field;
8080
import org.jooq.OrderField;
8181
import org.jooq.Record;
82+
import org.jooq.Record3;
8283
import org.jooq.Record4;
8384
import org.jooq.SelectConditionStep;
8485
import org.jooq.SelectHavingStep;
@@ -213,6 +214,38 @@ public List<Long> findIdsByFilter(Queryable filter) {
213214
.fetchInto(Long.class);
214215
}
215216

217+
@Override
218+
public List<LogPageEntry> findLogIdsWithPage(Queryable filter, Pageable pageable) {
219+
Set<String> fields = QueryUtils.collectJoinFields(filter);
220+
var baseSelect = QueryBuilder.newBuilder(filter, fields).build();
221+
222+
List<OrderField<?>> orderFields = buildLogOrderFields(pageable);
223+
int pageSize = pageable.getPageSize();
224+
225+
Table<?> baseTable = baseSelect.asTable("base_logs");
226+
227+
Field<Integer> pageField = DSL.rowNumber()
228+
.over(DSL.orderBy(orderFields))
229+
.minus(1)
230+
.div(pageSize)
231+
.plus(1)
232+
.as(PAGE_NUMBER);
233+
234+
List<Record3<Long, Integer, Integer>> rows = dsl
235+
.select(fieldName(baseTable.getName(), ID).cast(Long.class),
236+
pageField,
237+
LOG.LOG_LEVEL)
238+
.from(baseTable)
239+
.join(LOG)
240+
.on(fieldName(baseTable.getName(), ID).cast(Long.class).eq(LOG.ID))
241+
.orderBy(orderFields)
242+
.fetch();
243+
244+
return rows.stream()
245+
.map(r -> new LogPageEntry(r.value1(), r.value2(), r.value3()))
246+
.toList();
247+
}
248+
216249
@Override
217250
public List<Long> findIdsByTestItemId(Long testItemId) {
218251
return dsl.select(LOG.ID).from(LOG).where(LOG.ITEM_ID.eq(testItemId)).fetchInto(Long.class);
@@ -453,6 +486,22 @@ public int deleteByProjectId(Long projectId) {
453486
return dsl.deleteFrom(LOG).where(LOG.PROJECT_ID.eq(projectId)).execute();
454487
}
455488

489+
private List<OrderField<?>> buildLogOrderFields(Pageable pageable) {
490+
Sort sort = pageable.getSort();
491+
492+
SortField<?> logTimeOrder = sort.stream()
493+
.filter(order -> CRITERIA_LOG_TIME.equals(order.getProperty()))
494+
.findFirst()
495+
.filter(order -> !order.isAscending())
496+
.map(order -> LOG.LOG_TIME.sort(SortOrder.DESC))
497+
.orElse(LOG.LOG_TIME.sort(SortOrder.ASC));
498+
499+
return List.of(
500+
logTimeOrder,
501+
LOG.ID.sort(SortOrder.ASC)
502+
);
503+
}
504+
456505
private SelectConditionStep<? extends Record> buildLogsUnderItemsQuery(Long launchId,
457506
List<Long> itemIds, boolean includeAttachments) {
458507

0 commit comments

Comments
 (0)