From 77133ce9614d967947950e9c47255eb12cba1133 Mon Sep 17 00:00:00 2001 From: murphp15 Date: Tue, 13 Dec 2022 18:32:28 +0000 Subject: [PATCH 01/56] control-service: java 17 Signed-off-by: murphp15 --- .../projects/gradle/wrapper/gradle-wrapper.properties | 2 +- projects/control-service/projects/java-common.gradle | 4 ++-- .../projects/model/gradle/wrapper/gradle-wrapper.properties | 2 +- .../projects/pipelines_control_service/Dockerfile | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/projects/control-service/projects/gradle/wrapper/gradle-wrapper.properties b/projects/control-service/projects/gradle/wrapper/gradle-wrapper.properties index 05679dc3c1..070cb702f0 100644 --- a/projects/control-service/projects/gradle/wrapper/gradle-wrapper.properties +++ b/projects/control-service/projects/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.1.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/projects/control-service/projects/java-common.gradle b/projects/control-service/projects/java-common.gradle index 40113decd8..0e48d14116 100644 --- a/projects/control-service/projects/java-common.gradle +++ b/projects/control-service/projects/java-common.gradle @@ -1,5 +1,5 @@ apply plugin: 'java' apply plugin: 'idea' -sourceCompatibility = '11' -targetCompatibility = '11' +sourceCompatibility = '17' +targetCompatibility = '17' group 'com.vmware.taurus' diff --git a/projects/control-service/projects/model/gradle/wrapper/gradle-wrapper.properties b/projects/control-service/projects/model/gradle/wrapper/gradle-wrapper.properties index 05679dc3c1..070cb702f0 100644 --- a/projects/control-service/projects/model/gradle/wrapper/gradle-wrapper.properties +++ b/projects/control-service/projects/model/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.1.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/projects/control-service/projects/pipelines_control_service/Dockerfile b/projects/control-service/projects/pipelines_control_service/Dockerfile index d362a29c5f..26a91d0126 100644 --- a/projects/control-service/projects/pipelines_control_service/Dockerfile +++ b/projects/control-service/projects/pipelines_control_service/Dockerfile @@ -4,7 +4,7 @@ # Builder stage # This stage is implemented like in the guide, but it may be more efficient to # have it in the gradle build process outside docker. -FROM adoptopenjdk:11-jre-hotspot as builder +FROM adoptopenjdk:17-jre-hotspot as builder ARG JAR_NAME WORKDIR application COPY ./${JAR_NAME} application.jar From 6025509c45edd4c3625175e2a9c475cbf262dc04 Mon Sep 17 00:00:00 2001 From: murphp15 Date: Wed, 14 Dec 2022 13:55:33 +0000 Subject: [PATCH 02/56] java 17 Signed-off-by: murphp15 --- projects/control-service/cicd/.gitlab-ci.yml | 8 ++++---- .../projects/pipelines_control_service/Dockerfile | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/projects/control-service/cicd/.gitlab-ci.yml b/projects/control-service/cicd/.gitlab-ci.yml index f4e9727361..abd73cac49 100644 --- a/projects/control-service/cicd/.gitlab-ci.yml +++ b/projects/control-service/cicd/.gitlab-ci.yml @@ -26,7 +26,7 @@ variables: _JAVA_OPTIONS: "-Xms2048m -Xmx4096m" before_script: - - apk --no-cache add git zip openjdk11-jdk curl zip python3 py3-pip --repository=http://dl-cdn.alpinelinux.org/alpine/edge/community + - apk --no-cache add git zip openjdk17-jdk curl zip python3 py3-pip --repository=http://dl-cdn.alpinelinux.org/alpine/edge/community - pip3 install --upgrade pip && pip3 install awscli control_service_build_image: @@ -39,7 +39,7 @@ control_service_build_image: DOCKER_TLS_CERTDIR: "" stage: build script: - - apk --no-cache add git openjdk11-jdk --repository=http://dl-cdn.alpinelinux.org/alpine/edge/community + - apk --no-cache add git openjdk17-jdk --repository=http://dl-cdn.alpinelinux.org/alpine/edge/community - export TAG=$(git rev-parse --short HEAD) - cd projects/control-service/projects - ./gradlew -p ./model build publishToMavenLocal --info --stacktrace @@ -191,7 +191,7 @@ control_service_publish_image: DOCKER_TLS_CERTDIR: "" stage: publish_artifacts script: - - apk add --no-cache git openjdk11-jdk + - apk add --no-cache git openjdk17-jdk - export TAG=$(git rev-parse --short HEAD) - docker login -u $VDK_DOCKER_REGISTRY_USERNAME -p $VDK_DOCKER_REGISTRY_PASSWORD - cd projects/control-service/projects @@ -216,7 +216,7 @@ control_service_publish_api_client: image: docker:19.03.15 stage: publish_artifacts script: - - apk add --no-cache py-pip openjdk11-jdk git python + - apk add --no-cache py-pip openjdk17-jdk git python - pip install -U pip setuptools wheel twine - ./projects/control-service/projects/gradlew -p ./projects/control-service/projects/model buildPython - cd projects/control-service/projects/model/apidefs/datajob-api/build diff --git a/projects/control-service/projects/pipelines_control_service/Dockerfile b/projects/control-service/projects/pipelines_control_service/Dockerfile index 26a91d0126..308543aa96 100644 --- a/projects/control-service/projects/pipelines_control_service/Dockerfile +++ b/projects/control-service/projects/pipelines_control_service/Dockerfile @@ -12,7 +12,7 @@ RUN java -Djarmode=layertools -jar application.jar extract # Final stage -FROM adoptopenjdk:11-jre-hotspot +FROM adoptopenjdk:17-jre-hotspot LABEL maintainer="Project Versatile Data Kit " # install kerberos client so that we can use kadmin From 74c59e81d017a5aa42198e5f4d6058fbd1acb208 Mon Sep 17 00:00:00 2001 From: murphp15 Date: Wed, 14 Dec 2022 14:53:53 +0000 Subject: [PATCH 03/56] java 17 Signed-off-by: murphp15 --- projects/control-service/cicd/.gitlab-ci.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/projects/control-service/cicd/.gitlab-ci.yml b/projects/control-service/cicd/.gitlab-ci.yml index abd73cac49..163dbf8198 100644 --- a/projects/control-service/cicd/.gitlab-ci.yml +++ b/projects/control-service/cicd/.gitlab-ci.yml @@ -26,7 +26,7 @@ variables: _JAVA_OPTIONS: "-Xms2048m -Xmx4096m" before_script: - - apk --no-cache add git zip openjdk17-jdk curl zip python3 py3-pip --repository=http://dl-cdn.alpinelinux.org/alpine/edge/community + - apk --no-cache add git zip openjdk-17-jdk curl zip python3 py3-pip --repository=http://dl-cdn.alpinelinux.org/alpine/edge/community - pip3 install --upgrade pip && pip3 install awscli control_service_build_image: @@ -39,7 +39,7 @@ control_service_build_image: DOCKER_TLS_CERTDIR: "" stage: build script: - - apk --no-cache add git openjdk17-jdk --repository=http://dl-cdn.alpinelinux.org/alpine/edge/community + - apk --no-cache add git openjdk-17-jdk --repository=http://dl-cdn.alpinelinux.org/alpine/edge/community - export TAG=$(git rev-parse --short HEAD) - cd projects/control-service/projects - ./gradlew -p ./model build publishToMavenLocal --info --stacktrace @@ -191,7 +191,7 @@ control_service_publish_image: DOCKER_TLS_CERTDIR: "" stage: publish_artifacts script: - - apk add --no-cache git openjdk17-jdk + - apk add --no-cache git openjdk-17-jdk - export TAG=$(git rev-parse --short HEAD) - docker login -u $VDK_DOCKER_REGISTRY_USERNAME -p $VDK_DOCKER_REGISTRY_PASSWORD - cd projects/control-service/projects @@ -216,7 +216,7 @@ control_service_publish_api_client: image: docker:19.03.15 stage: publish_artifacts script: - - apk add --no-cache py-pip openjdk17-jdk git python + - apk add --no-cache py-pip openjdk-17-jdk git python - pip install -U pip setuptools wheel twine - ./projects/control-service/projects/gradlew -p ./projects/control-service/projects/model buildPython - cd projects/control-service/projects/model/apidefs/datajob-api/build From ce485b0394f011da6e6cdc796dd246d62dcaf335 Mon Sep 17 00:00:00 2001 From: murphp15 Date: Wed, 14 Dec 2022 15:05:41 +0000 Subject: [PATCH 04/56] java 17 Signed-off-by: murphp15 --- projects/control-service/cicd/.gitlab-ci.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/projects/control-service/cicd/.gitlab-ci.yml b/projects/control-service/cicd/.gitlab-ci.yml index 163dbf8198..8db2b940c8 100644 --- a/projects/control-service/cicd/.gitlab-ci.yml +++ b/projects/control-service/cicd/.gitlab-ci.yml @@ -26,7 +26,8 @@ variables: _JAVA_OPTIONS: "-Xms2048m -Xmx4096m" before_script: - - apk --no-cache add git zip openjdk-17-jdk curl zip python3 py3-pip --repository=http://dl-cdn.alpinelinux.org/alpine/edge/community + - apk --no-cache add openjdk17-jdk + - apk --no-cache add git zip curl zip python3 py3-pip --repository=http://dl-cdn.alpinelinux.org/alpine/edge/community - pip3 install --upgrade pip && pip3 install awscli control_service_build_image: @@ -39,7 +40,7 @@ control_service_build_image: DOCKER_TLS_CERTDIR: "" stage: build script: - - apk --no-cache add git openjdk-17-jdk --repository=http://dl-cdn.alpinelinux.org/alpine/edge/community + - apk --no-cache add git openjdk17-jdk --repository=http://dl-cdn.alpinelinux.org/alpine/edge/community - export TAG=$(git rev-parse --short HEAD) - cd projects/control-service/projects - ./gradlew -p ./model build publishToMavenLocal --info --stacktrace @@ -191,7 +192,7 @@ control_service_publish_image: DOCKER_TLS_CERTDIR: "" stage: publish_artifacts script: - - apk add --no-cache git openjdk-17-jdk + - apk add --no-cache git openjdk17-jdk - export TAG=$(git rev-parse --short HEAD) - docker login -u $VDK_DOCKER_REGISTRY_USERNAME -p $VDK_DOCKER_REGISTRY_PASSWORD - cd projects/control-service/projects @@ -216,7 +217,7 @@ control_service_publish_api_client: image: docker:19.03.15 stage: publish_artifacts script: - - apk add --no-cache py-pip openjdk-17-jdk git python + - apk add --no-cache py-pip openjdk17-jdk git python - pip install -U pip setuptools wheel twine - ./projects/control-service/projects/gradlew -p ./projects/control-service/projects/model buildPython - cd projects/control-service/projects/model/apidefs/datajob-api/build From 366ef7ab9ac08db116c74005f29130cd09903665 Mon Sep 17 00:00:00 2001 From: murphp15 Date: Wed, 14 Dec 2022 15:10:04 +0000 Subject: [PATCH 05/56] java 17 Signed-off-by: murphp15 --- projects/control-service/cicd/.gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/projects/control-service/cicd/.gitlab-ci.yml b/projects/control-service/cicd/.gitlab-ci.yml index 8db2b940c8..8bdf8f4362 100644 --- a/projects/control-service/cicd/.gitlab-ci.yml +++ b/projects/control-service/cicd/.gitlab-ci.yml @@ -26,7 +26,7 @@ variables: _JAVA_OPTIONS: "-Xms2048m -Xmx4096m" before_script: - - apk --no-cache add openjdk17-jdk + - apk --no-cache add openjdk17-jdk --repository=http://dl-cdn.alpinelinux.org/alpine/edge/community - apk --no-cache add git zip curl zip python3 py3-pip --repository=http://dl-cdn.alpinelinux.org/alpine/edge/community - pip3 install --upgrade pip && pip3 install awscli From 4a67d539a4622be98809cf3d035e9c0c204847a3 Mon Sep 17 00:00:00 2001 From: murphp15 Date: Mon, 19 Dec 2022 14:36:23 +0000 Subject: [PATCH 06/56] java 17 Signed-off-by: murphp15 --- projects/control-service/cicd/.gitlab-ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/projects/control-service/cicd/.gitlab-ci.yml b/projects/control-service/cicd/.gitlab-ci.yml index 8bdf8f4362..242e76f68e 100644 --- a/projects/control-service/cicd/.gitlab-ci.yml +++ b/projects/control-service/cicd/.gitlab-ci.yml @@ -22,7 +22,7 @@ - projects/control-service/projects/helm_charts/pipelines-control-service/**/* .control_service_base_build: - image: docker:19.03.15 + image: docker:20.10.21 variables: _JAVA_OPTIONS: "-Xms2048m -Xmx4096m" before_script: @@ -33,7 +33,7 @@ control_service_build_image: extends: .control_service_base_build services: - - docker:19.03.15-dind + - docker:20.10.21-dind variables: DOCKER_HOST: tcp://localhost:2375 DOCKER_DRIVER: overlay2 From 0559a33fc6d9877f530f5d072b2da4e169efd56c Mon Sep 17 00:00:00 2001 From: murphp15 Date: Wed, 18 Jan 2023 16:19:56 +0000 Subject: [PATCH 07/56] Merge branch 'main' into person/murphp15/java_17 --- .../src/test/java/com/vmware/taurus/RepositoryUtil.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/projects/control-service/projects/pipelines_control_service/src/test/java/com/vmware/taurus/RepositoryUtil.java b/projects/control-service/projects/pipelines_control_service/src/test/java/com/vmware/taurus/RepositoryUtil.java index 43fe2f96d1..6ecc648317 100644 --- a/projects/control-service/projects/pipelines_control_service/src/test/java/com/vmware/taurus/RepositoryUtil.java +++ b/projects/control-service/projects/pipelines_control_service/src/test/java/com/vmware/taurus/RepositoryUtil.java @@ -16,6 +16,7 @@ import org.junit.jupiter.api.Assertions; import java.time.OffsetDateTime; +import java.time.temporal.ChronoUnit; public final class RepositoryUtil { @@ -115,8 +116,8 @@ public static DataJobExecution createDataJobExecution( dataJob, executionStatus, message, - OffsetDateTime.now(), - OffsetDateTime.now()); + OffsetDateTime.now().truncatedTo(ChronoUnit.MICROS), + OffsetDateTime.now().truncatedTo(ChronoUnit.MICROS)); } public static DataJobExecution createDataJobExecution( From 61f11d094fe483ee02d7834a23a765bf933cabdc Mon Sep 17 00:00:00 2001 From: murphp15 Date: Wed, 18 Jan 2023 16:32:00 +0000 Subject: [PATCH 08/56] Merge branch 'main' into person/murphp15/java_17 --- .../src/test/java/com/vmware/taurus/RepositoryUtil.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/projects/control-service/projects/pipelines_control_service/src/test/java/com/vmware/taurus/RepositoryUtil.java b/projects/control-service/projects/pipelines_control_service/src/test/java/com/vmware/taurus/RepositoryUtil.java index 6ecc648317..2170bc9dff 100644 --- a/projects/control-service/projects/pipelines_control_service/src/test/java/com/vmware/taurus/RepositoryUtil.java +++ b/projects/control-service/projects/pipelines_control_service/src/test/java/com/vmware/taurus/RepositoryUtil.java @@ -143,7 +143,7 @@ public static DataJobExecution createDataJobExecution( .resourcesMemoryLimit(1000) .message(message) .lastDeployedBy("test_user") - .lastDeployedDate(OffsetDateTime.now()) + .lastDeployedDate(OffsetDateTime.now().truncatedTo(ChronoUnit.MICROS)) .jobVersion("test_version") .jobSchedule("*/5 * * * *") .opId("test_op_id") From 5d4d663b3982ad6c1910431e152bc69be0d3e16b Mon Sep 17 00:00:00 2001 From: murphp15 Date: Wed, 18 Jan 2023 16:43:48 +0000 Subject: [PATCH 09/56] Merge branch 'main' into person/murphp15/java_17 --- .../vmware/taurus/service/JobExecutionFilterSpecIT.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/projects/control-service/projects/pipelines_control_service/src/test/java/com/vmware/taurus/service/JobExecutionFilterSpecIT.java b/projects/control-service/projects/pipelines_control_service/src/test/java/com/vmware/taurus/service/JobExecutionFilterSpecIT.java index 6ec1c045c3..3060dc2125 100644 --- a/projects/control-service/projects/pipelines_control_service/src/test/java/com/vmware/taurus/service/JobExecutionFilterSpecIT.java +++ b/projects/control-service/projects/pipelines_control_service/src/test/java/com/vmware/taurus/service/JobExecutionFilterSpecIT.java @@ -18,6 +18,7 @@ import org.springframework.boot.test.context.SpringBootTest; import java.time.OffsetDateTime; +import java.time.temporal.ChronoUnit; import java.util.List; @SpringBootTest(classes = ControlplaneApplication.class) @@ -69,7 +70,7 @@ public void testJobExecutionFilterSpec_filerByStatusIn_shouldReturnResult() { @Test public void testJobExecutionFilterSpec_filerByStartTimeGte_shouldReturnResult() { DataJob actualDataJob = RepositoryUtil.createDataJob(jobsRepository); - OffsetDateTime now = OffsetDateTime.now(); + OffsetDateTime now = OffsetDateTime.now().truncatedTo(ChronoUnit.MICROS); RepositoryUtil.createDataJobExecution( jobExecutionRepository, @@ -112,7 +113,7 @@ public void testJobExecutionFilterSpec_filerByStartTimeGte_shouldReturnResult() @Test public void testJobExecutionFilterSpec_filerByEndTimeGte_shouldReturnResult() { DataJob actualDataJob = RepositoryUtil.createDataJob(jobsRepository); - OffsetDateTime now = OffsetDateTime.now(); + OffsetDateTime now = OffsetDateTime.now().truncatedTo(ChronoUnit.MICROS); RepositoryUtil.createDataJobExecution( jobExecutionRepository, @@ -159,7 +160,7 @@ public void testJobExecutionFilterSpec_filerByEndTimeGte_shouldReturnResult() { @Test public void testJobExecutionFilterSpec_filerByAllFields_shouldReturnResult() { DataJob actualDataJob = RepositoryUtil.createDataJob(jobsRepository); - OffsetDateTime now = OffsetDateTime.now(); + OffsetDateTime now = OffsetDateTime.now().truncatedTo(ChronoUnit.MICROS); RepositoryUtil.createDataJobExecution( jobExecutionRepository, From b059ae9d9fbea356556518ff7b4633a56c46c2f2 Mon Sep 17 00:00:00 2001 From: murphp15 Date: Wed, 18 Jan 2023 16:46:48 +0000 Subject: [PATCH 10/56] Merge branch 'main' into person/murphp15/java_17 --- .../taurus/service/monitoring/DataJobMonitorTest.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/projects/control-service/projects/pipelines_control_service/src/test/java/com/vmware/taurus/service/monitoring/DataJobMonitorTest.java b/projects/control-service/projects/pipelines_control_service/src/test/java/com/vmware/taurus/service/monitoring/DataJobMonitorTest.java index b12409d412..abcc086dac 100644 --- a/projects/control-service/projects/pipelines_control_service/src/test/java/com/vmware/taurus/service/monitoring/DataJobMonitorTest.java +++ b/projects/control-service/projects/pipelines_control_service/src/test/java/com/vmware/taurus/service/monitoring/DataJobMonitorTest.java @@ -27,6 +27,7 @@ import java.time.Duration; import java.time.OffsetDateTime; import java.time.ZoneOffset; +import java.time.temporal.ChronoUnit; import java.util.Arrays; import java.util.Collections; import java.util.List; @@ -843,8 +844,8 @@ private static JobExecution buildJobExecutionStatus( executionId, terminationMessage, executionSucceeded, - OffsetDateTime.now(), - OffsetDateTime.now()); + OffsetDateTime.now().truncatedTo(ChronoUnit.MICROS), + OffsetDateTime.now().truncatedTo(ChronoUnit.MICROS)); } private static JobExecution buildJobExecutionStatus( @@ -868,7 +869,7 @@ private static JobExecution buildJobExecutionStatus( .resourcesCpuLimit(2F) .resourcesMemoryRequest(500) .resourcesMemoryLimit(1000) - .deployedDate(OffsetDateTime.now()) + .deployedDate(OffsetDateTime.now().truncatedTo(ChronoUnit.MICROS)) .deployedBy("lastDeployedBy") .succeeded(executionSucceeded) .build(); From 3aea47ba33955b4f8bccf423a580fd5a9b5728d2 Mon Sep 17 00:00:00 2001 From: murphp15 Date: Wed, 18 Jan 2023 17:19:11 +0000 Subject: [PATCH 11/56] Merge branch 'main' into person/murphp15/java_17 --- ...nDataFetcherFindAllAndBuildResponseIT.java | 25 ++++++++++--------- 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/projects/control-service/projects/pipelines_control_service/src/test/java/com/vmware/taurus/service/graphql/ExecutionDataFetcherFindAllAndBuildResponseIT.java b/projects/control-service/projects/pipelines_control_service/src/test/java/com/vmware/taurus/service/graphql/ExecutionDataFetcherFindAllAndBuildResponseIT.java index 6591f93fb2..9db08d465e 100644 --- a/projects/control-service/projects/pipelines_control_service/src/test/java/com/vmware/taurus/service/graphql/ExecutionDataFetcherFindAllAndBuildResponseIT.java +++ b/projects/control-service/projects/pipelines_control_service/src/test/java/com/vmware/taurus/service/graphql/ExecutionDataFetcherFindAllAndBuildResponseIT.java @@ -26,6 +26,7 @@ import org.springframework.boot.test.context.SpringBootTest; import java.time.OffsetDateTime; +import java.time.temporal.ChronoUnit; import java.util.Collections; import java.util.List; import java.util.Map; @@ -127,7 +128,7 @@ public void testFindAllAndBuildResponse_filerByStatusIn_shouldReturnResult() thr public void testFindAllAndBuildResponse_filerByStartTimeGte_shouldReturnResult() throws Exception { DataJob actualDataJob = RepositoryUtil.createDataJob(jobsRepository); - OffsetDateTime now = OffsetDateTime.now(); + OffsetDateTime now = OffsetDateTime.now().truncatedTo(ChronoUnit.MICROS); RepositoryUtil.createDataJobExecution( jobExecutionRepository, @@ -174,7 +175,7 @@ public void testFindAllAndBuildResponse_filerByStartTimeGte_shouldReturnResult() @Test public void testFindAllAndBuildResponse_filerByEndTimeGte_shouldReturnResult() throws Exception { DataJob actualDataJob = RepositoryUtil.createDataJob(jobsRepository); - OffsetDateTime now = OffsetDateTime.now(); + OffsetDateTime now = OffsetDateTime.now().truncatedTo(ChronoUnit.MICROS); RepositoryUtil.createDataJobExecution( jobExecutionRepository, @@ -224,7 +225,7 @@ public void testFindAllAndBuildResponse_filerByEndTimeGte_shouldReturnResult() t @Test public void testFindAllAndBuildResponse_filerByAllFields_shouldReturnResult() throws Exception { DataJob actualDataJob = RepositoryUtil.createDataJob(jobsRepository); - OffsetDateTime now = OffsetDateTime.now(); + OffsetDateTime now = OffsetDateTime.now().truncatedTo(ChronoUnit.MICROS); RepositoryUtil.createDataJobExecution( jobExecutionRepository, @@ -470,7 +471,7 @@ public void testFindAllAndBuildResponse_filterByJobName_shouldReturnResult() thr DataJob actualDataJob = RepositoryUtil.createDataJob(jobsRepository, "job-one"); DataJob actualDataJob2 = RepositoryUtil.createDataJob(jobsRepository, "job-two"); - OffsetDateTime now = OffsetDateTime.now(); + OffsetDateTime now = OffsetDateTime.now().truncatedTo(ChronoUnit.MICROS); var expectedExecution = RepositoryUtil.createDataJobExecution( @@ -505,7 +506,7 @@ public void testFindAllAndBuildResponse_filterByEndTimeLte_shouldNotReturnResult throws Exception { DataJob actualDataJob = RepositoryUtil.createDataJob(jobsRepository); - OffsetDateTime now = OffsetDateTime.now(); + OffsetDateTime now = OffsetDateTime.now().truncatedTo(ChronoUnit.MICROS); RepositoryUtil.createDataJobExecution( jobExecutionRepository, @@ -524,7 +525,7 @@ public void testFindAllAndBuildResponse_filterByEndTimeLte_shouldNotReturnResult when(dataFetchingEnvironment.getArguments()).thenReturn(Map.of(FILTER_FIELD, filterRaw)); when(filterRaw.get(DataJobExecutionFilter.END_TIME_LTE_FIELD)) - .thenReturn(OffsetDateTime.now().minusDays(2)); + .thenReturn(OffsetDateTime.now().truncatedTo(ChronoUnit.MICROS).minusDays(2)); DataFetcher allAndBuildResponse = executionDataFetcher.findAllAndBuildResponse(); DataJobPage response = (DataJobPage) allAndBuildResponse.get(dataFetchingEnvironment); @@ -537,7 +538,7 @@ public void testFindAllAndBuildResponse_filterByEndTimeLte_shouldNotReturnResult public void testFindAllAndBuildResponse_filterByEndTimeLte_shouldReturnResult() throws Exception { DataJob actualDataJob = RepositoryUtil.createDataJob(jobsRepository); - OffsetDateTime now = OffsetDateTime.now(); + OffsetDateTime now = OffsetDateTime.now().truncatedTo(ChronoUnit.MICROS); RepositoryUtil.createDataJobExecution( jobExecutionRepository, @@ -557,7 +558,7 @@ public void testFindAllAndBuildResponse_filterByEndTimeLte_shouldReturnResult() when(dataFetchingEnvironment.getArguments()).thenReturn(Map.of(FILTER_FIELD, filterRaw)); when(filterRaw.get(DataJobExecutionFilter.END_TIME_LTE_FIELD)) - .thenReturn(OffsetDateTime.now().minusDays(2)); + .thenReturn(OffsetDateTime.now().truncatedTo(ChronoUnit.MICROS).minusDays(2)); DataFetcher allAndBuildResponse = executionDataFetcher.findAllAndBuildResponse(); DataJobPage response = (DataJobPage) allAndBuildResponse.get(dataFetchingEnvironment); @@ -572,7 +573,7 @@ public void testFindAllAndBuildResponse_filterByStartTimeLte_shouldNotReturnResu throws Exception { DataJob actualDataJob = RepositoryUtil.createDataJob(jobsRepository); - OffsetDateTime now = OffsetDateTime.now(); + OffsetDateTime now = OffsetDateTime.now().truncatedTo(ChronoUnit.MICROS); RepositoryUtil.createDataJobExecution( jobExecutionRepository, @@ -591,7 +592,7 @@ public void testFindAllAndBuildResponse_filterByStartTimeLte_shouldNotReturnResu when(dataFetchingEnvironment.getArguments()).thenReturn(Map.of(FILTER_FIELD, filterRaw)); when(filterRaw.get(DataJobExecutionFilter.START_TIME_LTE_FIELD)) - .thenReturn(OffsetDateTime.now().minusDays(4)); + .thenReturn(OffsetDateTime.now().truncatedTo(ChronoUnit.MICROS).minusDays(4)); DataFetcher allAndBuildResponse = executionDataFetcher.findAllAndBuildResponse(); DataJobPage response = (DataJobPage) allAndBuildResponse.get(dataFetchingEnvironment); @@ -605,7 +606,7 @@ public void testFindAllAndBuildResponse_filterByStartTimeLte_shouldReturnResult( throws Exception { DataJob actualDataJob = RepositoryUtil.createDataJob(jobsRepository); - OffsetDateTime now = OffsetDateTime.now(); + OffsetDateTime now = OffsetDateTime.now().truncatedTo(ChronoUnit.MICROS); RepositoryUtil.createDataJobExecution( jobExecutionRepository, @@ -625,7 +626,7 @@ public void testFindAllAndBuildResponse_filterByStartTimeLte_shouldReturnResult( when(dataFetchingEnvironment.getArguments()).thenReturn(Map.of(FILTER_FIELD, filterRaw)); when(filterRaw.get(DataJobExecutionFilter.START_TIME_LTE_FIELD)) - .thenReturn(OffsetDateTime.now().minusDays(2)); + .thenReturn(OffsetDateTime.now().truncatedTo(ChronoUnit.MICROS).minusDays(2)); DataFetcher allAndBuildResponse = executionDataFetcher.findAllAndBuildResponse(); DataJobPage response = (DataJobPage) allAndBuildResponse.get(dataFetchingEnvironment); From 41630506b03213d63bea8bb06eea380bacda958d Mon Sep 17 00:00:00 2001 From: murphp15 Date: Wed, 18 Jan 2023 17:26:02 +0000 Subject: [PATCH 12/56] Merge branch 'main' into person/murphp15/java_17 --- .../execution/JobExecutionServiceUpdateExecutionIT.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/projects/control-service/projects/pipelines_control_service/src/test/java/com/vmware/taurus/service/execution/JobExecutionServiceUpdateExecutionIT.java b/projects/control-service/projects/pipelines_control_service/src/test/java/com/vmware/taurus/service/execution/JobExecutionServiceUpdateExecutionIT.java index 603c37cfde..fcb9f20e14 100644 --- a/projects/control-service/projects/pipelines_control_service/src/test/java/com/vmware/taurus/service/execution/JobExecutionServiceUpdateExecutionIT.java +++ b/projects/control-service/projects/pipelines_control_service/src/test/java/com/vmware/taurus/service/execution/JobExecutionServiceUpdateExecutionIT.java @@ -7,6 +7,7 @@ import java.time.Duration; import java.time.OffsetDateTime; +import java.time.temporal.ChronoUnit; import java.util.Random; import com.google.gson.JsonObject; @@ -233,7 +234,7 @@ private KubernetesService.JobExecution createJobExecution( .resourcesMemoryLimit(1) .resourcesMemoryRequest(1) .deployedBy("test_deployed_by") - .deployedDate(OffsetDateTime.now()) + .deployedDate(OffsetDateTime.now().truncatedTo(ChronoUnit.MICROS)) .podTerminationMessage(terminationMessage) .containerTerminationReason(containerTerminationMessage) .build(); @@ -256,8 +257,8 @@ private void testUpdateJobExecution( actualDataJob, actualExecutionSucceeded, actualTerminationMessage, - OffsetDateTime.now(), - OffsetDateTime.now(), + OffsetDateTime.now().truncatedTo(ChronoUnit.MICROS), + OffsetDateTime.now().truncatedTo(ChronoUnit.MICROS), ""); DataJobExecution actualJobExecution = jobExecutionService.readJobExecution( From 3f2090569c4ac137920f45dc717812e94733379f Mon Sep 17 00:00:00 2001 From: murphp15 Date: Wed, 18 Jan 2023 17:29:25 +0000 Subject: [PATCH 13/56] Merge branch 'main' into person/murphp15/java_17 --- .../com/vmware/taurus/service/JobExecutionRepositoryIT.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/projects/control-service/projects/pipelines_control_service/src/test/java/com/vmware/taurus/service/JobExecutionRepositoryIT.java b/projects/control-service/projects/pipelines_control_service/src/test/java/com/vmware/taurus/service/JobExecutionRepositoryIT.java index 6347c0813e..e95873137a 100644 --- a/projects/control-service/projects/pipelines_control_service/src/test/java/com/vmware/taurus/service/JobExecutionRepositoryIT.java +++ b/projects/control-service/projects/pipelines_control_service/src/test/java/com/vmware/taurus/service/JobExecutionRepositoryIT.java @@ -21,6 +21,7 @@ import java.time.OffsetDateTime; import java.time.ZoneOffset; +import java.time.temporal.ChronoUnit; import java.util.List; /** Integration tests of the setup of Spring Data repository for data job executions */ @@ -293,7 +294,7 @@ void testUpdateExecutionStatusWhereOldStatusInAndExecutionIdIn_withExecutions_sh jobExecutionRepository.save(execution1); jobExecutionRepository.save(execution2); - var executionEndTime = OffsetDateTime.now(); + var executionEndTime = OffsetDateTime.now().truncatedTo(ChronoUnit.MICROS); var message = "Changed by test"; jobExecutionRepository.updateExecutionStatusWhereOldStatusInAndExecutionIdIn( ExecutionStatus.CANCELLED, From d39a0e1831dc8c45d41b2ddb8bd5acce3140d14e Mon Sep 17 00:00:00 2001 From: murphp15 Date: Wed, 18 Jan 2023 17:30:01 +0000 Subject: [PATCH 14/56] Merge branch 'main' into person/murphp15/java_17 --- .../com/vmware/taurus/service/JobExecutionRepositoryIT.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/projects/control-service/projects/pipelines_control_service/src/test/java/com/vmware/taurus/service/JobExecutionRepositoryIT.java b/projects/control-service/projects/pipelines_control_service/src/test/java/com/vmware/taurus/service/JobExecutionRepositoryIT.java index e95873137a..6134028c02 100644 --- a/projects/control-service/projects/pipelines_control_service/src/test/java/com/vmware/taurus/service/JobExecutionRepositoryIT.java +++ b/projects/control-service/projects/pipelines_control_service/src/test/java/com/vmware/taurus/service/JobExecutionRepositoryIT.java @@ -247,7 +247,7 @@ void testUpdateExecutionStatusWhereOldStatusInAndExecutionIdIn_withExecutions_sh jobExecutionRepository.save(execution1); jobExecutionRepository.save(execution2); - var executionEndTime = OffsetDateTime.now(); + var executionEndTime = OffsetDateTime.now().truncatedTo(ChronoUnit.MICROS); var message = "Changed by test"; jobExecutionRepository.updateExecutionStatusWhereOldStatusInAndExecutionIdIn( ExecutionStatus.CANCELLED, From 5015821bd633ea9d409a919fbbd618dc3dab24db Mon Sep 17 00:00:00 2001 From: murphp15 Date: Thu, 19 Jan 2023 15:55:03 +0000 Subject: [PATCH 15/56] Merge branch 'main' into person/murphp15/java_17 --- .../src/test/java/com/vmware/taurus/RepositoryUtil.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/projects/control-service/projects/pipelines_control_service/src/test/java/com/vmware/taurus/RepositoryUtil.java b/projects/control-service/projects/pipelines_control_service/src/test/java/com/vmware/taurus/RepositoryUtil.java index 2170bc9dff..89329df91f 100644 --- a/projects/control-service/projects/pipelines_control_service/src/test/java/com/vmware/taurus/RepositoryUtil.java +++ b/projects/control-service/projects/pipelines_control_service/src/test/java/com/vmware/taurus/RepositoryUtil.java @@ -83,7 +83,7 @@ public static DataJobExecution createDataJobExecution( executionStatus, message, startTime, - OffsetDateTime.now()); + OffsetDateTime.now().truncatedTo(ChronoUnit.MICROS)); } public static DataJobExecution createDataJobExecution( From b88f26f308cfccdd83aa656cbd4a3c2f1056c93f Mon Sep 17 00:00:00 2001 From: murphp15 Date: Thu, 19 Jan 2023 16:00:40 +0000 Subject: [PATCH 16/56] Merge branch 'main' into person/murphp15/java_17 --- .../src/test/java/com/vmware/taurus/RepositoryUtil.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/projects/control-service/projects/pipelines_control_service/src/test/java/com/vmware/taurus/RepositoryUtil.java b/projects/control-service/projects/pipelines_control_service/src/test/java/com/vmware/taurus/RepositoryUtil.java index 89329df91f..84def5001c 100644 --- a/projects/control-service/projects/pipelines_control_service/src/test/java/com/vmware/taurus/RepositoryUtil.java +++ b/projects/control-service/projects/pipelines_control_service/src/test/java/com/vmware/taurus/RepositoryUtil.java @@ -100,7 +100,7 @@ public static DataJobExecution createDataJobExecution( executionStatus, "test_message", startTime, - OffsetDateTime.now()); + OffsetDateTime.now().truncatedTo(ChronoUnit.MICROS)); } public static DataJobExecution createDataJobExecution( From d8d037fd068623f29c96a412765cdfee4eda970f Mon Sep 17 00:00:00 2001 From: murphp15 Date: Sat, 21 Jan 2023 20:28:44 +0000 Subject: [PATCH 17/56] Merge branch 'main' into person/murphp15/java_17 --- .../vmware/taurus/security/SecurityConfiguration.java | 2 ++ .../projects/pipelines_control_service/build.gradle | 1 - .../datajobs/it/common/MiniKdcCredentialsRepository.java | 9 ++++----- .../service/credentials/JobCredentialsService.java | 2 +- .../projects/versions-of-external-dependencies.gradle | 1 - 5 files changed, 7 insertions(+), 8 deletions(-) diff --git a/projects/control-service/projects/base/src/main/java/com/vmware/taurus/security/SecurityConfiguration.java b/projects/control-service/projects/base/src/main/java/com/vmware/taurus/security/SecurityConfiguration.java index 54e966ac57..9bf0124e32 100644 --- a/projects/control-service/projects/base/src/main/java/com/vmware/taurus/security/SecurityConfiguration.java +++ b/projects/control-service/projects/base/src/main/java/com/vmware/taurus/security/SecurityConfiguration.java @@ -252,6 +252,8 @@ public SunJaasKerberosTicketValidator sunJaasKerberosTicketValidator() { return ticketValidator; } + + @Bean @ConditionalOnProperty(value = KERBEROS_AUTH_ENABLED_PROPERTY) public SecurityConfiguration.DataJobsUserDetailsService dataJobsUserDetailsService() { diff --git a/projects/control-service/projects/pipelines_control_service/build.gradle b/projects/control-service/projects/pipelines_control_service/build.gradle index 813bd0c69c..5383d256b0 100644 --- a/projects/control-service/projects/pipelines_control_service/build.gradle +++ b/projects/control-service/projects/pipelines_control_service/build.gradle @@ -84,7 +84,6 @@ dependencies { // Implementation dependencies are found on compile classpath of testImplementation versions.'org.mockito:mockito-core' testImplementation versions.'net.bytebuddy:byte-buddy' testImplementation versions.'org.testcontainers:testcontainers' - testImplementation versions.'org.springframework.security.kerberos:spring-security-kerberos-test' testImplementation versions.'org.awaitility:awaitility' testImplementation 'com.github.kirviq:dumbster:1.7.1' testImplementation versions.'org.junit.jupiter:junit-jupiter-api' diff --git a/projects/control-service/projects/pipelines_control_service/src/integration-test/java/com/vmware/taurus/datajobs/it/common/MiniKdcCredentialsRepository.java b/projects/control-service/projects/pipelines_control_service/src/integration-test/java/com/vmware/taurus/datajobs/it/common/MiniKdcCredentialsRepository.java index 4850d95cea..102f183629 100644 --- a/projects/control-service/projects/pipelines_control_service/src/integration-test/java/com/vmware/taurus/datajobs/it/common/MiniKdcCredentialsRepository.java +++ b/projects/control-service/projects/pipelines_control_service/src/integration-test/java/com/vmware/taurus/datajobs/it/common/MiniKdcCredentialsRepository.java @@ -9,14 +9,13 @@ import lombok.Setter; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import org.springframework.security.kerberos.test.MiniKdc; - import java.io.File; import java.util.Optional; +import org.apache.kerby.kerberos.kerb.server.SimpleKdcServer; /** * This class can be used to replace {@link KerberosCredentialsRepository} for testing purposes. It - * uses {@link MiniKdc} as a kerberos server. + * uses {@link SimpleKdcServer} as a kerberos server. * *

TODO: Figure out how to connect to a testing KDC server via kadmin * For some reason I * (tsvetkovt@vmware.com) was not able to connect to MiniKdc or to a * dockerized KDC with kadmin. @@ -26,7 +25,7 @@ public class MiniKdcCredentialsRepository extends KerberosCredentialsRepository { private static final Logger log = LoggerFactory.getLogger(MiniKdcCredentialsRepository.class); - private MiniKdc miniKdc; + private SimpleKdcServer miniKdc; public MiniKdcCredentialsRepository() { super("test", "test"); @@ -35,7 +34,7 @@ public MiniKdcCredentialsRepository() { @Override public void createPrincipal(String principal, Optional keytabLocation) { try { - miniKdc.createPrincipal(keytabLocation.get(), principal); + miniKdc.createAndExportPrincipals(keytabLocation.get(), principal); } catch (Exception e) { log.error("Failed to create principal", e); } diff --git a/projects/control-service/projects/pipelines_control_service/src/main/java/com/vmware/taurus/service/credentials/JobCredentialsService.java b/projects/control-service/projects/pipelines_control_service/src/main/java/com/vmware/taurus/service/credentials/JobCredentialsService.java index 62b72e1da9..04cb064c06 100644 --- a/projects/control-service/projects/pipelines_control_service/src/main/java/com/vmware/taurus/service/credentials/JobCredentialsService.java +++ b/projects/control-service/projects/pipelines_control_service/src/main/java/com/vmware/taurus/service/credentials/JobCredentialsService.java @@ -58,7 +58,7 @@ public void createJobCredentials(String jobName) { } catch (IOException e) { throw new ExternalSystemError(MainExternalSystem.HOST_CONTAINER, e); } - try (Closeable ignored = () -> keytabFile.delete()) { + try (Closeable ignored = keytabFile::delete) { credentialsRepository.createPrincipal(principal, Optional.of(keytabFile)); String secretName = getJobKeytabKubernetesSecretName(jobName); diff --git a/projects/control-service/projects/versions-of-external-dependencies.gradle b/projects/control-service/projects/versions-of-external-dependencies.gradle index 14006d0e3b..9c7b99d319 100644 --- a/projects/control-service/projects/versions-of-external-dependencies.gradle +++ b/projects/control-service/projects/versions-of-external-dependencies.gradle @@ -34,7 +34,6 @@ project.ext { 'net.javacrumbs.shedlock:shedlock-spring' : 'net.javacrumbs.shedlock:shedlock-spring:4.43.0', 'net.javacrumbs.shedlock:shedlock-provider-jdbc-template' : 'net.javacrumbs.shedlock:shedlock-provider-jdbc-template:4.42.0', 'org.testcontainers:testcontainers' : 'org.testcontainers:testcontainers:1.17.6', - 'org.springframework.security.kerberos:spring-security-kerberos-test': 'org.springframework.security.kerberos:spring-security-kerberos-test:1.0.1.RELEASE', 'org.mock-server:mockserver-netty' : 'org.mock-server:mockserver-netty:5.15.0', //5.11.2 'org.awaitility:awaitility' : 'org.awaitility:awaitility:4.2.0', 'org.apache.commons:commons-lang3' : 'org.apache.commons:commons-lang3:3.12.0', From abf9eb879d5f397cfb5aeaf6dc74d5eb95bf2461 Mon Sep 17 00:00:00 2001 From: github-actions <> Date: Sat, 21 Jan 2023 20:29:10 +0000 Subject: [PATCH 18/56] Google Java Format --- .../java/com/vmware/taurus/security/SecurityConfiguration.java | 2 -- 1 file changed, 2 deletions(-) diff --git a/projects/control-service/projects/base/src/main/java/com/vmware/taurus/security/SecurityConfiguration.java b/projects/control-service/projects/base/src/main/java/com/vmware/taurus/security/SecurityConfiguration.java index 9bf0124e32..54e966ac57 100644 --- a/projects/control-service/projects/base/src/main/java/com/vmware/taurus/security/SecurityConfiguration.java +++ b/projects/control-service/projects/base/src/main/java/com/vmware/taurus/security/SecurityConfiguration.java @@ -252,8 +252,6 @@ public SunJaasKerberosTicketValidator sunJaasKerberosTicketValidator() { return ticketValidator; } - - @Bean @ConditionalOnProperty(value = KERBEROS_AUTH_ENABLED_PROPERTY) public SecurityConfiguration.DataJobsUserDetailsService dataJobsUserDetailsService() { From a434efd8c5935376979a467139613d05da070915 Mon Sep 17 00:00:00 2001 From: murphp15 Date: Sat, 21 Jan 2023 20:40:59 +0000 Subject: [PATCH 19/56] Merge branch 'main' into person/murphp15/java_17 --- .../vmware/taurus/datajobs/it/common/BaseIT.java | 2 +- .../it/common/KerberosSecurityTestcaseJunit5.java | 15 ++++++++------- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/projects/control-service/projects/pipelines_control_service/src/integration-test/java/com/vmware/taurus/datajobs/it/common/BaseIT.java b/projects/control-service/projects/pipelines_control_service/src/integration-test/java/com/vmware/taurus/datajobs/it/common/BaseIT.java index 9b821065a0..832d971979 100644 --- a/projects/control-service/projects/pipelines_control_service/src/integration-test/java/com/vmware/taurus/datajobs/it/common/BaseIT.java +++ b/projects/control-service/projects/pipelines_control_service/src/integration-test/java/com/vmware/taurus/datajobs/it/common/BaseIT.java @@ -94,7 +94,7 @@ public KerberosCredentialsRepository credentialsRepository() { public void before() { log.info("Running test with: {} bytes of memory.", Runtime.getRuntime().totalMemory()); mockMvc = MockMvcBuilders.webAppContextSetup(context).apply(springSecurity()).build(); - kerberosCredentialsRepository.setMiniKdc(getKdc()); + kerberosCredentialsRepository.setMiniKdc(simpleKdcServer); } @AfterEach diff --git a/projects/control-service/projects/pipelines_control_service/src/integration-test/java/com/vmware/taurus/datajobs/it/common/KerberosSecurityTestcaseJunit5.java b/projects/control-service/projects/pipelines_control_service/src/integration-test/java/com/vmware/taurus/datajobs/it/common/KerberosSecurityTestcaseJunit5.java index 1697921b1d..c1089a921c 100644 --- a/projects/control-service/projects/pipelines_control_service/src/integration-test/java/com/vmware/taurus/datajobs/it/common/KerberosSecurityTestcaseJunit5.java +++ b/projects/control-service/projects/pipelines_control_service/src/integration-test/java/com/vmware/taurus/datajobs/it/common/KerberosSecurityTestcaseJunit5.java @@ -5,21 +5,22 @@ package com.vmware.taurus.datajobs.it.common; +import org.apache.kerby.kerberos.kerb.KrbException; +import org.apache.kerby.kerberos.kerb.server.SimpleKdcServer; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; -import org.springframework.security.kerberos.test.KerberosSecurityTestcase; -public class KerberosSecurityTestcaseJunit5 extends KerberosSecurityTestcase { +public class KerberosSecurityTestcaseJunit5 { + SimpleKdcServer simpleKdcServer; // TODO we should think about moving away from MiniKDC as it's not maintained. @BeforeEach - @Override public void startMiniKdc() throws Exception { - super.startMiniKdc(); + simpleKdcServer = new SimpleKdcServer(); + simpleKdcServer.start(); } @AfterEach - @Override - public void stopMiniKdc() { - super.stopMiniKdc(); + public void stopMiniKdc() throws KrbException { + simpleKdcServer.stop(); } } From eed7b4911bc0f744940daa9120d5d74b35d9f328 Mon Sep 17 00:00:00 2001 From: murphp15 Date: Sat, 21 Jan 2023 20:52:47 +0000 Subject: [PATCH 20/56] Merge branch 'main' into person/murphp15/java_17 --- .../datajobs/it/common/KerberosSecurityTestcaseJunit5.java | 1 + 1 file changed, 1 insertion(+) diff --git a/projects/control-service/projects/pipelines_control_service/src/integration-test/java/com/vmware/taurus/datajobs/it/common/KerberosSecurityTestcaseJunit5.java b/projects/control-service/projects/pipelines_control_service/src/integration-test/java/com/vmware/taurus/datajobs/it/common/KerberosSecurityTestcaseJunit5.java index c1089a921c..52cbe51158 100644 --- a/projects/control-service/projects/pipelines_control_service/src/integration-test/java/com/vmware/taurus/datajobs/it/common/KerberosSecurityTestcaseJunit5.java +++ b/projects/control-service/projects/pipelines_control_service/src/integration-test/java/com/vmware/taurus/datajobs/it/common/KerberosSecurityTestcaseJunit5.java @@ -16,6 +16,7 @@ public class KerberosSecurityTestcaseJunit5 { @BeforeEach public void startMiniKdc() throws Exception { simpleKdcServer = new SimpleKdcServer(); + simpleKdcServer.init(); simpleKdcServer.start(); } From c776e3427a78bb41cd29a055ce1f29ebffef1b2c Mon Sep 17 00:00:00 2001 From: murphp15 Date: Sat, 21 Jan 2023 21:26:31 +0000 Subject: [PATCH 21/56] Merge branch 'main' into person/murphp15/java_17 --- projects/control-service/cicd/.gitlab-ci.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/projects/control-service/cicd/.gitlab-ci.yml b/projects/control-service/cicd/.gitlab-ci.yml index 242e76f68e..12eb6e64ae 100644 --- a/projects/control-service/cicd/.gitlab-ci.yml +++ b/projects/control-service/cicd/.gitlab-ci.yml @@ -27,8 +27,7 @@ _JAVA_OPTIONS: "-Xms2048m -Xmx4096m" before_script: - apk --no-cache add openjdk17-jdk --repository=http://dl-cdn.alpinelinux.org/alpine/edge/community - - apk --no-cache add git zip curl zip python3 py3-pip --repository=http://dl-cdn.alpinelinux.org/alpine/edge/community - - pip3 install --upgrade pip && pip3 install awscli + - apk --no-cache add git zip curl zip python3 py3-pip aws-cli --repository=http://dl-cdn.alpinelinux.org/alpine/edge/community control_service_build_image: extends: .control_service_base_build From fe1eec9bd5e2de52c94c7731e34c2b82c917bd33 Mon Sep 17 00:00:00 2001 From: murphp15 Date: Sat, 21 Jan 2023 21:29:13 +0000 Subject: [PATCH 22/56] Merge branch 'main' into person/murphp15/java_17 --- projects/control-service/cicd/.gitlab-ci.yml | 23 ++++++++++---------- 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/projects/control-service/cicd/.gitlab-ci.yml b/projects/control-service/cicd/.gitlab-ci.yml index 12eb6e64ae..a8310f728f 100644 --- a/projects/control-service/cicd/.gitlab-ci.yml +++ b/projects/control-service/cicd/.gitlab-ci.yml @@ -118,9 +118,9 @@ control_service_test_helm_chart: - projects/control-service/projects/helm_charts/pipelines-control-service/version.txt control_service_publish_job_base_image: - image: docker:19.03.15 + image: docker:20.10.21 services: - - docker:19.03.15-dind + - docker:20.10.21-dind variables: DOCKER_HOST: tcp://localhost:2375 DOCKER_DRIVER: overlay2 @@ -145,9 +145,9 @@ control_service_publish_job_base_image: control_service_publish_job_builder_image: - image: docker:19.03.15 + image: docker:20.10.21 services: - - docker:19.03.15-dind + - docker:20.10.21-dind variables: DOCKER_HOST: tcp://localhost:2375 DOCKER_DRIVER: overlay2 @@ -182,9 +182,9 @@ control_service_publish_job_builder_secure_image: control_service_publish_image: - image: docker:19.03.15 + image: docker:20.10.21 services: - - docker:19.03.15-dind + - docker:20.10.21-dind variables: DOCKER_HOST: tcp://localhost:2375 DOCKER_DRIVER: overlay2 @@ -213,7 +213,7 @@ control_service_publish_image: changes: *control_service_helm_change_locations control_service_publish_api_client: - image: docker:19.03.15 + image: docker:20.10.21 stage: publish_artifacts script: - apk add --no-cache py-pip openjdk17-jdk git python @@ -240,8 +240,7 @@ control_service_deploy_testing_data_pipelines: stage: pre_release image: proum/aws-iam-authenticator script: - - apk --no-cache add bash openssl curl git gettext zip python3 py3-pip - - pip3 install --upgrade pip && pip3 install awscli + - apk --no-cache add bash openssl curl git gettext zip python3 py3-pip aws-cli - export DESIRED_VERSION=v3.6.3 # helm version 3.6.3 - curl https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3 | bash - bash -ex ./projects/control-service/cicd/deploy-testing-pipelines-service.sh @@ -278,7 +277,7 @@ control_service_post_deployment_test: changes: *control_service_helm_change_locations control_service_release: - image: docker:19.03.15 + image: docker:20.10.21 stage: release script: - apk --no-cache add bash openssl curl git @@ -300,9 +299,9 @@ control_service_release: # TODO: automatically rebuild image on vdk-heartbeat change control_service_vdk_heartbeat_release: - image: docker:19.03.15 + image: docker:20.10.21 services: - - docker:19.03.15-dind + - docker:20.10.21-dind variables: DOCKER_HOST: tcp://localhost:2375 DOCKER_DRIVER: overlay2 From b1b4263994265fda32a570ba79fbeda958ee0f68 Mon Sep 17 00:00:00 2001 From: murphp15 Date: Sat, 21 Jan 2023 22:01:17 +0000 Subject: [PATCH 23/56] Merge branch 'main' into person/murphp15/java_17 --- projects/control-service/cicd/.gitlab-ci.yml | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/projects/control-service/cicd/.gitlab-ci.yml b/projects/control-service/cicd/.gitlab-ci.yml index a8310f728f..e14d22ce11 100644 --- a/projects/control-service/cicd/.gitlab-ci.yml +++ b/projects/control-service/cicd/.gitlab-ci.yml @@ -22,17 +22,18 @@ - projects/control-service/projects/helm_charts/pipelines-control-service/**/* .control_service_base_build: - image: docker:20.10.21 + image: docker:20.10.22 variables: _JAVA_OPTIONS: "-Xms2048m -Xmx4096m" before_script: - - apk --no-cache add openjdk17-jdk --repository=http://dl-cdn.alpinelinux.org/alpine/edge/community - - apk --no-cache add git zip curl zip python3 py3-pip aws-cli --repository=http://dl-cdn.alpinelinux.org/alpine/edge/community + - apk --no-cache add openjdk17-jdk + - apk --no-cache add git zip curl zip py-pip + - pip install --upgrade pip && pip install awscli control_service_build_image: extends: .control_service_base_build services: - - docker:20.10.21-dind + - docker:20.10.22-dind variables: DOCKER_HOST: tcp://localhost:2375 DOCKER_DRIVER: overlay2 @@ -118,9 +119,9 @@ control_service_test_helm_chart: - projects/control-service/projects/helm_charts/pipelines-control-service/version.txt control_service_publish_job_base_image: - image: docker:20.10.21 + image: docker:20.10.22 services: - - docker:20.10.21-dind + - docker:20.10.22-dind variables: DOCKER_HOST: tcp://localhost:2375 DOCKER_DRIVER: overlay2 @@ -145,9 +146,9 @@ control_service_publish_job_base_image: control_service_publish_job_builder_image: - image: docker:20.10.21 + image: docker:20.10.22 services: - - docker:20.10.21-dind + - docker:20.10.22-dind variables: DOCKER_HOST: tcp://localhost:2375 DOCKER_DRIVER: overlay2 @@ -240,7 +241,8 @@ control_service_deploy_testing_data_pipelines: stage: pre_release image: proum/aws-iam-authenticator script: - - apk --no-cache add bash openssl curl git gettext zip python3 py3-pip aws-cli + - apk --no-cache add bash openssl curl git gettext zip py-pip + - pip install --upgrade pip && pip install awscli - export DESIRED_VERSION=v3.6.3 # helm version 3.6.3 - curl https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3 | bash - bash -ex ./projects/control-service/cicd/deploy-testing-pipelines-service.sh From fd092c06c67fe7f29d850afa5ef8284f040b6995 Mon Sep 17 00:00:00 2001 From: murphp15 Date: Sat, 21 Jan 2023 22:13:02 +0000 Subject: [PATCH 24/56] Merge branch 'main' into person/murphp15/java_17 --- .github/workflows/format.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/format.yml b/.github/workflows/format.yml index eb8794aa25..377f5ddd06 100644 --- a/.github/workflows/format.yml +++ b/.github/workflows/format.yml @@ -9,7 +9,7 @@ jobs: formatting: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 # v2 minimum required + - uses: actions/checkout@v3 # v2 minimum required - uses: axel-op/googlejavaformat-action@v3 with: args: "--skip-sorting-imports --replace" From 7dfa7be575a92b5ef6a5774575b26590368ef150 Mon Sep 17 00:00:00 2001 From: murphp15 Date: Sat, 21 Jan 2023 22:13:35 +0000 Subject: [PATCH 25/56] Merge branch 'main' into person/murphp15/java_17 --- .github/workflows/format.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/format.yml b/.github/workflows/format.yml index 377f5ddd06..a63c8c7c2d 100644 --- a/.github/workflows/format.yml +++ b/.github/workflows/format.yml @@ -10,6 +10,6 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 # v2 minimum required - - uses: axel-op/googlejavaformat-action@v3 + - uses: axel-op/googlejavaformat-action@v3.6.0 with: args: "--skip-sorting-imports --replace" From f4b4eeca6f00b7d9bd00aa6b52b8712ce2cbb0d9 Mon Sep 17 00:00:00 2001 From: murphp15 Date: Sat, 21 Jan 2023 22:24:47 +0000 Subject: [PATCH 26/56] Merge branch 'main' into person/murphp15/java_17 --- .../projects/pipelines_control_service/Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/projects/control-service/projects/pipelines_control_service/Dockerfile b/projects/control-service/projects/pipelines_control_service/Dockerfile index 308543aa96..75f2d0f1a3 100644 --- a/projects/control-service/projects/pipelines_control_service/Dockerfile +++ b/projects/control-service/projects/pipelines_control_service/Dockerfile @@ -4,7 +4,7 @@ # Builder stage # This stage is implemented like in the guide, but it may be more efficient to # have it in the gradle build process outside docker. -FROM adoptopenjdk:17-jre-hotspot as builder +FROM eclipse-temurin:17 as builder ARG JAR_NAME WORKDIR application COPY ./${JAR_NAME} application.jar @@ -12,7 +12,7 @@ RUN java -Djarmode=layertools -jar application.jar extract # Final stage -FROM adoptopenjdk:17-jre-hotspot +FROM eclipse-temurin:17 LABEL maintainer="Project Versatile Data Kit " # install kerberos client so that we can use kadmin From ed0b09f2b480f936f9012a4a2d5189c9a706abf8 Mon Sep 17 00:00:00 2001 From: murphp15 Date: Sat, 21 Jan 2023 22:28:04 +0000 Subject: [PATCH 27/56] Merge branch 'main' into person/murphp15/java_17 --- .../it/GraphQLJobExecutionsSortByEndTimeIT.java | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/projects/control-service/projects/pipelines_control_service/src/integration-test/java/com/vmware/taurus/graphql/it/GraphQLJobExecutionsSortByEndTimeIT.java b/projects/control-service/projects/pipelines_control_service/src/integration-test/java/com/vmware/taurus/graphql/it/GraphQLJobExecutionsSortByEndTimeIT.java index 7f197bae63..0056fbe041 100644 --- a/projects/control-service/projects/pipelines_control_service/src/integration-test/java/com/vmware/taurus/graphql/it/GraphQLJobExecutionsSortByEndTimeIT.java +++ b/projects/control-service/projects/pipelines_control_service/src/integration-test/java/com/vmware/taurus/graphql/it/GraphQLJobExecutionsSortByEndTimeIT.java @@ -11,6 +11,7 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; import java.time.OffsetDateTime; +import java.time.temporal.ChronoUnit; import java.util.UUID; import org.junit.jupiter.api.BeforeEach; @@ -95,7 +96,7 @@ public void testCallWithSingleExecution(String jobName, String username) throws .andExpect(jsonPath("$.data.content[0].deployments[0].executions[0].id").value(expectedId)) .andExpect( jsonPath("$.data.content[0].deployments[0].executions[0].endTime") - .value(expectedEndTime.toString())); + .value(expectedEndTime.truncatedTo(ChronoUnit.MICROS).toString())); } @Test @@ -120,11 +121,11 @@ public void testCallTwoExecutionsSortAsc(String jobName, String username) throws .andExpect(jsonPath("$.data.content[0].deployments[0].executions[0].id").value(expectedId2)) .andExpect( jsonPath("$.data.content[0].deployments[0].executions[0].endTime") - .value(expectedEndTimeSmaller.toString())) + .value(expectedEndTimeSmaller.truncatedTo(ChronoUnit.MICROS).toString())) .andExpect(jsonPath("$.data.content[0].deployments[0].executions[1].id").value(expectedId1)) .andExpect( jsonPath("$.data.content[0].deployments[0].executions[1].endTime") - .value(expectedEndTimeLarger.toString())); + .value(expectedEndTimeLarger.truncatedTo(ChronoUnit.MICROS).toString())); } @Test @@ -149,11 +150,11 @@ public void testCallTwoExecutionsSortDesc(String jobName, String username) throw .andExpect(jsonPath("$.data.content[0].deployments[0].executions[0].id").value(expectedId1)) .andExpect( jsonPath("$.data.content[0].deployments[0].executions[0].endTime") - .value(expectedEndTimeLarger.toString())) + .value(expectedEndTimeLarger.truncatedTo(ChronoUnit.MICROS).toString())) .andExpect(jsonPath("$.data.content[0].deployments[0].executions[1].id").value(expectedId2)) .andExpect( jsonPath("$.data.content[0].deployments[0].executions[1].endTime") - .value(expectedEndTimeSmaller.toString())); + .value(expectedEndTimeSmaller.truncatedTo(ChronoUnit.MICROS).toString())); } @Test From 97dcd9012b35a2b72b75240d85549c0102d055ce Mon Sep 17 00:00:00 2001 From: murphp15 Date: Sat, 21 Jan 2023 22:54:42 +0000 Subject: [PATCH 28/56] Merge branch 'main' into person/murphp15/java_17 --- .../it/GraphQLJobExecutionsSortByEndTimeIT.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/projects/control-service/projects/pipelines_control_service/src/integration-test/java/com/vmware/taurus/graphql/it/GraphQLJobExecutionsSortByEndTimeIT.java b/projects/control-service/projects/pipelines_control_service/src/integration-test/java/com/vmware/taurus/graphql/it/GraphQLJobExecutionsSortByEndTimeIT.java index 0056fbe041..1c67e19fbf 100644 --- a/projects/control-service/projects/pipelines_control_service/src/integration-test/java/com/vmware/taurus/graphql/it/GraphQLJobExecutionsSortByEndTimeIT.java +++ b/projects/control-service/projects/pipelines_control_service/src/integration-test/java/com/vmware/taurus/graphql/it/GraphQLJobExecutionsSortByEndTimeIT.java @@ -96,7 +96,7 @@ public void testCallWithSingleExecution(String jobName, String username) throws .andExpect(jsonPath("$.data.content[0].deployments[0].executions[0].id").value(expectedId)) .andExpect( jsonPath("$.data.content[0].deployments[0].executions[0].endTime") - .value(expectedEndTime.truncatedTo(ChronoUnit.MICROS).toString())); + .value(expectedEndTime.plusNanos(500).truncatedTo(ChronoUnit.MICROS).toString())); } @Test @@ -121,11 +121,11 @@ public void testCallTwoExecutionsSortAsc(String jobName, String username) throws .andExpect(jsonPath("$.data.content[0].deployments[0].executions[0].id").value(expectedId2)) .andExpect( jsonPath("$.data.content[0].deployments[0].executions[0].endTime") - .value(expectedEndTimeSmaller.truncatedTo(ChronoUnit.MICROS).toString())) + .value(expectedEndTimeSmaller.plusNanos(500).truncatedTo(ChronoUnit.MICROS).toString())) .andExpect(jsonPath("$.data.content[0].deployments[0].executions[1].id").value(expectedId1)) .andExpect( jsonPath("$.data.content[0].deployments[0].executions[1].endTime") - .value(expectedEndTimeLarger.truncatedTo(ChronoUnit.MICROS).toString())); + .value(expectedEndTimeLarger.plusNanos(500).truncatedTo(ChronoUnit.MICROS).toString())); } @Test @@ -150,11 +150,11 @@ public void testCallTwoExecutionsSortDesc(String jobName, String username) throw .andExpect(jsonPath("$.data.content[0].deployments[0].executions[0].id").value(expectedId1)) .andExpect( jsonPath("$.data.content[0].deployments[0].executions[0].endTime") - .value(expectedEndTimeLarger.truncatedTo(ChronoUnit.MICROS).toString())) + .value(expectedEndTimeLarger.plusNanos(500).truncatedTo(ChronoUnit.MICROS).toString())) .andExpect(jsonPath("$.data.content[0].deployments[0].executions[1].id").value(expectedId2)) .andExpect( jsonPath("$.data.content[0].deployments[0].executions[1].endTime") - .value(expectedEndTimeSmaller.truncatedTo(ChronoUnit.MICROS).toString())); + .value(expectedEndTimeSmaller.plusNanos(500).truncatedTo(ChronoUnit.MICROS).toString())); } @Test From c10ead808a35201b42f071ddf3ac28ccfe112a4f Mon Sep 17 00:00:00 2001 From: github-actions <> Date: Sat, 21 Jan 2023 22:55:08 +0000 Subject: [PATCH 29/56] Google Java Format --- .../GraphQLJobExecutionsSortByEndTimeIT.java | 21 +++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/projects/control-service/projects/pipelines_control_service/src/integration-test/java/com/vmware/taurus/graphql/it/GraphQLJobExecutionsSortByEndTimeIT.java b/projects/control-service/projects/pipelines_control_service/src/integration-test/java/com/vmware/taurus/graphql/it/GraphQLJobExecutionsSortByEndTimeIT.java index 1c67e19fbf..810b003ce5 100644 --- a/projects/control-service/projects/pipelines_control_service/src/integration-test/java/com/vmware/taurus/graphql/it/GraphQLJobExecutionsSortByEndTimeIT.java +++ b/projects/control-service/projects/pipelines_control_service/src/integration-test/java/com/vmware/taurus/graphql/it/GraphQLJobExecutionsSortByEndTimeIT.java @@ -121,11 +121,19 @@ public void testCallTwoExecutionsSortAsc(String jobName, String username) throws .andExpect(jsonPath("$.data.content[0].deployments[0].executions[0].id").value(expectedId2)) .andExpect( jsonPath("$.data.content[0].deployments[0].executions[0].endTime") - .value(expectedEndTimeSmaller.plusNanos(500).truncatedTo(ChronoUnit.MICROS).toString())) + .value( + expectedEndTimeSmaller + .plusNanos(500) + .truncatedTo(ChronoUnit.MICROS) + .toString())) .andExpect(jsonPath("$.data.content[0].deployments[0].executions[1].id").value(expectedId1)) .andExpect( jsonPath("$.data.content[0].deployments[0].executions[1].endTime") - .value(expectedEndTimeLarger.plusNanos(500).truncatedTo(ChronoUnit.MICROS).toString())); + .value( + expectedEndTimeLarger + .plusNanos(500) + .truncatedTo(ChronoUnit.MICROS) + .toString())); } @Test @@ -150,11 +158,16 @@ public void testCallTwoExecutionsSortDesc(String jobName, String username) throw .andExpect(jsonPath("$.data.content[0].deployments[0].executions[0].id").value(expectedId1)) .andExpect( jsonPath("$.data.content[0].deployments[0].executions[0].endTime") - .value(expectedEndTimeLarger.plusNanos(500).truncatedTo(ChronoUnit.MICROS).toString())) + .value( + expectedEndTimeLarger.plusNanos(500).truncatedTo(ChronoUnit.MICROS).toString())) .andExpect(jsonPath("$.data.content[0].deployments[0].executions[1].id").value(expectedId2)) .andExpect( jsonPath("$.data.content[0].deployments[0].executions[1].endTime") - .value(expectedEndTimeSmaller.plusNanos(500).truncatedTo(ChronoUnit.MICROS).toString())); + .value( + expectedEndTimeSmaller + .plusNanos(500) + .truncatedTo(ChronoUnit.MICROS) + .toString())); } @Test From a9229841f054f8cca6db17b1c7bf1ff93197e507 Mon Sep 17 00:00:00 2001 From: murphp15 Date: Sun, 22 Jan 2023 17:46:13 +0000 Subject: [PATCH 30/56] Merge branch 'main' into person/murphp15/java_17 --- .../com/vmware/taurus/graphql/it/GraphQLExecutionsIT.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/projects/control-service/projects/pipelines_control_service/src/integration-test/java/com/vmware/taurus/graphql/it/GraphQLExecutionsIT.java b/projects/control-service/projects/pipelines_control_service/src/integration-test/java/com/vmware/taurus/graphql/it/GraphQLExecutionsIT.java index 1cde318a6c..9df7302fdc 100644 --- a/projects/control-service/projects/pipelines_control_service/src/integration-test/java/com/vmware/taurus/graphql/it/GraphQLExecutionsIT.java +++ b/projects/control-service/projects/pipelines_control_service/src/integration-test/java/com/vmware/taurus/graphql/it/GraphQLExecutionsIT.java @@ -22,6 +22,7 @@ import org.springframework.test.web.servlet.request.MockMvcRequestBuilders; import java.time.OffsetDateTime; +import java.time.temporal.ChronoUnit; import java.util.List; import static org.springframework.security.test.web.servlet.request.SecurityMockMvcRequestPostProcessors.user; @@ -67,7 +68,7 @@ public void setup() { this.dataJob2 = jobsRepository.save(new DataJob(TEST_JOB_NAME_2, config2)); this.dataJob3 = jobsRepository.save(new DataJob(TEST_JOB_NAME_3, config3)); - OffsetDateTime now = OffsetDateTime.now(); + OffsetDateTime now = OffsetDateTime.now().truncatedTo(ChronoUnit.MICROS); this.dataJobExecution1 = JobExecutionUtil.createDataJobExecution( jobExecutionRepository, "testId1", dataJob1, now, now, ExecutionStatus.SUCCEEDED); @@ -101,9 +102,8 @@ private static String getQuery() { } private void cleanup() { - jobsRepository - .findAllById(List.of(TEST_JOB_NAME_1, TEST_JOB_NAME_2, TEST_JOB_NAME_3)) - .forEach(dataJob -> jobsRepository.delete(dataJob)); + jobsRepository.deleteAll(jobsRepository + .findAllById(List.of(TEST_JOB_NAME_1, TEST_JOB_NAME_2, TEST_JOB_NAME_3))); } @Test From 9234ece1d11245bbd41ae903165fa5870d9f3fb6 Mon Sep 17 00:00:00 2001 From: github-actions <> Date: Sun, 22 Jan 2023 17:46:41 +0000 Subject: [PATCH 31/56] Google Java Format --- .../com/vmware/taurus/graphql/it/GraphQLExecutionsIT.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/projects/control-service/projects/pipelines_control_service/src/integration-test/java/com/vmware/taurus/graphql/it/GraphQLExecutionsIT.java b/projects/control-service/projects/pipelines_control_service/src/integration-test/java/com/vmware/taurus/graphql/it/GraphQLExecutionsIT.java index 9df7302fdc..6ecf94a3cb 100644 --- a/projects/control-service/projects/pipelines_control_service/src/integration-test/java/com/vmware/taurus/graphql/it/GraphQLExecutionsIT.java +++ b/projects/control-service/projects/pipelines_control_service/src/integration-test/java/com/vmware/taurus/graphql/it/GraphQLExecutionsIT.java @@ -102,8 +102,8 @@ private static String getQuery() { } private void cleanup() { - jobsRepository.deleteAll(jobsRepository - .findAllById(List.of(TEST_JOB_NAME_1, TEST_JOB_NAME_2, TEST_JOB_NAME_3))); + jobsRepository.deleteAll( + jobsRepository.findAllById(List.of(TEST_JOB_NAME_1, TEST_JOB_NAME_2, TEST_JOB_NAME_3))); } @Test From aadb4227dab44bccb6e86a8e69950dc7ff259799 Mon Sep 17 00:00:00 2001 From: murphp15 Date: Sun, 22 Jan 2023 18:35:07 +0000 Subject: [PATCH 32/56] Merge branch 'main' into person/murphp15/java_17 --- .../com/vmware/taurus/datajobs/it/common/JobExecutionUtil.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/projects/control-service/projects/pipelines_control_service/src/integration-test/java/com/vmware/taurus/datajobs/it/common/JobExecutionUtil.java b/projects/control-service/projects/pipelines_control_service/src/integration-test/java/com/vmware/taurus/datajobs/it/common/JobExecutionUtil.java index 9d750cccf8..4094476cd8 100644 --- a/projects/control-service/projects/pipelines_control_service/src/integration-test/java/com/vmware/taurus/datajobs/it/common/JobExecutionUtil.java +++ b/projects/control-service/projects/pipelines_control_service/src/integration-test/java/com/vmware/taurus/datajobs/it/common/JobExecutionUtil.java @@ -6,6 +6,7 @@ package com.vmware.taurus.datajobs.it.common; import java.time.OffsetDateTime; +import java.time.temporal.ChronoUnit; import com.vmware.taurus.service.JobExecutionRepository; import com.vmware.taurus.service.model.DataJob; @@ -37,7 +38,7 @@ public static DataJobExecution createDataJobExecution( .resourcesMemoryLimit(1000) .message("message") .lastDeployedBy("test_user") - .lastDeployedDate(OffsetDateTime.now()) + .lastDeployedDate(OffsetDateTime.now().truncatedTo(ChronoUnit.MICROS)) .jobVersion("test_version") .jobSchedule("*/5 * * * *") .opId("test_op_id") From f636c88ab15e8b17276c56b9b500a2214c3bc50e Mon Sep 17 00:00:00 2001 From: murphp15 Date: Sun, 22 Jan 2023 18:58:43 +0000 Subject: [PATCH 33/56] Merge branch 'main' into person/murphp15/java_17 --- .../taurus/service/credentials/JobCredentialsService.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/projects/control-service/projects/pipelines_control_service/src/main/java/com/vmware/taurus/service/credentials/JobCredentialsService.java b/projects/control-service/projects/pipelines_control_service/src/main/java/com/vmware/taurus/service/credentials/JobCredentialsService.java index 04cb064c06..82c0883092 100644 --- a/projects/control-service/projects/pipelines_control_service/src/main/java/com/vmware/taurus/service/credentials/JobCredentialsService.java +++ b/projects/control-service/projects/pipelines_control_service/src/main/java/com/vmware/taurus/service/credentials/JobCredentialsService.java @@ -22,6 +22,8 @@ import java.util.Collections; import java.util.Optional; +import static graphql.Assert.assertTrue; + /** * Manages credentials of a job. * @@ -55,6 +57,7 @@ public void createJobCredentials(String jobName) { File keytabFile; try { keytabFile = File.createTempFile(principal, ".keytab"); + assertTrue(keytabFile.delete()); } catch (IOException e) { throw new ExternalSystemError(MainExternalSystem.HOST_CONTAINER, e); } From 913c9dde00a310202e927d029e1982eeeabb47d7 Mon Sep 17 00:00:00 2001 From: murphp15 Date: Mon, 23 Jan 2023 11:07:26 +0000 Subject: [PATCH 34/56] Merge branch 'main' into person/murphp15/java_17 --- .../taurus/datajobs/it/common/BaseIT.java | 21 ++++++++++++------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/projects/control-service/projects/pipelines_control_service/src/integration-test/java/com/vmware/taurus/datajobs/it/common/BaseIT.java b/projects/control-service/projects/pipelines_control_service/src/integration-test/java/com/vmware/taurus/datajobs/it/common/BaseIT.java index 832d971979..788e2f2553 100644 --- a/projects/control-service/projects/pipelines_control_service/src/integration-test/java/com/vmware/taurus/datajobs/it/common/BaseIT.java +++ b/projects/control-service/projects/pipelines_control_service/src/integration-test/java/com/vmware/taurus/datajobs/it/common/BaseIT.java @@ -17,6 +17,8 @@ import com.vmware.taurus.service.kubernetes.DataJobsKubernetesService; import com.vmware.taurus.service.model.JobConfig; import io.kubernetes.client.openapi.ApiException; +import org.apache.kerby.kerberos.kerb.KrbException; +import org.apache.kerby.kerberos.kerb.server.SimpleKdcServer; import org.hamcrest.BaseMatcher; import org.hamcrest.Description; import org.hamcrest.Matcher; @@ -48,7 +50,7 @@ @Import({BaseIT.KerberosConfig.class}) @DirtiesContext(classMode = DirtiesContext.ClassMode.BEFORE_EACH_TEST_METHOD) @ExtendWith(WebHookServerMockExtension.class) -public class BaseIT extends KerberosSecurityTestcaseJunit5 { +public class BaseIT { private static Logger log = LoggerFactory.getLogger(BaseIT.class); public static final String TEST_JOB_SCHEDULE = "15 10 * * *"; @@ -60,14 +62,14 @@ public class BaseIT extends KerberosSecurityTestcaseJunit5 { protected static final ObjectMapper mapper = new ObjectMapper(); - @Autowired private MiniKdcCredentialsRepository kerberosCredentialsRepository; - @Autowired protected DataJobsKubernetesService dataJobsKubernetesService; @Autowired protected ControlKubernetesService controlKubernetesService; @Autowired protected MockMvc mockMvc; + @Autowired private SimpleKdcServer simpleKdcServer; + @Autowired private WebApplicationContext context; @Value("${integrationTest.dataJobsNamespace:}") @@ -85,8 +87,11 @@ static class KerberosConfig { @Bean @Primary - public KerberosCredentialsRepository credentialsRepository() { - return new MiniKdcCredentialsRepository(); + public SimpleKdcServer simpleKdcServer() throws KrbException { + var simpleKdcServer = new SimpleKdcServer(); + simpleKdcServer.init(); + simpleKdcServer.start(); + return simpleKdcServer; } } @@ -94,11 +99,11 @@ public KerberosCredentialsRepository credentialsRepository() { public void before() { log.info("Running test with: {} bytes of memory.", Runtime.getRuntime().totalMemory()); mockMvc = MockMvcBuilders.webAppContextSetup(context).apply(springSecurity()).build(); - kerberosCredentialsRepository.setMiniKdc(simpleKdcServer); } @AfterEach - public void after() { + public void after() throws KrbException { + simpleKdcServer.stop(); if (ownsDataJobsNamespace) { try { dataJobsKubernetesService.deleteNamespace(dataJobsNamespace); @@ -116,7 +121,7 @@ public void after() { } public static Matcher lambdaMatcher(Predicate predicate) { - return new BaseMatcher() { + return new BaseMatcher<>() { @Override public boolean matches(Object actual) { return predicate.test((String) actual); From 2dc2b3b0738f6a14d5aa1419f61622427bdaa1bb Mon Sep 17 00:00:00 2001 From: murphp15 Date: Mon, 23 Jan 2023 11:07:38 +0000 Subject: [PATCH 35/56] Merge branch 'main' into person/murphp15/java_17 --- .../KerberosSecurityTestcaseJunit5.java | 27 ------------------- 1 file changed, 27 deletions(-) delete mode 100644 projects/control-service/projects/pipelines_control_service/src/integration-test/java/com/vmware/taurus/datajobs/it/common/KerberosSecurityTestcaseJunit5.java diff --git a/projects/control-service/projects/pipelines_control_service/src/integration-test/java/com/vmware/taurus/datajobs/it/common/KerberosSecurityTestcaseJunit5.java b/projects/control-service/projects/pipelines_control_service/src/integration-test/java/com/vmware/taurus/datajobs/it/common/KerberosSecurityTestcaseJunit5.java deleted file mode 100644 index 52cbe51158..0000000000 --- a/projects/control-service/projects/pipelines_control_service/src/integration-test/java/com/vmware/taurus/datajobs/it/common/KerberosSecurityTestcaseJunit5.java +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright 2021 VMware, Inc. - * SPDX-License-Identifier: Apache-2.0 - */ - -package com.vmware.taurus.datajobs.it.common; - -import org.apache.kerby.kerberos.kerb.KrbException; -import org.apache.kerby.kerberos.kerb.server.SimpleKdcServer; -import org.junit.jupiter.api.AfterEach; -import org.junit.jupiter.api.BeforeEach; - -public class KerberosSecurityTestcaseJunit5 { - SimpleKdcServer simpleKdcServer; - // TODO we should think about moving away from MiniKDC as it's not maintained. - @BeforeEach - public void startMiniKdc() throws Exception { - simpleKdcServer = new SimpleKdcServer(); - simpleKdcServer.init(); - simpleKdcServer.start(); - } - - @AfterEach - public void stopMiniKdc() throws KrbException { - simpleKdcServer.stop(); - } -} From 871ff4401095d3e84993f0ba6ca5c49cd89e3b4c Mon Sep 17 00:00:00 2001 From: murphp15 Date: Mon, 23 Jan 2023 11:07:53 +0000 Subject: [PATCH 36/56] Merge branch 'main' into person/murphp15/java_17 --- .../it/common/MiniKdcCredentialsRepository.java | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/projects/control-service/projects/pipelines_control_service/src/integration-test/java/com/vmware/taurus/datajobs/it/common/MiniKdcCredentialsRepository.java b/projects/control-service/projects/pipelines_control_service/src/integration-test/java/com/vmware/taurus/datajobs/it/common/MiniKdcCredentialsRepository.java index 102f183629..1791784275 100644 --- a/projects/control-service/projects/pipelines_control_service/src/integration-test/java/com/vmware/taurus/datajobs/it/common/MiniKdcCredentialsRepository.java +++ b/projects/control-service/projects/pipelines_control_service/src/integration-test/java/com/vmware/taurus/datajobs/it/common/MiniKdcCredentialsRepository.java @@ -6,12 +6,14 @@ package com.vmware.taurus.datajobs.it.common; import com.vmware.taurus.service.credentials.KerberosCredentialsRepository; -import lombok.Setter; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.io.File; import java.util.Optional; import org.apache.kerby.kerberos.kerb.server.SimpleKdcServer; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Primary; +import org.springframework.stereotype.Component; /** * This class can be used to replace {@link KerberosCredentialsRepository} for testing purposes. It @@ -21,14 +23,17 @@ * (tsvetkovt@vmware.com) was not able to connect to MiniKdc or to a * dockerized KDC with kadmin. * TODO we should think about moving away from MiniKDC as it's not maintained. */ -@Setter +@Component +@Primary public class MiniKdcCredentialsRepository extends KerberosCredentialsRepository { private static final Logger log = LoggerFactory.getLogger(MiniKdcCredentialsRepository.class); private SimpleKdcServer miniKdc; - public MiniKdcCredentialsRepository() { + @Autowired + public MiniKdcCredentialsRepository(SimpleKdcServer miniKdc) { super("test", "test"); + this.miniKdc = miniKdc; } @Override From 5a3c57bddc5331e02dfbe981bc646b4a9be71a5a Mon Sep 17 00:00:00 2001 From: github-actions <> Date: Mon, 23 Jan 2023 11:08:23 +0000 Subject: [PATCH 37/56] Google Java Format --- .../java/com/vmware/taurus/datajobs/it/common/BaseIT.java | 1 - 1 file changed, 1 deletion(-) diff --git a/projects/control-service/projects/pipelines_control_service/src/integration-test/java/com/vmware/taurus/datajobs/it/common/BaseIT.java b/projects/control-service/projects/pipelines_control_service/src/integration-test/java/com/vmware/taurus/datajobs/it/common/BaseIT.java index 788e2f2553..7e0b0ab2d0 100644 --- a/projects/control-service/projects/pipelines_control_service/src/integration-test/java/com/vmware/taurus/datajobs/it/common/BaseIT.java +++ b/projects/control-service/projects/pipelines_control_service/src/integration-test/java/com/vmware/taurus/datajobs/it/common/BaseIT.java @@ -12,7 +12,6 @@ import com.vmware.taurus.controlplane.model.data.DataJobMode; import com.vmware.taurus.controlplane.model.data.DataJobResources; import com.vmware.taurus.controlplane.model.data.DataJobSchedule; -import com.vmware.taurus.service.credentials.KerberosCredentialsRepository; import com.vmware.taurus.service.kubernetes.ControlKubernetesService; import com.vmware.taurus.service.kubernetes.DataJobsKubernetesService; import com.vmware.taurus.service.model.JobConfig; From 2aa3eb23907818cc1902bd8252821e22b7da6c1e Mon Sep 17 00:00:00 2001 From: murphp15 Date: Mon, 23 Jan 2023 13:56:21 +0000 Subject: [PATCH 38/56] Merge branch 'main' into person/murphp15/java_17 --- .../vmware/taurus/graphql/it/GraphQLExecutionsLogsUrlIT.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/projects/control-service/projects/pipelines_control_service/src/integration-test/java/com/vmware/taurus/graphql/it/GraphQLExecutionsLogsUrlIT.java b/projects/control-service/projects/pipelines_control_service/src/integration-test/java/com/vmware/taurus/graphql/it/GraphQLExecutionsLogsUrlIT.java index b073ff07bc..ee75b7a133 100644 --- a/projects/control-service/projects/pipelines_control_service/src/integration-test/java/com/vmware/taurus/graphql/it/GraphQLExecutionsLogsUrlIT.java +++ b/projects/control-service/projects/pipelines_control_service/src/integration-test/java/com/vmware/taurus/graphql/it/GraphQLExecutionsLogsUrlIT.java @@ -12,6 +12,7 @@ import java.text.MessageFormat; import java.time.OffsetDateTime; +import java.time.temporal.ChronoUnit; import java.util.List; import org.hamcrest.Matchers; @@ -132,7 +133,7 @@ public void testExecutions_filterByStartTimeGte() throws Exception { "{" + "\"filter\": {" + " \"startTimeGte\": \"" - + dataJobExecution3.getStartTime() + + dataJobExecution3.getStartTime().truncatedTo(ChronoUnit.MICROS) + "\"" + " }," + "\"pageNumber\": 1," From e60c8e9262c3672864ae105ab42c44f37734837b Mon Sep 17 00:00:00 2001 From: murphp15 Date: Mon, 23 Jan 2023 20:42:01 +0000 Subject: [PATCH 39/56] control-service: use latest docker image Signed-off-by: murphp15 --- projects/control-service/cicd/.gitlab-ci.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/projects/control-service/cicd/.gitlab-ci.yml b/projects/control-service/cicd/.gitlab-ci.yml index ea9c0615be..a64f2351d1 100644 --- a/projects/control-service/cicd/.gitlab-ci.yml +++ b/projects/control-service/cicd/.gitlab-ci.yml @@ -33,7 +33,7 @@ variables: _JAVA_OPTIONS: "-Xms2048m -Xmx4096m" before_script: - - apk --no-cache add openjdk11-jdk git zip curl zip py-pip + - apk --no-cache add openjdk17-jdk git zip curl zip py-pip - pip install --upgrade pip && pip install awscli control_service_build_image: @@ -42,7 +42,7 @@ control_service_build_image: - .images:dind stage: build script: - - apk --no-cache add git openjdk11-jdk + - apk --no-cache add git openjdk17-jdk - export TAG=$(git rev-parse --short HEAD) - cd projects/control-service/projects - ./gradlew -p ./model build publishToMavenLocal --info --stacktrace @@ -178,7 +178,7 @@ control_service_publish_image: extends: .images:dind stage: publish_artifacts script: - - apk add --no-cache git openjdk11-jdk + - apk add --no-cache git openjdk17-jdk - export TAG=$(git rev-parse --short HEAD) - docker login -u $VDK_DOCKER_REGISTRY_USERNAME -p $VDK_DOCKER_REGISTRY_PASSWORD - cd projects/control-service/projects @@ -203,7 +203,7 @@ control_service_publish_api_client: image: docker:20.10.22 stage: publish_artifacts script: - - apk add --no-cache py-pip openjdk11-jdk git python + - apk add --no-cache py-pip openjdk17-jdk git python - pip install -U pip setuptools wheel twine - ./projects/control-service/projects/gradlew -p ./projects/control-service/projects/model buildPython - cd projects/control-service/projects/model/apidefs/datajob-api/build From 76bbf51f24a1bb8c78a0a990646c1439a189ebba Mon Sep 17 00:00:00 2001 From: Paul Murphy Date: Tue, 24 Jan 2023 14:39:53 +0000 Subject: [PATCH 40/56] Update format.yml --- .github/workflows/format.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/format.yml b/.github/workflows/format.yml index a63c8c7c2d..eb8794aa25 100644 --- a/.github/workflows/format.yml +++ b/.github/workflows/format.yml @@ -9,7 +9,7 @@ jobs: formatting: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 # v2 minimum required - - uses: axel-op/googlejavaformat-action@v3.6.0 + - uses: actions/checkout@v2 # v2 minimum required + - uses: axel-op/googlejavaformat-action@v3 with: args: "--skip-sorting-imports --replace" From 5a614147d280fbf9f9071fe2525b42dae9e9bdc8 Mon Sep 17 00:00:00 2001 From: murphp15 Date: Wed, 25 Jan 2023 13:04:58 +0000 Subject: [PATCH 41/56] control-service: only delete file in test path Signed-off-by: murphp15 --- .../test/java/com/vmware/taurus/RepositoryUtil.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/projects/control-service/projects/pipelines_control_service/src/test/java/com/vmware/taurus/RepositoryUtil.java b/projects/control-service/projects/pipelines_control_service/src/test/java/com/vmware/taurus/RepositoryUtil.java index 84def5001c..a1aa212d70 100644 --- a/projects/control-service/projects/pipelines_control_service/src/test/java/com/vmware/taurus/RepositoryUtil.java +++ b/projects/control-service/projects/pipelines_control_service/src/test/java/com/vmware/taurus/RepositoryUtil.java @@ -143,7 +143,7 @@ public static DataJobExecution createDataJobExecution( .resourcesMemoryLimit(1000) .message(message) .lastDeployedBy("test_user") - .lastDeployedDate(OffsetDateTime.now().truncatedTo(ChronoUnit.MICROS)) + .lastDeployedDate(getTimeAccurateToMicroSecond()) .jobVersion("test_version") .jobSchedule("*/5 * * * *") .opId("test_op_id") @@ -152,4 +152,12 @@ public static DataJobExecution createDataJobExecution( return jobExecutionRepository.save(expectedJobExecution); } + + + /** at the database level we only store date-times accurate to the microsecond. Like wise in older versions of java .now() returned timestamps accurate to micro-seconds. + * In newer versions of java .now() gives nano-second precision and it causes tests written before we adopted that java version to fail. + */ + public static OffsetDateTime getTimeAccurateToMicroSecond(){ + OffsetDateTime.now().truncatedTo(ChronoUnit.MICROS); + } } From a9076785251c71072e4c14af5bd46608846a3d9e Mon Sep 17 00:00:00 2001 From: murphp15 Date: Wed, 25 Jan 2023 13:05:09 +0000 Subject: [PATCH 42/56] control-service: only delete file in test path Signed-off-by: murphp15 --- .../src/test/java/com/vmware/taurus/RepositoryUtil.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/projects/control-service/projects/pipelines_control_service/src/test/java/com/vmware/taurus/RepositoryUtil.java b/projects/control-service/projects/pipelines_control_service/src/test/java/com/vmware/taurus/RepositoryUtil.java index a1aa212d70..045d9c2548 100644 --- a/projects/control-service/projects/pipelines_control_service/src/test/java/com/vmware/taurus/RepositoryUtil.java +++ b/projects/control-service/projects/pipelines_control_service/src/test/java/com/vmware/taurus/RepositoryUtil.java @@ -158,6 +158,6 @@ public static DataJobExecution createDataJobExecution( * In newer versions of java .now() gives nano-second precision and it causes tests written before we adopted that java version to fail. */ public static OffsetDateTime getTimeAccurateToMicroSecond(){ - OffsetDateTime.now().truncatedTo(ChronoUnit.MICROS); + return OffsetDateTime.now().truncatedTo(ChronoUnit.MICROS); } } From d92fa222b9ae13e3685069baff0aa7f25d6f4578 Mon Sep 17 00:00:00 2001 From: github-actions <> Date: Wed, 25 Jan 2023 13:05:33 +0000 Subject: [PATCH 43/56] Google Java Format --- .../test/java/com/vmware/taurus/RepositoryUtil.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/projects/control-service/projects/pipelines_control_service/src/test/java/com/vmware/taurus/RepositoryUtil.java b/projects/control-service/projects/pipelines_control_service/src/test/java/com/vmware/taurus/RepositoryUtil.java index 045d9c2548..01734df94a 100644 --- a/projects/control-service/projects/pipelines_control_service/src/test/java/com/vmware/taurus/RepositoryUtil.java +++ b/projects/control-service/projects/pipelines_control_service/src/test/java/com/vmware/taurus/RepositoryUtil.java @@ -153,11 +153,13 @@ public static DataJobExecution createDataJobExecution( return jobExecutionRepository.save(expectedJobExecution); } - - /** at the database level we only store date-times accurate to the microsecond. Like wise in older versions of java .now() returned timestamps accurate to micro-seconds. - * In newer versions of java .now() gives nano-second precision and it causes tests written before we adopted that java version to fail. + /** + * at the database level we only store date-times accurate to the microsecond. Like wise in older + * versions of java .now() returned timestamps accurate to micro-seconds. In newer versions of + * java .now() gives nano-second precision and it causes tests written before we adopted that java + * version to fail. */ - public static OffsetDateTime getTimeAccurateToMicroSecond(){ + public static OffsetDateTime getTimeAccurateToMicroSecond() { return OffsetDateTime.now().truncatedTo(ChronoUnit.MICROS); } } From 59eb93ce5ab7cd4a397748f96eba48d2ac556469 Mon Sep 17 00:00:00 2001 From: murphp15 Date: Wed, 25 Jan 2023 13:07:22 +0000 Subject: [PATCH 44/56] control-service: only delete file in test path Signed-off-by: murphp15 --- .../vmware/taurus/datajobs/it/common/JobExecutionUtil.java | 7 +++++++ .../com/vmware/taurus/graphql/it/GraphQLExecutionsIT.java | 3 ++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/projects/control-service/projects/pipelines_control_service/src/integration-test/java/com/vmware/taurus/datajobs/it/common/JobExecutionUtil.java b/projects/control-service/projects/pipelines_control_service/src/integration-test/java/com/vmware/taurus/datajobs/it/common/JobExecutionUtil.java index 4094476cd8..3fc2934317 100644 --- a/projects/control-service/projects/pipelines_control_service/src/integration-test/java/com/vmware/taurus/datajobs/it/common/JobExecutionUtil.java +++ b/projects/control-service/projects/pipelines_control_service/src/integration-test/java/com/vmware/taurus/datajobs/it/common/JobExecutionUtil.java @@ -16,6 +16,13 @@ public class JobExecutionUtil { + /** at the database level we only store date-times accurate to the microsecond. Like wise in older versions of java .now() returned timestamps accurate to micro-seconds. + * In newer versions of java .now() gives nano-second precision and it causes tests written before we adopted that java version to fail. + */ + public static OffsetDateTime getTimeAccurateToMicroSecond(){ + return OffsetDateTime.now().truncatedTo(ChronoUnit.MICROS); + } + public static DataJobExecution createDataJobExecution( JobExecutionRepository jobExecutionRepository, String executionId, diff --git a/projects/control-service/projects/pipelines_control_service/src/integration-test/java/com/vmware/taurus/graphql/it/GraphQLExecutionsIT.java b/projects/control-service/projects/pipelines_control_service/src/integration-test/java/com/vmware/taurus/graphql/it/GraphQLExecutionsIT.java index 6ecf94a3cb..07727eaf0f 100644 --- a/projects/control-service/projects/pipelines_control_service/src/integration-test/java/com/vmware/taurus/graphql/it/GraphQLExecutionsIT.java +++ b/projects/control-service/projects/pipelines_control_service/src/integration-test/java/com/vmware/taurus/graphql/it/GraphQLExecutionsIT.java @@ -25,6 +25,7 @@ import java.time.temporal.ChronoUnit; import java.util.List; +import static com.vmware.taurus.datajobs.it.common.JobExecutionUtil.getTimeAccurateToMicroSecond; import static org.springframework.security.test.web.servlet.request.SecurityMockMvcRequestPostProcessors.user; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.content; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath; @@ -68,7 +69,7 @@ public void setup() { this.dataJob2 = jobsRepository.save(new DataJob(TEST_JOB_NAME_2, config2)); this.dataJob3 = jobsRepository.save(new DataJob(TEST_JOB_NAME_3, config3)); - OffsetDateTime now = OffsetDateTime.now().truncatedTo(ChronoUnit.MICROS); + OffsetDateTime now = getTimeAccurateToMicroSecond(); this.dataJobExecution1 = JobExecutionUtil.createDataJobExecution( jobExecutionRepository, "testId1", dataJob1, now, now, ExecutionStatus.SUCCEEDED); From c71e10bd5c6b7457a954e95f9c92e63099401f58 Mon Sep 17 00:00:00 2001 From: murphp15 Date: Wed, 25 Jan 2023 13:09:07 +0000 Subject: [PATCH 45/56] control-service: only delete file in test path Signed-off-by: murphp15 --- .../com/vmware/taurus/datajobs/it/common/JobExecutionUtil.java | 3 +++ .../vmware/taurus/graphql/it/GraphQLExecutionsLogsUrlIT.java | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/projects/control-service/projects/pipelines_control_service/src/integration-test/java/com/vmware/taurus/datajobs/it/common/JobExecutionUtil.java b/projects/control-service/projects/pipelines_control_service/src/integration-test/java/com/vmware/taurus/datajobs/it/common/JobExecutionUtil.java index 3fc2934317..771dd0b81a 100644 --- a/projects/control-service/projects/pipelines_control_service/src/integration-test/java/com/vmware/taurus/datajobs/it/common/JobExecutionUtil.java +++ b/projects/control-service/projects/pipelines_control_service/src/integration-test/java/com/vmware/taurus/datajobs/it/common/JobExecutionUtil.java @@ -23,6 +23,9 @@ public static OffsetDateTime getTimeAccurateToMicroSecond(){ return OffsetDateTime.now().truncatedTo(ChronoUnit.MICROS); } + public static OffsetDateTime roundDateTimeToMicros(OffsetDateTime dateTime){ + return dateTime.plusNanos(500).truncatedTo(ChronoUnit.MICROS); + } public static DataJobExecution createDataJobExecution( JobExecutionRepository jobExecutionRepository, String executionId, diff --git a/projects/control-service/projects/pipelines_control_service/src/integration-test/java/com/vmware/taurus/graphql/it/GraphQLExecutionsLogsUrlIT.java b/projects/control-service/projects/pipelines_control_service/src/integration-test/java/com/vmware/taurus/graphql/it/GraphQLExecutionsLogsUrlIT.java index ee75b7a133..21d14b4871 100644 --- a/projects/control-service/projects/pipelines_control_service/src/integration-test/java/com/vmware/taurus/graphql/it/GraphQLExecutionsLogsUrlIT.java +++ b/projects/control-service/projects/pipelines_control_service/src/integration-test/java/com/vmware/taurus/graphql/it/GraphQLExecutionsLogsUrlIT.java @@ -5,6 +5,7 @@ package com.vmware.taurus.graphql.it; +import static com.vmware.taurus.datajobs.it.common.JobExecutionUtil.getTimeAccurateToMicroSecond; import static org.springframework.security.test.web.servlet.request.SecurityMockMvcRequestPostProcessors.user; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.content; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath; @@ -133,7 +134,7 @@ public void testExecutions_filterByStartTimeGte() throws Exception { "{" + "\"filter\": {" + " \"startTimeGte\": \"" - + dataJobExecution3.getStartTime().truncatedTo(ChronoUnit.MICROS) + + getTimeAccurateToMicroSecond() + "\"" + " }," + "\"pageNumber\": 1," From 00d134b5ed35d2ddaf7c9f31a8bd33000371d3bf Mon Sep 17 00:00:00 2001 From: github-actions <> Date: Wed, 25 Jan 2023 13:09:33 +0000 Subject: [PATCH 46/56] Google Java Format --- .../taurus/datajobs/it/common/JobExecutionUtil.java | 12 ++++++++---- .../taurus/graphql/it/GraphQLExecutionsIT.java | 1 - .../graphql/it/GraphQLExecutionsLogsUrlIT.java | 1 - 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/projects/control-service/projects/pipelines_control_service/src/integration-test/java/com/vmware/taurus/datajobs/it/common/JobExecutionUtil.java b/projects/control-service/projects/pipelines_control_service/src/integration-test/java/com/vmware/taurus/datajobs/it/common/JobExecutionUtil.java index 771dd0b81a..9d0bbe04ca 100644 --- a/projects/control-service/projects/pipelines_control_service/src/integration-test/java/com/vmware/taurus/datajobs/it/common/JobExecutionUtil.java +++ b/projects/control-service/projects/pipelines_control_service/src/integration-test/java/com/vmware/taurus/datajobs/it/common/JobExecutionUtil.java @@ -16,16 +16,20 @@ public class JobExecutionUtil { - /** at the database level we only store date-times accurate to the microsecond. Like wise in older versions of java .now() returned timestamps accurate to micro-seconds. - * In newer versions of java .now() gives nano-second precision and it causes tests written before we adopted that java version to fail. + /** + * at the database level we only store date-times accurate to the microsecond. Like wise in older + * versions of java .now() returned timestamps accurate to micro-seconds. In newer versions of + * java .now() gives nano-second precision and it causes tests written before we adopted that java + * version to fail. */ - public static OffsetDateTime getTimeAccurateToMicroSecond(){ + public static OffsetDateTime getTimeAccurateToMicroSecond() { return OffsetDateTime.now().truncatedTo(ChronoUnit.MICROS); } - public static OffsetDateTime roundDateTimeToMicros(OffsetDateTime dateTime){ + public static OffsetDateTime roundDateTimeToMicros(OffsetDateTime dateTime) { return dateTime.plusNanos(500).truncatedTo(ChronoUnit.MICROS); } + public static DataJobExecution createDataJobExecution( JobExecutionRepository jobExecutionRepository, String executionId, diff --git a/projects/control-service/projects/pipelines_control_service/src/integration-test/java/com/vmware/taurus/graphql/it/GraphQLExecutionsIT.java b/projects/control-service/projects/pipelines_control_service/src/integration-test/java/com/vmware/taurus/graphql/it/GraphQLExecutionsIT.java index 07727eaf0f..a62be05f93 100644 --- a/projects/control-service/projects/pipelines_control_service/src/integration-test/java/com/vmware/taurus/graphql/it/GraphQLExecutionsIT.java +++ b/projects/control-service/projects/pipelines_control_service/src/integration-test/java/com/vmware/taurus/graphql/it/GraphQLExecutionsIT.java @@ -22,7 +22,6 @@ import org.springframework.test.web.servlet.request.MockMvcRequestBuilders; import java.time.OffsetDateTime; -import java.time.temporal.ChronoUnit; import java.util.List; import static com.vmware.taurus.datajobs.it.common.JobExecutionUtil.getTimeAccurateToMicroSecond; diff --git a/projects/control-service/projects/pipelines_control_service/src/integration-test/java/com/vmware/taurus/graphql/it/GraphQLExecutionsLogsUrlIT.java b/projects/control-service/projects/pipelines_control_service/src/integration-test/java/com/vmware/taurus/graphql/it/GraphQLExecutionsLogsUrlIT.java index 21d14b4871..7edd1f5d5f 100644 --- a/projects/control-service/projects/pipelines_control_service/src/integration-test/java/com/vmware/taurus/graphql/it/GraphQLExecutionsLogsUrlIT.java +++ b/projects/control-service/projects/pipelines_control_service/src/integration-test/java/com/vmware/taurus/graphql/it/GraphQLExecutionsLogsUrlIT.java @@ -13,7 +13,6 @@ import java.text.MessageFormat; import java.time.OffsetDateTime; -import java.time.temporal.ChronoUnit; import java.util.List; import org.hamcrest.Matchers; From 51662f96965a0a26b4ba1c3f626cafa2f81623fa Mon Sep 17 00:00:00 2001 From: murphp15 Date: Wed, 25 Jan 2023 13:12:35 +0000 Subject: [PATCH 47/56] control-service: only delete file in test path Signed-off-by: murphp15 --- .../datajobs/it/common/JobExecutionUtil.java | 4 --- .../GraphQLJobExecutionsSortByEndTimeIT.java | 27 +++++++------------ 2 files changed, 9 insertions(+), 22 deletions(-) diff --git a/projects/control-service/projects/pipelines_control_service/src/integration-test/java/com/vmware/taurus/datajobs/it/common/JobExecutionUtil.java b/projects/control-service/projects/pipelines_control_service/src/integration-test/java/com/vmware/taurus/datajobs/it/common/JobExecutionUtil.java index 9d0bbe04ca..f75d7d5c8b 100644 --- a/projects/control-service/projects/pipelines_control_service/src/integration-test/java/com/vmware/taurus/datajobs/it/common/JobExecutionUtil.java +++ b/projects/control-service/projects/pipelines_control_service/src/integration-test/java/com/vmware/taurus/datajobs/it/common/JobExecutionUtil.java @@ -26,10 +26,6 @@ public static OffsetDateTime getTimeAccurateToMicroSecond() { return OffsetDateTime.now().truncatedTo(ChronoUnit.MICROS); } - public static OffsetDateTime roundDateTimeToMicros(OffsetDateTime dateTime) { - return dateTime.plusNanos(500).truncatedTo(ChronoUnit.MICROS); - } - public static DataJobExecution createDataJobExecution( JobExecutionRepository jobExecutionRepository, String executionId, diff --git a/projects/control-service/projects/pipelines_control_service/src/integration-test/java/com/vmware/taurus/graphql/it/GraphQLJobExecutionsSortByEndTimeIT.java b/projects/control-service/projects/pipelines_control_service/src/integration-test/java/com/vmware/taurus/graphql/it/GraphQLJobExecutionsSortByEndTimeIT.java index 810b003ce5..e50fa4cd5a 100644 --- a/projects/control-service/projects/pipelines_control_service/src/integration-test/java/com/vmware/taurus/graphql/it/GraphQLJobExecutionsSortByEndTimeIT.java +++ b/projects/control-service/projects/pipelines_control_service/src/integration-test/java/com/vmware/taurus/graphql/it/GraphQLJobExecutionsSortByEndTimeIT.java @@ -96,7 +96,7 @@ public void testCallWithSingleExecution(String jobName, String username) throws .andExpect(jsonPath("$.data.content[0].deployments[0].executions[0].id").value(expectedId)) .andExpect( jsonPath("$.data.content[0].deployments[0].executions[0].endTime") - .value(expectedEndTime.plusNanos(500).truncatedTo(ChronoUnit.MICROS).toString())); + .value(roundDateTimeToMicros(expectedEndTime))); } @Test @@ -121,19 +121,11 @@ public void testCallTwoExecutionsSortAsc(String jobName, String username) throws .andExpect(jsonPath("$.data.content[0].deployments[0].executions[0].id").value(expectedId2)) .andExpect( jsonPath("$.data.content[0].deployments[0].executions[0].endTime") - .value( - expectedEndTimeSmaller - .plusNanos(500) - .truncatedTo(ChronoUnit.MICROS) - .toString())) + .value(roundDateTimeToMicros(expectedEndTimeSmaller))) .andExpect(jsonPath("$.data.content[0].deployments[0].executions[1].id").value(expectedId1)) .andExpect( jsonPath("$.data.content[0].deployments[0].executions[1].endTime") - .value( - expectedEndTimeLarger - .plusNanos(500) - .truncatedTo(ChronoUnit.MICROS) - .toString())); + .value(roundDateTimeToMicros(expectedEndTimeLarger))); } @Test @@ -158,16 +150,11 @@ public void testCallTwoExecutionsSortDesc(String jobName, String username) throw .andExpect(jsonPath("$.data.content[0].deployments[0].executions[0].id").value(expectedId1)) .andExpect( jsonPath("$.data.content[0].deployments[0].executions[0].endTime") - .value( - expectedEndTimeLarger.plusNanos(500).truncatedTo(ChronoUnit.MICROS).toString())) + .value(roundDateTimeToMicros(expectedEndTimeLarger))) .andExpect(jsonPath("$.data.content[0].deployments[0].executions[1].id").value(expectedId2)) .andExpect( jsonPath("$.data.content[0].deployments[0].executions[1].endTime") - .value( - expectedEndTimeSmaller - .plusNanos(500) - .truncatedTo(ChronoUnit.MICROS) - .toString())); + .value(roundDateTimeToMicros(expectedEndTimeSmaller))); } @Test @@ -214,4 +201,8 @@ private void createDataJobExecution(String executionId, String jobName, OffsetDa jobExecutionRepository.save(jobExecution); } + + private static String roundDateTimeToMicros(OffsetDateTime dateTime){ + return dateTime.plusNanos(500).truncatedTo(ChronoUnit.MICROS).toString(); + } } From aa55f2de9f67a1f898729b713029abc37214b620 Mon Sep 17 00:00:00 2001 From: github-actions <> Date: Wed, 25 Jan 2023 13:14:04 +0000 Subject: [PATCH 48/56] Google Java Format --- .../taurus/graphql/it/GraphQLJobExecutionsSortByEndTimeIT.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/projects/control-service/projects/pipelines_control_service/src/integration-test/java/com/vmware/taurus/graphql/it/GraphQLJobExecutionsSortByEndTimeIT.java b/projects/control-service/projects/pipelines_control_service/src/integration-test/java/com/vmware/taurus/graphql/it/GraphQLJobExecutionsSortByEndTimeIT.java index e50fa4cd5a..7b97fb1b92 100644 --- a/projects/control-service/projects/pipelines_control_service/src/integration-test/java/com/vmware/taurus/graphql/it/GraphQLJobExecutionsSortByEndTimeIT.java +++ b/projects/control-service/projects/pipelines_control_service/src/integration-test/java/com/vmware/taurus/graphql/it/GraphQLJobExecutionsSortByEndTimeIT.java @@ -202,7 +202,7 @@ private void createDataJobExecution(String executionId, String jobName, OffsetDa jobExecutionRepository.save(jobExecution); } - private static String roundDateTimeToMicros(OffsetDateTime dateTime){ + private static String roundDateTimeToMicros(OffsetDateTime dateTime) { return dateTime.plusNanos(500).truncatedTo(ChronoUnit.MICROS).toString(); } } From 26812321412dd887dd4d4337328c1b315a60c069 Mon Sep 17 00:00:00 2001 From: murphp15 Date: Wed, 25 Jan 2023 13:17:12 +0000 Subject: [PATCH 49/56] control-service: only delete file in test path Signed-off-by: murphp15 --- .../datajobs/it/common/JobExecutionUtil.java | 2 +- .../com/vmware/taurus/RepositoryUtil.java | 8 +++--- .../service/JobExecutionFilterSpecIT.java | 9 ++++--- .../service/JobExecutionRepositoryIT.java | 6 +++-- .../JobExecutionServiceUpdateExecutionIT.java | 8 +++--- ...nDataFetcherFindAllAndBuildResponseIT.java | 25 ++++++++++--------- .../monitoring/DataJobMonitorTest.java | 7 +++--- 7 files changed, 36 insertions(+), 29 deletions(-) diff --git a/projects/control-service/projects/pipelines_control_service/src/integration-test/java/com/vmware/taurus/datajobs/it/common/JobExecutionUtil.java b/projects/control-service/projects/pipelines_control_service/src/integration-test/java/com/vmware/taurus/datajobs/it/common/JobExecutionUtil.java index f75d7d5c8b..50e4e2a84d 100644 --- a/projects/control-service/projects/pipelines_control_service/src/integration-test/java/com/vmware/taurus/datajobs/it/common/JobExecutionUtil.java +++ b/projects/control-service/projects/pipelines_control_service/src/integration-test/java/com/vmware/taurus/datajobs/it/common/JobExecutionUtil.java @@ -48,7 +48,7 @@ public static DataJobExecution createDataJobExecution( .resourcesMemoryLimit(1000) .message("message") .lastDeployedBy("test_user") - .lastDeployedDate(OffsetDateTime.now().truncatedTo(ChronoUnit.MICROS)) + .lastDeployedDate(getTimeAccurateToMicroSecond()) .jobVersion("test_version") .jobSchedule("*/5 * * * *") .opId("test_op_id") diff --git a/projects/control-service/projects/pipelines_control_service/src/test/java/com/vmware/taurus/RepositoryUtil.java b/projects/control-service/projects/pipelines_control_service/src/test/java/com/vmware/taurus/RepositoryUtil.java index 01734df94a..50cd52b9ad 100644 --- a/projects/control-service/projects/pipelines_control_service/src/test/java/com/vmware/taurus/RepositoryUtil.java +++ b/projects/control-service/projects/pipelines_control_service/src/test/java/com/vmware/taurus/RepositoryUtil.java @@ -83,7 +83,7 @@ public static DataJobExecution createDataJobExecution( executionStatus, message, startTime, - OffsetDateTime.now().truncatedTo(ChronoUnit.MICROS)); + getTimeAccurateToMicroSecond()); } public static DataJobExecution createDataJobExecution( @@ -100,7 +100,7 @@ public static DataJobExecution createDataJobExecution( executionStatus, "test_message", startTime, - OffsetDateTime.now().truncatedTo(ChronoUnit.MICROS)); + getTimeAccurateToMicroSecond()); } public static DataJobExecution createDataJobExecution( @@ -116,8 +116,8 @@ public static DataJobExecution createDataJobExecution( dataJob, executionStatus, message, - OffsetDateTime.now().truncatedTo(ChronoUnit.MICROS), - OffsetDateTime.now().truncatedTo(ChronoUnit.MICROS)); + getTimeAccurateToMicroSecond(), + getTimeAccurateToMicroSecond()); } public static DataJobExecution createDataJobExecution( diff --git a/projects/control-service/projects/pipelines_control_service/src/test/java/com/vmware/taurus/service/JobExecutionFilterSpecIT.java b/projects/control-service/projects/pipelines_control_service/src/test/java/com/vmware/taurus/service/JobExecutionFilterSpecIT.java index 3060dc2125..ec7bf9643a 100644 --- a/projects/control-service/projects/pipelines_control_service/src/test/java/com/vmware/taurus/service/JobExecutionFilterSpecIT.java +++ b/projects/control-service/projects/pipelines_control_service/src/test/java/com/vmware/taurus/service/JobExecutionFilterSpecIT.java @@ -18,9 +18,10 @@ import org.springframework.boot.test.context.SpringBootTest; import java.time.OffsetDateTime; -import java.time.temporal.ChronoUnit; import java.util.List; +import static com.vmware.taurus.RepositoryUtil.getTimeAccurateToMicroSecond; + @SpringBootTest(classes = ControlplaneApplication.class) public class JobExecutionFilterSpecIT { @@ -70,7 +71,7 @@ public void testJobExecutionFilterSpec_filerByStatusIn_shouldReturnResult() { @Test public void testJobExecutionFilterSpec_filerByStartTimeGte_shouldReturnResult() { DataJob actualDataJob = RepositoryUtil.createDataJob(jobsRepository); - OffsetDateTime now = OffsetDateTime.now().truncatedTo(ChronoUnit.MICROS); + OffsetDateTime now = getTimeAccurateToMicroSecond(); RepositoryUtil.createDataJobExecution( jobExecutionRepository, @@ -113,7 +114,7 @@ public void testJobExecutionFilterSpec_filerByStartTimeGte_shouldReturnResult() @Test public void testJobExecutionFilterSpec_filerByEndTimeGte_shouldReturnResult() { DataJob actualDataJob = RepositoryUtil.createDataJob(jobsRepository); - OffsetDateTime now = OffsetDateTime.now().truncatedTo(ChronoUnit.MICROS); + OffsetDateTime now = getTimeAccurateToMicroSecond(); RepositoryUtil.createDataJobExecution( jobExecutionRepository, @@ -160,7 +161,7 @@ public void testJobExecutionFilterSpec_filerByEndTimeGte_shouldReturnResult() { @Test public void testJobExecutionFilterSpec_filerByAllFields_shouldReturnResult() { DataJob actualDataJob = RepositoryUtil.createDataJob(jobsRepository); - OffsetDateTime now = OffsetDateTime.now().truncatedTo(ChronoUnit.MICROS); + OffsetDateTime now = getTimeAccurateToMicroSecond(); RepositoryUtil.createDataJobExecution( jobExecutionRepository, diff --git a/projects/control-service/projects/pipelines_control_service/src/test/java/com/vmware/taurus/service/JobExecutionRepositoryIT.java b/projects/control-service/projects/pipelines_control_service/src/test/java/com/vmware/taurus/service/JobExecutionRepositoryIT.java index 6134028c02..3ed16b379b 100644 --- a/projects/control-service/projects/pipelines_control_service/src/test/java/com/vmware/taurus/service/JobExecutionRepositoryIT.java +++ b/projects/control-service/projects/pipelines_control_service/src/test/java/com/vmware/taurus/service/JobExecutionRepositoryIT.java @@ -24,6 +24,8 @@ import java.time.temporal.ChronoUnit; import java.util.List; +import static com.vmware.taurus.RepositoryUtil.getTimeAccurateToMicroSecond; + /** Integration tests of the setup of Spring Data repository for data job executions */ @SpringBootTest(classes = ControlplaneApplication.class) public class JobExecutionRepositoryIT { @@ -247,7 +249,7 @@ void testUpdateExecutionStatusWhereOldStatusInAndExecutionIdIn_withExecutions_sh jobExecutionRepository.save(execution1); jobExecutionRepository.save(execution2); - var executionEndTime = OffsetDateTime.now().truncatedTo(ChronoUnit.MICROS); + var executionEndTime = getTimeAccurateToMicroSecond(); var message = "Changed by test"; jobExecutionRepository.updateExecutionStatusWhereOldStatusInAndExecutionIdIn( ExecutionStatus.CANCELLED, @@ -294,7 +296,7 @@ void testUpdateExecutionStatusWhereOldStatusInAndExecutionIdIn_withExecutions_sh jobExecutionRepository.save(execution1); jobExecutionRepository.save(execution2); - var executionEndTime = OffsetDateTime.now().truncatedTo(ChronoUnit.MICROS); + var executionEndTime = getTimeAccurateToMicroSecond(); var message = "Changed by test"; jobExecutionRepository.updateExecutionStatusWhereOldStatusInAndExecutionIdIn( ExecutionStatus.CANCELLED, diff --git a/projects/control-service/projects/pipelines_control_service/src/test/java/com/vmware/taurus/service/execution/JobExecutionServiceUpdateExecutionIT.java b/projects/control-service/projects/pipelines_control_service/src/test/java/com/vmware/taurus/service/execution/JobExecutionServiceUpdateExecutionIT.java index fcb9f20e14..e2a4999cb6 100644 --- a/projects/control-service/projects/pipelines_control_service/src/test/java/com/vmware/taurus/service/execution/JobExecutionServiceUpdateExecutionIT.java +++ b/projects/control-service/projects/pipelines_control_service/src/test/java/com/vmware/taurus/service/execution/JobExecutionServiceUpdateExecutionIT.java @@ -30,6 +30,8 @@ import com.vmware.taurus.service.model.ExecutionStatus; import com.vmware.taurus.service.model.ExecutionResult; +import static com.vmware.taurus.RepositoryUtil.getTimeAccurateToMicroSecond; + @ExtendWith(SpringExtension.class) @SpringBootTest(classes = ControlplaneApplication.class) public class JobExecutionServiceUpdateExecutionIT { @@ -234,7 +236,7 @@ private KubernetesService.JobExecution createJobExecution( .resourcesMemoryLimit(1) .resourcesMemoryRequest(1) .deployedBy("test_deployed_by") - .deployedDate(OffsetDateTime.now().truncatedTo(ChronoUnit.MICROS)) + .deployedDate(getTimeAccurateToMicroSecond()) .podTerminationMessage(terminationMessage) .containerTerminationReason(containerTerminationMessage) .build(); @@ -257,8 +259,8 @@ private void testUpdateJobExecution( actualDataJob, actualExecutionSucceeded, actualTerminationMessage, - OffsetDateTime.now().truncatedTo(ChronoUnit.MICROS), - OffsetDateTime.now().truncatedTo(ChronoUnit.MICROS), + getTimeAccurateToMicroSecond(), + getTimeAccurateToMicroSecond(), ""); DataJobExecution actualJobExecution = jobExecutionService.readJobExecution( diff --git a/projects/control-service/projects/pipelines_control_service/src/test/java/com/vmware/taurus/service/graphql/ExecutionDataFetcherFindAllAndBuildResponseIT.java b/projects/control-service/projects/pipelines_control_service/src/test/java/com/vmware/taurus/service/graphql/ExecutionDataFetcherFindAllAndBuildResponseIT.java index 9db08d465e..60eb5cdb1c 100644 --- a/projects/control-service/projects/pipelines_control_service/src/test/java/com/vmware/taurus/service/graphql/ExecutionDataFetcherFindAllAndBuildResponseIT.java +++ b/projects/control-service/projects/pipelines_control_service/src/test/java/com/vmware/taurus/service/graphql/ExecutionDataFetcherFindAllAndBuildResponseIT.java @@ -31,6 +31,7 @@ import java.util.List; import java.util.Map; +import static com.vmware.taurus.RepositoryUtil.getTimeAccurateToMicroSecond; import static com.vmware.taurus.service.graphql.model.DataJobExecutionQueryVariables.FILTER_FIELD; import static com.vmware.taurus.service.graphql.model.DataJobExecutionQueryVariables.ORDER_FIELD; import static com.vmware.taurus.service.graphql.model.DataJobExecutionQueryVariables.PAGE_NUMBER_FIELD; @@ -128,7 +129,7 @@ public void testFindAllAndBuildResponse_filerByStatusIn_shouldReturnResult() thr public void testFindAllAndBuildResponse_filerByStartTimeGte_shouldReturnResult() throws Exception { DataJob actualDataJob = RepositoryUtil.createDataJob(jobsRepository); - OffsetDateTime now = OffsetDateTime.now().truncatedTo(ChronoUnit.MICROS); + OffsetDateTime now = getTimeAccurateToMicroSecond(); RepositoryUtil.createDataJobExecution( jobExecutionRepository, @@ -175,7 +176,7 @@ public void testFindAllAndBuildResponse_filerByStartTimeGte_shouldReturnResult() @Test public void testFindAllAndBuildResponse_filerByEndTimeGte_shouldReturnResult() throws Exception { DataJob actualDataJob = RepositoryUtil.createDataJob(jobsRepository); - OffsetDateTime now = OffsetDateTime.now().truncatedTo(ChronoUnit.MICROS); + OffsetDateTime now = getTimeAccurateToMicroSecond(); RepositoryUtil.createDataJobExecution( jobExecutionRepository, @@ -225,7 +226,7 @@ public void testFindAllAndBuildResponse_filerByEndTimeGte_shouldReturnResult() t @Test public void testFindAllAndBuildResponse_filerByAllFields_shouldReturnResult() throws Exception { DataJob actualDataJob = RepositoryUtil.createDataJob(jobsRepository); - OffsetDateTime now = OffsetDateTime.now().truncatedTo(ChronoUnit.MICROS); + OffsetDateTime now = getTimeAccurateToMicroSecond(); RepositoryUtil.createDataJobExecution( jobExecutionRepository, @@ -471,7 +472,7 @@ public void testFindAllAndBuildResponse_filterByJobName_shouldReturnResult() thr DataJob actualDataJob = RepositoryUtil.createDataJob(jobsRepository, "job-one"); DataJob actualDataJob2 = RepositoryUtil.createDataJob(jobsRepository, "job-two"); - OffsetDateTime now = OffsetDateTime.now().truncatedTo(ChronoUnit.MICROS); + OffsetDateTime now = getTimeAccurateToMicroSecond(); var expectedExecution = RepositoryUtil.createDataJobExecution( @@ -506,7 +507,7 @@ public void testFindAllAndBuildResponse_filterByEndTimeLte_shouldNotReturnResult throws Exception { DataJob actualDataJob = RepositoryUtil.createDataJob(jobsRepository); - OffsetDateTime now = OffsetDateTime.now().truncatedTo(ChronoUnit.MICROS); + OffsetDateTime now = getTimeAccurateToMicroSecond(); RepositoryUtil.createDataJobExecution( jobExecutionRepository, @@ -525,7 +526,7 @@ public void testFindAllAndBuildResponse_filterByEndTimeLte_shouldNotReturnResult when(dataFetchingEnvironment.getArguments()).thenReturn(Map.of(FILTER_FIELD, filterRaw)); when(filterRaw.get(DataJobExecutionFilter.END_TIME_LTE_FIELD)) - .thenReturn(OffsetDateTime.now().truncatedTo(ChronoUnit.MICROS).minusDays(2)); + .thenReturn(getTimeAccurateToMicroSecond().minusDays(2)); DataFetcher allAndBuildResponse = executionDataFetcher.findAllAndBuildResponse(); DataJobPage response = (DataJobPage) allAndBuildResponse.get(dataFetchingEnvironment); @@ -538,7 +539,7 @@ public void testFindAllAndBuildResponse_filterByEndTimeLte_shouldNotReturnResult public void testFindAllAndBuildResponse_filterByEndTimeLte_shouldReturnResult() throws Exception { DataJob actualDataJob = RepositoryUtil.createDataJob(jobsRepository); - OffsetDateTime now = OffsetDateTime.now().truncatedTo(ChronoUnit.MICROS); + OffsetDateTime now = getTimeAccurateToMicroSecond(); RepositoryUtil.createDataJobExecution( jobExecutionRepository, @@ -558,7 +559,7 @@ public void testFindAllAndBuildResponse_filterByEndTimeLte_shouldReturnResult() when(dataFetchingEnvironment.getArguments()).thenReturn(Map.of(FILTER_FIELD, filterRaw)); when(filterRaw.get(DataJobExecutionFilter.END_TIME_LTE_FIELD)) - .thenReturn(OffsetDateTime.now().truncatedTo(ChronoUnit.MICROS).minusDays(2)); + .thenReturn(getTimeAccurateToMicroSecond().minusDays(2)); DataFetcher allAndBuildResponse = executionDataFetcher.findAllAndBuildResponse(); DataJobPage response = (DataJobPage) allAndBuildResponse.get(dataFetchingEnvironment); @@ -573,7 +574,7 @@ public void testFindAllAndBuildResponse_filterByStartTimeLte_shouldNotReturnResu throws Exception { DataJob actualDataJob = RepositoryUtil.createDataJob(jobsRepository); - OffsetDateTime now = OffsetDateTime.now().truncatedTo(ChronoUnit.MICROS); + OffsetDateTime now = getTimeAccurateToMicroSecond(); RepositoryUtil.createDataJobExecution( jobExecutionRepository, @@ -592,7 +593,7 @@ public void testFindAllAndBuildResponse_filterByStartTimeLte_shouldNotReturnResu when(dataFetchingEnvironment.getArguments()).thenReturn(Map.of(FILTER_FIELD, filterRaw)); when(filterRaw.get(DataJobExecutionFilter.START_TIME_LTE_FIELD)) - .thenReturn(OffsetDateTime.now().truncatedTo(ChronoUnit.MICROS).minusDays(4)); + .thenReturn(getTimeAccurateToMicroSecond().minusDays(4)); DataFetcher allAndBuildResponse = executionDataFetcher.findAllAndBuildResponse(); DataJobPage response = (DataJobPage) allAndBuildResponse.get(dataFetchingEnvironment); @@ -606,7 +607,7 @@ public void testFindAllAndBuildResponse_filterByStartTimeLte_shouldReturnResult( throws Exception { DataJob actualDataJob = RepositoryUtil.createDataJob(jobsRepository); - OffsetDateTime now = OffsetDateTime.now().truncatedTo(ChronoUnit.MICROS); + OffsetDateTime now = getTimeAccurateToMicroSecond(); RepositoryUtil.createDataJobExecution( jobExecutionRepository, @@ -626,7 +627,7 @@ public void testFindAllAndBuildResponse_filterByStartTimeLte_shouldReturnResult( when(dataFetchingEnvironment.getArguments()).thenReturn(Map.of(FILTER_FIELD, filterRaw)); when(filterRaw.get(DataJobExecutionFilter.START_TIME_LTE_FIELD)) - .thenReturn(OffsetDateTime.now().truncatedTo(ChronoUnit.MICROS).minusDays(2)); + .thenReturn(getTimeAccurateToMicroSecond().minusDays(2)); DataFetcher allAndBuildResponse = executionDataFetcher.findAllAndBuildResponse(); DataJobPage response = (DataJobPage) allAndBuildResponse.get(dataFetchingEnvironment); diff --git a/projects/control-service/projects/pipelines_control_service/src/test/java/com/vmware/taurus/service/monitoring/DataJobMonitorTest.java b/projects/control-service/projects/pipelines_control_service/src/test/java/com/vmware/taurus/service/monitoring/DataJobMonitorTest.java index abcc086dac..8c876e3710 100644 --- a/projects/control-service/projects/pipelines_control_service/src/test/java/com/vmware/taurus/service/monitoring/DataJobMonitorTest.java +++ b/projects/control-service/projects/pipelines_control_service/src/test/java/com/vmware/taurus/service/monitoring/DataJobMonitorTest.java @@ -34,6 +34,7 @@ import java.util.Optional; import java.util.UUID; +import static com.vmware.taurus.RepositoryUtil.getTimeAccurateToMicroSecond; import static org.mockito.ArgumentMatchers.any; import static org.mockito.ArgumentMatchers.anyLong; import static org.mockito.ArgumentMatchers.anyMap; @@ -844,8 +845,8 @@ private static JobExecution buildJobExecutionStatus( executionId, terminationMessage, executionSucceeded, - OffsetDateTime.now().truncatedTo(ChronoUnit.MICROS), - OffsetDateTime.now().truncatedTo(ChronoUnit.MICROS)); + getTimeAccurateToMicroSecond(), + getTimeAccurateToMicroSecond()); } private static JobExecution buildJobExecutionStatus( @@ -869,7 +870,7 @@ private static JobExecution buildJobExecutionStatus( .resourcesCpuLimit(2F) .resourcesMemoryRequest(500) .resourcesMemoryLimit(1000) - .deployedDate(OffsetDateTime.now().truncatedTo(ChronoUnit.MICROS)) + .deployedDate(getTimeAccurateToMicroSecond()) .deployedBy("lastDeployedBy") .succeeded(executionSucceeded) .build(); From 3088b50d74be2e3f84cc7c42d1ded97f5617073a Mon Sep 17 00:00:00 2001 From: github-actions <> Date: Wed, 25 Jan 2023 13:17:43 +0000 Subject: [PATCH 50/56] Google Java Format --- .../java/com/vmware/taurus/service/JobExecutionRepositoryIT.java | 1 - .../service/execution/JobExecutionServiceUpdateExecutionIT.java | 1 - .../graphql/ExecutionDataFetcherFindAllAndBuildResponseIT.java | 1 - .../com/vmware/taurus/service/monitoring/DataJobMonitorTest.java | 1 - 4 files changed, 4 deletions(-) diff --git a/projects/control-service/projects/pipelines_control_service/src/test/java/com/vmware/taurus/service/JobExecutionRepositoryIT.java b/projects/control-service/projects/pipelines_control_service/src/test/java/com/vmware/taurus/service/JobExecutionRepositoryIT.java index 3ed16b379b..db144d637e 100644 --- a/projects/control-service/projects/pipelines_control_service/src/test/java/com/vmware/taurus/service/JobExecutionRepositoryIT.java +++ b/projects/control-service/projects/pipelines_control_service/src/test/java/com/vmware/taurus/service/JobExecutionRepositoryIT.java @@ -21,7 +21,6 @@ import java.time.OffsetDateTime; import java.time.ZoneOffset; -import java.time.temporal.ChronoUnit; import java.util.List; import static com.vmware.taurus.RepositoryUtil.getTimeAccurateToMicroSecond; diff --git a/projects/control-service/projects/pipelines_control_service/src/test/java/com/vmware/taurus/service/execution/JobExecutionServiceUpdateExecutionIT.java b/projects/control-service/projects/pipelines_control_service/src/test/java/com/vmware/taurus/service/execution/JobExecutionServiceUpdateExecutionIT.java index e2a4999cb6..ecfc69a100 100644 --- a/projects/control-service/projects/pipelines_control_service/src/test/java/com/vmware/taurus/service/execution/JobExecutionServiceUpdateExecutionIT.java +++ b/projects/control-service/projects/pipelines_control_service/src/test/java/com/vmware/taurus/service/execution/JobExecutionServiceUpdateExecutionIT.java @@ -7,7 +7,6 @@ import java.time.Duration; import java.time.OffsetDateTime; -import java.time.temporal.ChronoUnit; import java.util.Random; import com.google.gson.JsonObject; diff --git a/projects/control-service/projects/pipelines_control_service/src/test/java/com/vmware/taurus/service/graphql/ExecutionDataFetcherFindAllAndBuildResponseIT.java b/projects/control-service/projects/pipelines_control_service/src/test/java/com/vmware/taurus/service/graphql/ExecutionDataFetcherFindAllAndBuildResponseIT.java index 60eb5cdb1c..7652d925e5 100644 --- a/projects/control-service/projects/pipelines_control_service/src/test/java/com/vmware/taurus/service/graphql/ExecutionDataFetcherFindAllAndBuildResponseIT.java +++ b/projects/control-service/projects/pipelines_control_service/src/test/java/com/vmware/taurus/service/graphql/ExecutionDataFetcherFindAllAndBuildResponseIT.java @@ -26,7 +26,6 @@ import org.springframework.boot.test.context.SpringBootTest; import java.time.OffsetDateTime; -import java.time.temporal.ChronoUnit; import java.util.Collections; import java.util.List; import java.util.Map; diff --git a/projects/control-service/projects/pipelines_control_service/src/test/java/com/vmware/taurus/service/monitoring/DataJobMonitorTest.java b/projects/control-service/projects/pipelines_control_service/src/test/java/com/vmware/taurus/service/monitoring/DataJobMonitorTest.java index 8c876e3710..7c9da27514 100644 --- a/projects/control-service/projects/pipelines_control_service/src/test/java/com/vmware/taurus/service/monitoring/DataJobMonitorTest.java +++ b/projects/control-service/projects/pipelines_control_service/src/test/java/com/vmware/taurus/service/monitoring/DataJobMonitorTest.java @@ -27,7 +27,6 @@ import java.time.Duration; import java.time.OffsetDateTime; import java.time.ZoneOffset; -import java.time.temporal.ChronoUnit; import java.util.Arrays; import java.util.Collections; import java.util.List; From 0763585554e129f6a89f78a1bc89320a614b16c6 Mon Sep 17 00:00:00 2001 From: murphp15 Date: Wed, 25 Jan 2023 13:47:40 +0000 Subject: [PATCH 51/56] control-service: fix release Signed-off-by: murphp15 --- projects/control-service/cicd/.gitlab-ci.yml | 42 ++++++++------------ 1 file changed, 16 insertions(+), 26 deletions(-) diff --git a/projects/control-service/cicd/.gitlab-ci.yml b/projects/control-service/cicd/.gitlab-ci.yml index 07c0911ffb..14792f6049 100644 --- a/projects/control-service/cicd/.gitlab-ci.yml +++ b/projects/control-service/cicd/.gitlab-ci.yml @@ -252,14 +252,10 @@ control_service_deploy_testing_data_pipelines: - curl https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3 | bash - bash -ex ./projects/control-service/cicd/deploy-testing-pipelines-service.sh retry: !reference [.control_service_retry, retry_options] - rules: - - if: '$CI_COMMIT_BRANCH == "main"' - changes: [ projects/control-service/projects/helm_charts/pipelines-control-service/version.txt ] - when: never - - if: '$CI_COMMIT_BRANCH == "main"' - changes: *control_service_code_change_locations - - if: '$CI_COMMIT_BRANCH == "main"' - changes: *control_service_helm_change_locations + only: + refs: + # TODO revert before merging + - external_pull_requests # vdk-heartbeat source: https://github.com/vmware/versatile-data-kit/tree/main/projects/vdk-heartbeat control_service_post_deployment_test: @@ -274,14 +270,10 @@ control_service_post_deployment_test: - export VDK_HEARTBEAT_OP_ID="vdkcs-$CI_PIPELINE_ID" - vdk-heartbeat -f projects/control-service/cicd/post_deploy_test_heartbeat_config.ini retry: !reference [.control_service_retry, retry_options] - rules: - - if: '$CI_COMMIT_BRANCH == "main"' - changes: [ projects/control-service/projects/helm_charts/pipelines-control-service/version.txt ] - when: never - - if: '$CI_COMMIT_BRANCH == "main"' - changes: *control_service_code_change_locations - - if: '$CI_COMMIT_BRANCH == "main"' - changes: *control_service_helm_change_locations + only: + refs: + # TODO revert before merging + - external_pull_requests control_service_release: image: docker:20.10.22 @@ -298,11 +290,10 @@ control_service_release: - cd projects/control-service/projects/helm_charts - bash -ex ../../cicd/release-pipelines-service.sh retry: !reference [.control_service_retry, retry_options] - rules: - - if: '$CI_COMMIT_BRANCH == "main"' - changes: *control_service_code_change_locations - - if: '$CI_COMMIT_BRANCH == "main"' - changes: *control_service_helm_change_locations + only: + refs: + # TODO revert before merging + - external_pull_requests # TODO: automatically rebuild image on vdk-heartbeat change control_service_vdk_heartbeat_release: @@ -318,8 +309,7 @@ control_service_vdk_heartbeat_release: - docker build --tag $VDK_HEARTBEAT_IMAGE_NAME -f Dockerfile.vdk.heartbeat . - docker push $VDK_HEARTBEAT_IMAGE_NAME retry: !reference [.control_service_retry, retry_options] - rules: - - if: '$CI_COMMIT_BRANCH == "main"' - changes: *control_service_code_change_locations - - if: '$CI_COMMIT_BRANCH == "main"' - changes: *control_service_helm_change_locations + only: + refs: + # TODO revert before merging + - external_pull_requests From f7aed78bcf624165c4d2bef3fb8218fb5e1c8691 Mon Sep 17 00:00:00 2001 From: murphp15 Date: Wed, 25 Jan 2023 14:01:36 +0000 Subject: [PATCH 52/56] control-service: fix release Signed-off-by: murphp15 --- projects/control-service/cicd/.gitlab-ci.yml | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/projects/control-service/cicd/.gitlab-ci.yml b/projects/control-service/cicd/.gitlab-ci.yml index 14792f6049..b2fe45a62f 100644 --- a/projects/control-service/cicd/.gitlab-ci.yml +++ b/projects/control-service/cicd/.gitlab-ci.yml @@ -290,10 +290,11 @@ control_service_release: - cd projects/control-service/projects/helm_charts - bash -ex ../../cicd/release-pipelines-service.sh retry: !reference [.control_service_retry, retry_options] - only: - refs: - # TODO revert before merging - - external_pull_requests + rules: + - if: '$CI_COMMIT_BRANCH == "main"' + changes: *control_service_code_change_locations + - if: '$CI_COMMIT_BRANCH == "main"' + changes: *control_service_helm_change_locations # TODO: automatically rebuild image on vdk-heartbeat change control_service_vdk_heartbeat_release: @@ -309,7 +310,8 @@ control_service_vdk_heartbeat_release: - docker build --tag $VDK_HEARTBEAT_IMAGE_NAME -f Dockerfile.vdk.heartbeat . - docker push $VDK_HEARTBEAT_IMAGE_NAME retry: !reference [.control_service_retry, retry_options] - only: - refs: - # TODO revert before merging - - external_pull_requests + rules: + - if: '$CI_COMMIT_BRANCH == "main"' + changes: *control_service_code_change_locations + - if: '$CI_COMMIT_BRANCH == "main"' + changes: *control_service_helm_change_locations From dafc28f04ea4f6c5d37e25368930260a98403ff3 Mon Sep 17 00:00:00 2001 From: murphp15 Date: Wed, 25 Jan 2023 14:27:02 +0000 Subject: [PATCH 53/56] control-service: only delete file in test path Signed-off-by: murphp15 --- .../vmware/taurus/graphql/it/GraphQLExecutionsLogsUrlIT.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/projects/control-service/projects/pipelines_control_service/src/integration-test/java/com/vmware/taurus/graphql/it/GraphQLExecutionsLogsUrlIT.java b/projects/control-service/projects/pipelines_control_service/src/integration-test/java/com/vmware/taurus/graphql/it/GraphQLExecutionsLogsUrlIT.java index 7edd1f5d5f..88d2c63c74 100644 --- a/projects/control-service/projects/pipelines_control_service/src/integration-test/java/com/vmware/taurus/graphql/it/GraphQLExecutionsLogsUrlIT.java +++ b/projects/control-service/projects/pipelines_control_service/src/integration-test/java/com/vmware/taurus/graphql/it/GraphQLExecutionsLogsUrlIT.java @@ -13,6 +13,7 @@ import java.text.MessageFormat; import java.time.OffsetDateTime; +import java.time.temporal.ChronoUnit; import java.util.List; import org.hamcrest.Matchers; @@ -133,7 +134,7 @@ public void testExecutions_filterByStartTimeGte() throws Exception { "{" + "\"filter\": {" + " \"startTimeGte\": \"" - + getTimeAccurateToMicroSecond() + + dataJobExecution3.getStartTime().truncatedTo(ChronoUnit.MICROS) + "\"" + " }," + "\"pageNumber\": 1," From 7f48c6aefca22d2342729b94b3a1b21688af471b Mon Sep 17 00:00:00 2001 From: github-actions <> Date: Wed, 25 Jan 2023 14:32:34 +0000 Subject: [PATCH 54/56] Google Java Format --- .../com/vmware/taurus/graphql/it/GraphQLExecutionsLogsUrlIT.java | 1 - 1 file changed, 1 deletion(-) diff --git a/projects/control-service/projects/pipelines_control_service/src/integration-test/java/com/vmware/taurus/graphql/it/GraphQLExecutionsLogsUrlIT.java b/projects/control-service/projects/pipelines_control_service/src/integration-test/java/com/vmware/taurus/graphql/it/GraphQLExecutionsLogsUrlIT.java index 88d2c63c74..ee75b7a133 100644 --- a/projects/control-service/projects/pipelines_control_service/src/integration-test/java/com/vmware/taurus/graphql/it/GraphQLExecutionsLogsUrlIT.java +++ b/projects/control-service/projects/pipelines_control_service/src/integration-test/java/com/vmware/taurus/graphql/it/GraphQLExecutionsLogsUrlIT.java @@ -5,7 +5,6 @@ package com.vmware.taurus.graphql.it; -import static com.vmware.taurus.datajobs.it.common.JobExecutionUtil.getTimeAccurateToMicroSecond; import static org.springframework.security.test.web.servlet.request.SecurityMockMvcRequestPostProcessors.user; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.content; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath; From 36c2a030df8b5f97270904ec3a6f9d5ccdc414a6 Mon Sep 17 00:00:00 2001 From: murphp15 Date: Wed, 25 Jan 2023 15:23:23 +0000 Subject: [PATCH 55/56] control-service: fix release Signed-off-by: murphp15 --- projects/control-service/cicd/.gitlab-ci.yml | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/projects/control-service/cicd/.gitlab-ci.yml b/projects/control-service/cicd/.gitlab-ci.yml index 98419a1a63..ebcbde9e86 100644 --- a/projects/control-service/cicd/.gitlab-ci.yml +++ b/projects/control-service/cicd/.gitlab-ci.yml @@ -209,14 +209,10 @@ control_service_publish_image: when: always reports: junit: ./projects/control-serviceprojects/**/build/test-results/test/TEST-*.xml - rules: - - if: '$CI_COMMIT_BRANCH == "main"' - changes: [ projects/control-service/projects/helm_charts/pipelines-control-service/version.txt ] - when: never - - if: '$CI_COMMIT_BRANCH == "main"' - changes: *control_service_code_change_locations - - if: '$CI_COMMIT_BRANCH == "main"' - changes: *control_service_helm_change_locations + only: + refs: + # TODO revert before merging + - external_pull_requests control_service_publish_api_client: image: docker:20.10.22 From e8c96aed5cfb5cf564d61309fb8064b3d9df7a53 Mon Sep 17 00:00:00 2001 From: murphp15 Date: Wed, 25 Jan 2023 15:58:20 +0000 Subject: [PATCH 56/56] control-service: fix release Signed-off-by: murphp15 --- projects/control-service/cicd/.gitlab-ci.yml | 36 +++++++++++++------- 1 file changed, 24 insertions(+), 12 deletions(-) diff --git a/projects/control-service/cicd/.gitlab-ci.yml b/projects/control-service/cicd/.gitlab-ci.yml index ebcbde9e86..4130411fe6 100644 --- a/projects/control-service/cicd/.gitlab-ci.yml +++ b/projects/control-service/cicd/.gitlab-ci.yml @@ -209,10 +209,14 @@ control_service_publish_image: when: always reports: junit: ./projects/control-serviceprojects/**/build/test-results/test/TEST-*.xml - only: - refs: - # TODO revert before merging - - external_pull_requests + rules: + - if: '$CI_COMMIT_BRANCH == "main"' + changes: [ projects/control-service/projects/helm_charts/pipelines-control-service/version.txt ] + when: never + - if: '$CI_COMMIT_BRANCH == "main"' + changes: *control_service_code_change_locations + - if: '$CI_COMMIT_BRANCH == "main"' + changes: *control_service_helm_change_locations control_service_publish_api_client: image: docker:20.10.22 @@ -248,10 +252,14 @@ control_service_deploy_testing_data_pipelines: - curl https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3 | bash - bash -ex ./projects/control-service/cicd/deploy-testing-pipelines-service.sh retry: !reference [.control_service_retry, retry_options] - only: - refs: - # TODO revert before merging - - external_pull_requests + rules: + - if: '$CI_COMMIT_BRANCH == "main"' + changes: [ projects/control-service/projects/helm_charts/pipelines-control-service/version.txt ] + when: never + - if: '$CI_COMMIT_BRANCH == "main"' + changes: *control_service_code_change_locations + - if: '$CI_COMMIT_BRANCH == "main"' + changes: *control_service_helm_change_locations # vdk-heartbeat source: https://github.com/vmware/versatile-data-kit/tree/main/projects/vdk-heartbeat control_service_post_deployment_test: @@ -266,10 +274,14 @@ control_service_post_deployment_test: - export VDK_HEARTBEAT_OP_ID="vdkcs-$CI_PIPELINE_ID" - vdk-heartbeat -f projects/control-service/cicd/post_deploy_test_heartbeat_config.ini retry: !reference [.control_service_retry, retry_options] - only: - refs: - # TODO revert before merging - - external_pull_requests + rules: + - if: '$CI_COMMIT_BRANCH == "main"' + changes: [ projects/control-service/projects/helm_charts/pipelines-control-service/version.txt ] + when: never + - if: '$CI_COMMIT_BRANCH == "main"' + changes: *control_service_code_change_locations + - if: '$CI_COMMIT_BRANCH == "main"' + changes: *control_service_helm_change_locations control_service_release: image: docker:20.10.22