Skip to content

Commit

Permalink
Merge branch 'develop' into EPMRPP-87593
Browse files Browse the repository at this point in the history
# Conflicts:
#	build.gradle
  • Loading branch information
grabsefx committed Nov 20, 2023
2 parents e91613d + 186a2af commit e159b3b
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 24 deletions.
4 changes: 0 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
FROM --platform=$BUILDPLATFORM gradle:6.8.3-jdk11 AS build
ARG RELEASE_MODE
ARG APP_VERSION
ARG GITHUB_USER
ARG GITHUB_TOKEN
WORKDIR /usr/app
COPY . /usr/app
RUN if [ "${RELEASE_MODE}" = true ]; then \
gradle build --exclude-task test \
-PreleaseMode=true \
-PgithubUserName=${GITHUB_USER} \
-PgithubToken=${GITHUB_TOKEN} \
-Dorg.gradle.project.version=${APP_VERSION}; \
else gradle build --exclude-task test -Dorg.gradle.project.version=${APP_VERSION}; fi

Expand Down
22 changes: 7 additions & 15 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -37,19 +37,11 @@ project.hasProperty('sealightsSession') && sealightsSession?.trim() ? apply(from

repositories {
mavenCentral { url "https://repo1.maven.org/maven2" }
if (releaseMode) {
dependencyRepos.forEach { path ->
maven {
setUrl("https://maven.pkg.github.com/reportportal/${path}")
credentials {
username = findProperty("githubUserName")
password = findProperty("githubToken")
}
}
}
} else {

if (!releaseMode) {
maven { url 'https://jitpack.io' }
}

// maven { url "http://jasperreports.sourceforge.net/maven2" }
// maven { url "http://jaspersoft.artifactoryonline.com/jaspersoft/third-party-ce-artifacts" }
maven { url "https://jaspersoft.jfrog.io/artifactory/third-party-ce-artifacts" }
Expand Down Expand Up @@ -84,12 +76,12 @@ dependencies {
implementation 'com.epam.reportportal:plugin-api'
} else {
implementation 'com.github.reportportal:commons-events:e337f8b7be'
implementation 'com.github.reportportal:commons-dao:6f11ff3'
implementation 'com.github.reportportal:commons-rules:29c30a1'
implementation 'com.github.reportportal:commons-dao:dafe9b4d'
implementation 'com.github.reportportal:commons-rules:01ec4d17'
implementation 'com.github.reportportal:commons-model:83f012f'
implementation 'com.github.reportportal:commons:ce2166b'
implementation 'com.github.reportportal:commons:07566b8e'
implementation 'com.github.reportportal:commons-fonts:d6e62dd'
implementation 'com.github.reportportal:plugin-api:3876fab'
implementation 'com.github.reportportal:plugin-api:55bf2f26'
}

implementation 'org.springframework.boot:spring-boot-starter-aop'
Expand Down
11 changes: 6 additions & 5 deletions src/main/java/com/epam/ta/reportportal/job/FlushingDataJob.java
Original file line number Diff line number Diff line change
Expand Up @@ -130,11 +130,7 @@ public void execute(JobExecutionContext context) {
* Get exclusive lock. Kill all running transactions. Truncate tables
*/
private void truncateTables() {
jdbcTemplate.execute("BEGIN; " + "SELECT PG_ADVISORY_XACT_LOCK(1);"
+ "SELECT PG_TERMINATE_BACKEND(pid) FROM pg_stat_activity WHERE datname = 'reportportal'\n"
+ "AND pid <> PG_BACKEND_PID()\n"
+ "AND state IN "
+ "('idle', 'idle in transaction', 'idle in transaction (aborted)', 'disabled'); "
jdbcTemplate.execute("BEGIN; "
+ "TRUNCATE TABLE launch RESTART IDENTITY CASCADE;"
+ "TRUNCATE TABLE activity RESTART IDENTITY CASCADE;"
+ "TRUNCATE TABLE owned_entity RESTART IDENTITY CASCADE;"
Expand Down Expand Up @@ -171,9 +167,14 @@ private void deleteUser(User user) {
}

private void deleteProject(Project project) {
Set<Long> defaultIssueTypeIds = issueTypeRepository.getDefaultIssueTypes()
.stream()
.map(IssueType::getId)
.collect(Collectors.toSet());
Set<IssueType> issueTypesToRemove = project.getProjectIssueTypes()
.stream()
.map(ProjectIssueType::getIssueType)
.filter(issueType -> !defaultIssueTypeIds.contains(issueType.getId()))
.collect(Collectors.toSet());
projectRepository.delete(project);
analyzerServiceClient.removeSuggest(project.getId());
Expand Down

0 comments on commit e159b3b

Please sign in to comment.