From 5477f443b28d9db94b37b7cf93162a9ad53aaccc Mon Sep 17 00:00:00 2001 From: Max Cao Date: Thu, 20 Oct 2022 16:29:01 -0400 Subject: [PATCH 01/20] update ci with broken-up jobs --- .github/workflows/ci.yaml | 57 +++++++++++++++++++++++++++++++++++---- 1 file changed, 52 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 5ca452d5b3..4509e185f6 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -54,12 +54,10 @@ jobs: - uses: skjolber/maven-cache-github-action@v1 with: step: save - - build: + + build-image: runs-on: ubuntu-latest needs: [get-pom-properties, build-deps] - env: - CRYOSTAT_IMG: quay.io/cryostat/cryostat steps: - uses: actions/checkout@v2 with: @@ -78,10 +76,59 @@ jobs: path: /home/runner/.m2/repository/io/cryostat/cryostat-core/ - run: git submodule init - run: git submodule update --remote - - run: mvn -B -U clean verify + - run: mvn -B -U clean package + - run: podman save -o cryostat.tar --format oci-archive cryostat:latest + - uses: actions/upload-artifact@v2 + with: + name: cryostat + path: cryostat.tar + + integration-tests: + runs-on: ubuntu-latest + needs: [build-image] + steps: + - uses: actions/download-artifact@v2 + with: + name: cryostat + path: cryostat.tar + - run: podman load -i cryostat.tar + - run: bash repeated-integration-tests.bash - name: Print itest logs if: ${{ failure() }} run: ls -1dt target/cryostat-itest-*.log | head -n1 | xargs cat + + spotless: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + with: + submodules: true + fetch-depth: 0 + - uses: actions/setup-java@v2 + with: + java-version: '17' + distribution: 'adopt' + - run: mvn spotless:check + + spotbugs: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + with: + submodules: true + fetch-depth: 0 + - uses: actions/setup-java@v2 + with: + java-version: '17' + distribution: 'adopt' + - run: mvn spotbugs:check + + build: + runs-on: ubuntu-latest + needs: [integration-tests, spotless, spotbugs] + env: + CRYOSTAT_IMG: quay.io/cryostat/cryostat + steps: - name: Tag images id: tag-image env: From 1705ea3ed911686bbc38c4949f0c172785f47d69 Mon Sep 17 00:00:00 2001 From: Max Cao Date: Thu, 20 Oct 2022 17:10:14 -0400 Subject: [PATCH 02/20] mvn caching in jobs --- .github/workflows/ci.yaml | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 4509e185f6..68d5026126 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -82,23 +82,37 @@ jobs: with: name: cryostat path: cryostat.tar + - uses: skjolber/maven-cache-github-action@v1 + with: + step: save integration-tests: runs-on: ubuntu-latest needs: [build-image] steps: + - uses: actions/setup-java@v2 + with: + java-version: '17' + distribution: 'adopt' - uses: actions/download-artifact@v2 with: name: cryostat path: cryostat.tar - run: podman load -i cryostat.tar + - uses: skjolber/maven-cache-github-action@v1 + with: + step: restore - run: bash repeated-integration-tests.bash - name: Print itest logs if: ${{ failure() }} run: ls -1dt target/cryostat-itest-*.log | head -n1 | xargs cat + - uses: skjolber/maven-cache-github-action@v1 + with: + step: save spotless: runs-on: ubuntu-latest + needs: [build-deps] steps: - uses: actions/checkout@v2 with: @@ -108,10 +122,17 @@ jobs: with: java-version: '17' distribution: 'adopt' + - uses: skjolber/maven-cache-github-action@v1 + with: + step: restore - run: mvn spotless:check + - uses: skjolber/maven-cache-github-action@v1 + with: + step: save spotbugs: runs-on: ubuntu-latest + needs: [build-deps] steps: - uses: actions/checkout@v2 with: @@ -121,7 +142,13 @@ jobs: with: java-version: '17' distribution: 'adopt' + - uses: skjolber/maven-cache-github-action@v1 + with: + step: restore - run: mvn spotbugs:check + - uses: skjolber/maven-cache-github-action@v1 + with: + step: save build: runs-on: ubuntu-latest From d53108dfcd65f04fbd702731e07e6cf51e66db4c Mon Sep 17 00:00:00 2001 From: Max Cao Date: Thu, 20 Oct 2022 18:12:17 -0400 Subject: [PATCH 03/20] try unzipping first, upgrade actions/download|upload to v3 --- .github/workflows/ci.yaml | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 68d5026126..e17ed168c5 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -47,7 +47,7 @@ jobs: with: step: restore - run: mvn -B -U -DskipTests=true clean install - - uses: actions/upload-artifact@v2 + - uses: actions/upload-artifact@v3 with: name: cryostat-core path: /home/runner/.m2/repository/io/cryostat/cryostat-core/ @@ -70,7 +70,7 @@ jobs: - uses: skjolber/maven-cache-github-action@v1 with: step: restore - - uses: actions/download-artifact@v2 + - uses: actions/download-artifact@v3 with: name: cryostat-core path: /home/runner/.m2/repository/io/cryostat/cryostat-core/ @@ -78,7 +78,7 @@ jobs: - run: git submodule update --remote - run: mvn -B -U clean package - run: podman save -o cryostat.tar --format oci-archive cryostat:latest - - uses: actions/upload-artifact@v2 + - uses: actions/upload-artifact@v3 with: name: cryostat path: cryostat.tar @@ -94,10 +94,14 @@ jobs: with: java-version: '17' distribution: 'adopt' - - uses: actions/download-artifact@v2 + - uses: actions/download-artifact@v3 with: name: cryostat path: cryostat.tar + - uses: montudor/action-zip@v1 + with: + args: unzip -qq cryostat.tar.zip -d cryostat.tar + - run: ls - run: podman load -i cryostat.tar - uses: skjolber/maven-cache-github-action@v1 with: From 97f1af848234621ac2c60147b1d4f18bcf926930 Mon Sep 17 00:00:00 2001 From: Max Cao Date: Thu, 20 Oct 2022 18:19:34 -0400 Subject: [PATCH 04/20] use fully qualified image name, and test spotbugs and spotless jobs --- .github/workflows/ci.yaml | 2 +- .../io/cryostat/recordings/RecordingArchiveHelper.java | 7 ------- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index e17ed168c5..cc2d7dd311 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -77,7 +77,7 @@ jobs: - run: git submodule init - run: git submodule update --remote - run: mvn -B -U clean package - - run: podman save -o cryostat.tar --format oci-archive cryostat:latest + - run: podman save -o cryostat.tar --format oci-archive quay.io/cryostat/cryostat - uses: actions/upload-artifact@v3 with: name: cryostat diff --git a/src/main/java/io/cryostat/recordings/RecordingArchiveHelper.java b/src/main/java/io/cryostat/recordings/RecordingArchiveHelper.java index f6e7a955f8..305557f53e 100644 --- a/src/main/java/io/cryostat/recordings/RecordingArchiveHelper.java +++ b/src/main/java/io/cryostat/recordings/RecordingArchiveHelper.java @@ -980,13 +980,6 @@ private long getFileSize(String recordingName) { } } - // FIXME: override equals() so that tests are easier to write - @SuppressFBWarnings( - value = "EI_EXPOSE_REP2", - justification = - "This class is never used by the client and is not stored, it is simply" - + " constructed upon request so it wouldn't matter even if somehow the List" - + " was modified") public static class ArchiveDirectory { private final String connectUrl; private final String jvmId; From 8ef5feccb7144dcfca3fd1c4b5128c2890deb53c Mon Sep 17 00:00:00 2001 From: Max Cao Date: Thu, 20 Oct 2022 18:32:11 -0400 Subject: [PATCH 05/20] remove unzip, try using full path? --- .github/workflows/ci.yaml | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index cc2d7dd311..952d25c445 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -81,7 +81,7 @@ jobs: - uses: actions/upload-artifact@v3 with: name: cryostat - path: cryostat.tar + path: /home/runner/work/cryostat/cryostat/cryostat.tar - uses: skjolber/maven-cache-github-action@v1 with: step: save @@ -97,10 +97,7 @@ jobs: - uses: actions/download-artifact@v3 with: name: cryostat - path: cryostat.tar - - uses: montudor/action-zip@v1 - with: - args: unzip -qq cryostat.tar.zip -d cryostat.tar + path: /home/runner/work/cryostat/cryostat/cryostat.tar - run: ls - run: podman load -i cryostat.tar - uses: skjolber/maven-cache-github-action@v1 From dcd816282089cb9e1de166e0e3aaf24c02b3adf1 Mon Sep 17 00:00:00 2001 From: Max Cao Date: Thu, 20 Oct 2022 18:38:58 -0400 Subject: [PATCH 06/20] test --- .github/workflows/ci.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 952d25c445..2cafd08c9e 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -97,7 +97,6 @@ jobs: - uses: actions/download-artifact@v3 with: name: cryostat - path: /home/runner/work/cryostat/cryostat/cryostat.tar - run: ls - run: podman load -i cryostat.tar - uses: skjolber/maven-cache-github-action@v1 From 37d41a51a1924c9d30d02bbf32c029c76a7e736b Mon Sep 17 00:00:00 2001 From: Max Cao Date: Thu, 20 Oct 2022 18:42:16 -0400 Subject: [PATCH 07/20] rebase and test --- .../java/io/cryostat/recordings/RecordingArchiveHelper.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/main/java/io/cryostat/recordings/RecordingArchiveHelper.java b/src/main/java/io/cryostat/recordings/RecordingArchiveHelper.java index 305557f53e..c825662bfd 100644 --- a/src/main/java/io/cryostat/recordings/RecordingArchiveHelper.java +++ b/src/main/java/io/cryostat/recordings/RecordingArchiveHelper.java @@ -865,8 +865,7 @@ public void validateSourceTarget(String sourceTarget) } private void validateRecordingPath( - Optional optional, String recordingName, boolean checkConnectUrl) - throws RecordingNotFoundException, ArchivePathException { + Optional optional, String recordingName, boolean checkConnectUrl) throws RecordingNotFoundException, ArchivePathException { if (optional.isEmpty()) { throw new RecordingNotFoundException(ARCHIVES, recordingName); } From c8180f6e2869ddccda8d5f8000a98d11a6782777 Mon Sep 17 00:00:00 2001 From: Max Cao Date: Thu, 20 Oct 2022 18:53:40 -0400 Subject: [PATCH 08/20] spotless works, podman load works, add checkout to integration tests --- .github/workflows/ci.yaml | 9 ++++++++- .../io/cryostat/recordings/RecordingArchiveHelper.java | 3 ++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 2cafd08c9e..ec927b0aa2 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -90,6 +90,12 @@ jobs: runs-on: ubuntu-latest needs: [build-image] steps: + - run: pwd + - run: ls -la + - uses: actions/checkout@v2 + with: + submodules: true + fetch-depth: 0 - uses: actions/setup-java@v2 with: java-version: '17' @@ -97,11 +103,12 @@ jobs: - uses: actions/download-artifact@v3 with: name: cryostat - - run: ls - run: podman load -i cryostat.tar - uses: skjolber/maven-cache-github-action@v1 with: step: restore + - run: ls + - run: pwd - run: bash repeated-integration-tests.bash - name: Print itest logs if: ${{ failure() }} diff --git a/src/main/java/io/cryostat/recordings/RecordingArchiveHelper.java b/src/main/java/io/cryostat/recordings/RecordingArchiveHelper.java index c825662bfd..305557f53e 100644 --- a/src/main/java/io/cryostat/recordings/RecordingArchiveHelper.java +++ b/src/main/java/io/cryostat/recordings/RecordingArchiveHelper.java @@ -865,7 +865,8 @@ public void validateSourceTarget(String sourceTarget) } private void validateRecordingPath( - Optional optional, String recordingName, boolean checkConnectUrl) throws RecordingNotFoundException, ArchivePathException { + Optional optional, String recordingName, boolean checkConnectUrl) + throws RecordingNotFoundException, ArchivePathException { if (optional.isEmpty()) { throw new RecordingNotFoundException(ARCHIVES, recordingName); } From 78d46838730af65a02be25c76790df3b79fe6c9b Mon Sep 17 00:00:00 2001 From: Max Cao Date: Thu, 20 Oct 2022 19:28:03 -0400 Subject: [PATCH 09/20] install xpath and really test spotbugs --- .github/workflows/ci.yaml | 24 +++++++++++++++---- .../recordings/RecordingArchiveHelper.java | 6 ----- 2 files changed, 20 insertions(+), 10 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index ec927b0aa2..0b48455b6e 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -90,8 +90,6 @@ jobs: runs-on: ubuntu-latest needs: [build-image] steps: - - run: pwd - - run: ls -la - uses: actions/checkout@v2 with: submodules: true @@ -100,6 +98,10 @@ jobs: with: java-version: '17' distribution: 'adopt' + - name: install xpath + run: | + sudo apt-get update + sudo apt-get install -y libxml-xpath-perl - uses: actions/download-artifact@v3 with: name: cryostat @@ -107,8 +109,6 @@ jobs: - uses: skjolber/maven-cache-github-action@v1 with: step: restore - - run: ls - - run: pwd - run: bash repeated-integration-tests.bash - name: Print itest logs if: ${{ failure() }} @@ -157,6 +157,22 @@ jobs: with: step: save + shellcheck: + runs-on: ubuntu-latest + needs: [build-deps] + steps: + - uses: actions/checkout@v2 + with: + submodules: true + fetch-depth: 0 + - uses: skjolber/maven-cache-github-action@v1 + with: + step: restore + - run: mvn shellcheck:check + - uses: skjolber/maven-cache-github-action@v1 + with: + step: save + build: runs-on: ubuntu-latest needs: [integration-tests, spotless, spotbugs] diff --git a/src/main/java/io/cryostat/recordings/RecordingArchiveHelper.java b/src/main/java/io/cryostat/recordings/RecordingArchiveHelper.java index 305557f53e..161c1e8c2b 100644 --- a/src/main/java/io/cryostat/recordings/RecordingArchiveHelper.java +++ b/src/main/java/io/cryostat/recordings/RecordingArchiveHelper.java @@ -290,12 +290,6 @@ protected void transferArchivesIfRestarted(String targetId) { } } - @SuppressFBWarnings( - value = "NP_NULL_ON_SOME_PATH_FROM_RETURN_VALUE", - justification = - "SpotBugs false positive. The following checks ensures that the" - + " getFileName() of the Path are not null, barring some exceptional" - + " circumstance like some external filesystem access race.") protected Future getConnectUrlFromPath(Path subdirectory) { CompletableFuture future = new CompletableFuture().orTimeout(FS_TIMEOUT_SECONDS, TimeUnit.SECONDS); From c8011191f809f2407ca92cf53d860f675193e1c9 Mon Sep 17 00:00:00 2001 From: Max Cao Date: Thu, 20 Oct 2022 19:51:46 -0400 Subject: [PATCH 10/20] test shellcheck, copy target to new job runner because spotbugs requires dependency resolution of artifacts in scope: test --- .github/workflows/ci.yaml | 9 +++++---- devserver.sh | 1 - 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 0b48455b6e..56c0d44ad7 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -139,8 +139,11 @@ jobs: spotbugs: runs-on: ubuntu-latest - needs: [build-deps] + needs: [build-image] steps: + - uses: skjolber/maven-cache-github-action@v1 + with: + step: restore - uses: actions/checkout@v2 with: submodules: true @@ -149,9 +152,7 @@ jobs: with: java-version: '17' distribution: 'adopt' - - uses: skjolber/maven-cache-github-action@v1 - with: - step: restore + - run: mvn spotbugs:check - uses: skjolber/maven-cache-github-action@v1 with: diff --git a/devserver.sh b/devserver.sh index 1314b0393c..8cb8446a88 100755 --- a/devserver.sh +++ b/devserver.sh @@ -1,5 +1,4 @@ #!/bin/sh -# shellcheck disable=SC3043 work_dir="$(mktemp -d)" From 2b88cbe24181ea7ee552ee05885ed8f1a820f948 Mon Sep 17 00:00:00 2001 From: Max Cao Date: Thu, 20 Oct 2022 19:55:33 -0400 Subject: [PATCH 11/20] forgot to save --- .github/workflows/ci.yaml | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 56c0d44ad7..a2cecc3ff7 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -82,6 +82,10 @@ jobs: with: name: cryostat path: /home/runner/work/cryostat/cryostat/cryostat.tar + - uses: actions/upload-artifact@v3 + with: + name: cryostat-mvn-target + path: /home/runner/work/cryostat/cryostat/target/ - uses: skjolber/maven-cache-github-action@v1 with: step: save @@ -141,18 +145,21 @@ jobs: runs-on: ubuntu-latest needs: [build-image] steps: - - uses: skjolber/maven-cache-github-action@v1 - with: - step: restore - uses: actions/checkout@v2 with: submodules: true fetch-depth: 0 + - uses: skjolber/maven-cache-github-action@v1 + with: + step: restore - uses: actions/setup-java@v2 with: java-version: '17' distribution: 'adopt' - + - uses: actions/download-artifact@v3 + with: + name: cryostat-mvn-target + path: /home/runner/work/cryostat/cryostat/target/ - run: mvn spotbugs:check - uses: skjolber/maven-cache-github-action@v1 with: From 336e10b1975249a6ddb7a4215045f9e6a92276b0 Mon Sep 17 00:00:00 2001 From: Max Cao Date: Thu, 20 Oct 2022 20:28:32 -0400 Subject: [PATCH 12/20] shellcheck works, spotless works, testing spotbugs by just running mvn compile in a concurrent runner --- .github/workflows/ci.yaml | 11 ++--------- devserver.sh | 1 + 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index a2cecc3ff7..86db0780c3 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -82,10 +82,6 @@ jobs: with: name: cryostat path: /home/runner/work/cryostat/cryostat/cryostat.tar - - uses: actions/upload-artifact@v3 - with: - name: cryostat-mvn-target - path: /home/runner/work/cryostat/cryostat/target/ - uses: skjolber/maven-cache-github-action@v1 with: step: save @@ -156,10 +152,7 @@ jobs: with: java-version: '17' distribution: 'adopt' - - uses: actions/download-artifact@v3 - with: - name: cryostat-mvn-target - path: /home/runner/work/cryostat/cryostat/target/ + - run: mvn compile - run: mvn spotbugs:check - uses: skjolber/maven-cache-github-action@v1 with: @@ -183,7 +176,7 @@ jobs: build: runs-on: ubuntu-latest - needs: [integration-tests, spotless, spotbugs] + needs: [integration-tests, spotless, spotbugs, shellcheck] env: CRYOSTAT_IMG: quay.io/cryostat/cryostat steps: diff --git a/devserver.sh b/devserver.sh index 8cb8446a88..1314b0393c 100755 --- a/devserver.sh +++ b/devserver.sh @@ -1,4 +1,5 @@ #!/bin/sh +# shellcheck disable=SC3043 work_dir="$(mktemp -d)" From 7a166cae6cec353a50b89ba4e0e7cf0ea9513dab Mon Sep 17 00:00:00 2001 From: Max Cao Date: Thu, 20 Oct 2022 20:28:53 -0400 Subject: [PATCH 13/20] fixup --- .github/workflows/ci.yaml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 86db0780c3..d2bbf5fab8 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -152,8 +152,7 @@ jobs: with: java-version: '17' distribution: 'adopt' - - run: mvn compile - - run: mvn spotbugs:check + - run: mvn compile spotbugs:check - uses: skjolber/maven-cache-github-action@v1 with: step: save From 8251ce127c1b834ba6f23ec4f027407d99b40d75 Mon Sep 17 00:00:00 2001 From: Max Cao Date: Thu, 20 Oct 2022 20:40:55 -0400 Subject: [PATCH 14/20] spotbugs works, remove submodule checkout for concurrent jobs --- .github/workflows/ci.yaml | 11 ++- .../recordings/RecordingArchiveHelper.java | 84 ++++++++----------- 2 files changed, 41 insertions(+), 54 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index d2bbf5fab8..63bec89505 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -77,7 +77,8 @@ jobs: - run: git submodule init - run: git submodule update --remote - run: mvn -B -U clean package - - run: podman save -o cryostat.tar --format oci-archive quay.io/cryostat/cryostat + - name: Save cryostat image + run: podman save -o cryostat.tar --format oci-archive quay.io/cryostat/cryostat - uses: actions/upload-artifact@v3 with: name: cryostat @@ -105,7 +106,8 @@ jobs: - uses: actions/download-artifact@v3 with: name: cryostat - - run: podman load -i cryostat.tar + - name: Load cryostat image + run: podman load -i cryostat.tar - uses: skjolber/maven-cache-github-action@v1 with: step: restore @@ -123,7 +125,6 @@ jobs: steps: - uses: actions/checkout@v2 with: - submodules: true fetch-depth: 0 - uses: actions/setup-java@v2 with: @@ -139,11 +140,10 @@ jobs: spotbugs: runs-on: ubuntu-latest - needs: [build-image] + needs: [build-deps] steps: - uses: actions/checkout@v2 with: - submodules: true fetch-depth: 0 - uses: skjolber/maven-cache-github-action@v1 with: @@ -163,7 +163,6 @@ jobs: steps: - uses: actions/checkout@v2 with: - submodules: true fetch-depth: 0 - uses: skjolber/maven-cache-github-action@v1 with: diff --git a/src/main/java/io/cryostat/recordings/RecordingArchiveHelper.java b/src/main/java/io/cryostat/recordings/RecordingArchiveHelper.java index 161c1e8c2b..d35931b304 100644 --- a/src/main/java/io/cryostat/recordings/RecordingArchiveHelper.java +++ b/src/main/java/io/cryostat/recordings/RecordingArchiveHelper.java @@ -81,7 +81,6 @@ import io.cryostat.net.web.WebServer; import io.cryostat.net.web.http.HttpMimeType; import io.cryostat.platform.PlatformClient; -import io.cryostat.recordings.JvmIdHelper.JvmIdGetException; import io.cryostat.recordings.RecordingMetadataManager.Metadata; import io.cryostat.rules.ArchivePathException; import io.cryostat.rules.ArchivedRecordingInfo; @@ -114,7 +113,6 @@ public class RecordingArchiveHelper { public static final String ARCHIVES = "archives"; public static final String UPLOADED_RECORDINGS_SUBDIRECTORY = "uploads"; public static final String DEFAULT_CACHED_REPORT_SUBDIRECTORY = "default"; - public static final String LOST_RECORDINGS_SUBDIRECTORY = "lost"; private static final String CONNECT_URL = "connectUrl"; RecordingArchiveHelper( @@ -144,7 +142,7 @@ public class RecordingArchiveHelper { this.base32 = base32; } - // startup migration for archived recordings + // on startup migration and jvmId transfer method for archived recordings protected void migrate(ExecutorService executor) throws Exception { List subdirectories = fs.listDirectoryChildren(archivedRecordingsPath); List> futures = new ArrayList<>(subdirectories.size()); @@ -152,20 +150,18 @@ protected void migrate(ExecutorService executor) throws Exception { Future future = executor.submit( () -> { - Path subdirectoryPath = null; try { - if (jvmIdHelper.isSpecialDirectory(subdirectoryName)) { - logger.info( - "Skipping archive migration: appears to be a" - + " special location: {}", - subdirectoryName); - return null; - } logger.info( "Found archived recordings subdirectory: {}", subdirectoryName); - - subdirectoryPath = + // FIXME: refactor structure to remove file-uploads (v1 + // RecordingsPostBodyHandler) + if (subdirectoryName.equals("file-uploads") + || subdirectoryName.equals("uploads")) { + logger.info("Skipping: appears to be an upload location"); + return null; + } + Path subdirectoryPath = archivedRecordingsPath.resolve(subdirectoryName); String connectUrl; try { @@ -204,28 +200,7 @@ protected void migrate(ExecutorService executor) throws Exception { Files.move(oldLocation, newLocation); } FileUtils.deleteQuietly(subdirectoryPath.toFile()); - } catch (JvmIdGetException e) { - logger.warn( - "Failed to migrate archived recordings for {} - no" - + " target connection available to {}", - subdirectoryName, - e.getTarget()); - Path lostPath = - archivedRecordingsPath.resolve( - LOST_RECORDINGS_SUBDIRECTORY); - if (!fs.exists(lostPath)) { - fs.createDirectory(lostPath); - } - for (String file : fs.listDirectoryChildren(subdirectoryPath)) { - Path oldLocation = subdirectoryPath.resolve(file); - Path newLocation = lostPath.resolve(file); - logger.info( - "Moving lost recordings: {} -> {}", - oldLocation, - newLocation); - Files.move(oldLocation, newLocation); - } - FileUtils.deleteQuietly(subdirectoryPath.toFile()); + } catch (IOException e) { logger.warn(e); } catch (CancellationException e) { @@ -266,7 +241,7 @@ protected void transferArchivesIfRestarted(String targetId) { } logger.info( - "[{}]: Archives subdirectory transfer: {} -> {}", + "{} Archives subdirectory transfer: {} -> {}", connectUrl, subdirectoryPath, newJvmId); @@ -281,7 +256,7 @@ protected void transferArchivesIfRestarted(String targetId) { fs.deleteIfExists(subdirectoryPath); logger.info( - "[{}]: Archives subdirectory successfully transferred: {} -> {}", + "{} Archives subdirectory successfully transferred: {} -> {}", connectUrl, subdirectoryPath, newJvmId); @@ -290,6 +265,12 @@ protected void transferArchivesIfRestarted(String targetId) { } } + @SuppressFBWarnings( + value = "NP_NULL_ON_SOME_PATH_FROM_RETURN_VALUE", + justification = + "SpotBugs false positive. The following checks ensures that the" + + " getFileName() of the Path are not null, barring some exceptional" + + " circumstance like some external filesystem access race.") protected Future getConnectUrlFromPath(Path subdirectory) { CompletableFuture future = new CompletableFuture().orTimeout(FS_TIMEOUT_SECONDS, TimeUnit.SECONDS); @@ -298,8 +279,6 @@ protected Future getConnectUrlFromPath(Path subdirectory) { } else if (subdirectory.getFileName().toString().equals(UPLOADED_RECORDINGS_SUBDIRECTORY) || subdirectory.getFileName().toString().equals("file-uploads")) { future.complete(UPLOADED_RECORDINGS_SUBDIRECTORY); - } else if (subdirectory.getFileName().toString().equals(LOST_RECORDINGS_SUBDIRECTORY)) { - future.complete(LOST_RECORDINGS_SUBDIRECTORY); } else { Optional connectUrl = Optional.empty(); try { @@ -320,7 +299,10 @@ protected Future getConnectUrlFromPath(Path subdirectory) { } Path getRecordingSubdirectoryPath(String jvmId) { - String subdirectory = jvmIdHelper.jvmIdToSubdirectoryName(jvmId); + String subdirectory = + jvmId.equals(UPLOADED_RECORDINGS_SUBDIRECTORY) + ? UPLOADED_RECORDINGS_SUBDIRECTORY + : base32.encodeAsString(jvmId.getBytes(StandardCharsets.UTF_8)); return archivedRecordingsPath.resolve(subdirectory); } @@ -402,7 +384,7 @@ public Future deleteRecordingFromPath( String subdirectoryName, String recordingName) { CompletableFuture future = new CompletableFuture<>(); try { - String jvmId = jvmIdHelper.subdirectoryNameToJvmId(subdirectoryName); + String jvmId = new String(base32.decode(subdirectoryName), StandardCharsets.UTF_8); Path subdirectoryPath = archivedRecordingsPath.resolve(subdirectoryName); Path recordingPath = subdirectoryPath.resolve(recordingName); validateSavePath(recordingName, recordingPath); @@ -660,7 +642,7 @@ public Future> getRecordingsAndDirectories() { } Path subdirectory = archivedRecordingsPath.resolve(subdirectoryName); String targetId = getConnectUrlFromPath(subdirectory).get(); - String jvmId = jvmIdHelper.subdirectoryNameToJvmId(subdirectoryName); + String jvmId = new String(base32.decode(subdirectoryName), StandardCharsets.UTF_8); List files = this.fs.listDirectoryChildren(subdirectory); List temp = files.stream() @@ -762,9 +744,8 @@ public Future> getRecordings() { public Future getRecordingPathFromPath(String subdirectoryName, String recordingName) { try { - boolean checkConnectUrl = !jvmIdHelper.isSpecialDirectory(subdirectoryName); Path path = archivedRecordingsPath.resolve(subdirectoryName).resolve(recordingName); - validateRecordingPath(Optional.of(path), recordingName, checkConnectUrl); + validateRecordingPath(Optional.of(path), recordingName, false); return CompletableFuture.completedFuture(path); } catch (RecordingNotFoundException | ArchivePathException e) { return CompletableFuture.failedFuture(e); @@ -777,7 +758,7 @@ public Future getRecordingPath(String recordingName) { List subdirectories = this.fs.listDirectoryChildren(archivedRecordingsPath); Optional optional = searchSubdirectories(subdirectories, archivedRecordingsPath, recordingName); - validateRecordingPath(optional, recordingName, false); + validateRecordingPath(optional, recordingName, true); future.complete(optional.get()); } catch (RecordingNotFoundException | IOException | ArchivePathException e) { future.completeExceptionally(e); @@ -804,7 +785,7 @@ public Future getRecordingPath(String sourceTarget, String recordingName) if (archivedRecording == null) { throw new RecordingNotFoundException(sourceTarget, recordingName); } - validateRecordingPath(Optional.of(archivedRecording), recordingName, true); + validateRecordingPath(Optional.of(archivedRecording), recordingName, false); future.complete(archivedRecording); } catch (RecordingNotFoundException | ArchivePathException | IOException e) { future.completeExceptionally(e); @@ -859,7 +840,7 @@ public void validateSourceTarget(String sourceTarget) } private void validateRecordingPath( - Optional optional, String recordingName, boolean checkConnectUrl) + Optional optional, String recordingName, boolean isUploads) throws RecordingNotFoundException, ArchivePathException { if (optional.isEmpty()) { throw new RecordingNotFoundException(ARCHIVES, recordingName); @@ -874,7 +855,7 @@ private void validateRecordingPath( if (!fs.isReadable(archivedRecording)) { throw new ArchivePathException(archivedRecording.toString(), "is not readable"); } - if (checkConnectUrl && !fs.exists(archivedRecording.resolveSibling(CONNECT_URL))) { + if (!isUploads && !fs.exists(archivedRecording.resolveSibling(CONNECT_URL))) { throw new ArchivePathException( archivedRecording.resolveSibling(CONNECT_URL).toString(), "does not exist"); } @@ -974,6 +955,13 @@ private long getFileSize(String recordingName) { } } + // FIXME: override equals() so that tests are easier to write + @SuppressFBWarnings( + value = "EI_EXPOSE_REP2", + justification = + "This class is never used by the client and is not stored, it is simply" + + " constructed upon request so it wouldn't matter even if somehow the List" + + " was modified") public static class ArchiveDirectory { private final String connectUrl; private final String jvmId; From 2ab9713b7759c0261131262ed27ec61adaa15440 Mon Sep 17 00:00:00 2001 From: Max Cao Date: Thu, 20 Oct 2022 20:52:46 -0400 Subject: [PATCH 15/20] revert file --- .../recordings/RecordingArchiveHelper.java | 71 +++++++++++++------ 1 file changed, 48 insertions(+), 23 deletions(-) diff --git a/src/main/java/io/cryostat/recordings/RecordingArchiveHelper.java b/src/main/java/io/cryostat/recordings/RecordingArchiveHelper.java index d35931b304..f6e7a955f8 100644 --- a/src/main/java/io/cryostat/recordings/RecordingArchiveHelper.java +++ b/src/main/java/io/cryostat/recordings/RecordingArchiveHelper.java @@ -81,6 +81,7 @@ import io.cryostat.net.web.WebServer; import io.cryostat.net.web.http.HttpMimeType; import io.cryostat.platform.PlatformClient; +import io.cryostat.recordings.JvmIdHelper.JvmIdGetException; import io.cryostat.recordings.RecordingMetadataManager.Metadata; import io.cryostat.rules.ArchivePathException; import io.cryostat.rules.ArchivedRecordingInfo; @@ -113,6 +114,7 @@ public class RecordingArchiveHelper { public static final String ARCHIVES = "archives"; public static final String UPLOADED_RECORDINGS_SUBDIRECTORY = "uploads"; public static final String DEFAULT_CACHED_REPORT_SUBDIRECTORY = "default"; + public static final String LOST_RECORDINGS_SUBDIRECTORY = "lost"; private static final String CONNECT_URL = "connectUrl"; RecordingArchiveHelper( @@ -142,7 +144,7 @@ public class RecordingArchiveHelper { this.base32 = base32; } - // on startup migration and jvmId transfer method for archived recordings + // startup migration for archived recordings protected void migrate(ExecutorService executor) throws Exception { List subdirectories = fs.listDirectoryChildren(archivedRecordingsPath); List> futures = new ArrayList<>(subdirectories.size()); @@ -150,18 +152,20 @@ protected void migrate(ExecutorService executor) throws Exception { Future future = executor.submit( () -> { + Path subdirectoryPath = null; try { + if (jvmIdHelper.isSpecialDirectory(subdirectoryName)) { + logger.info( + "Skipping archive migration: appears to be a" + + " special location: {}", + subdirectoryName); + return null; + } logger.info( "Found archived recordings subdirectory: {}", subdirectoryName); - // FIXME: refactor structure to remove file-uploads (v1 - // RecordingsPostBodyHandler) - if (subdirectoryName.equals("file-uploads") - || subdirectoryName.equals("uploads")) { - logger.info("Skipping: appears to be an upload location"); - return null; - } - Path subdirectoryPath = + + subdirectoryPath = archivedRecordingsPath.resolve(subdirectoryName); String connectUrl; try { @@ -200,7 +204,28 @@ protected void migrate(ExecutorService executor) throws Exception { Files.move(oldLocation, newLocation); } FileUtils.deleteQuietly(subdirectoryPath.toFile()); - + } catch (JvmIdGetException e) { + logger.warn( + "Failed to migrate archived recordings for {} - no" + + " target connection available to {}", + subdirectoryName, + e.getTarget()); + Path lostPath = + archivedRecordingsPath.resolve( + LOST_RECORDINGS_SUBDIRECTORY); + if (!fs.exists(lostPath)) { + fs.createDirectory(lostPath); + } + for (String file : fs.listDirectoryChildren(subdirectoryPath)) { + Path oldLocation = subdirectoryPath.resolve(file); + Path newLocation = lostPath.resolve(file); + logger.info( + "Moving lost recordings: {} -> {}", + oldLocation, + newLocation); + Files.move(oldLocation, newLocation); + } + FileUtils.deleteQuietly(subdirectoryPath.toFile()); } catch (IOException e) { logger.warn(e); } catch (CancellationException e) { @@ -241,7 +266,7 @@ protected void transferArchivesIfRestarted(String targetId) { } logger.info( - "{} Archives subdirectory transfer: {} -> {}", + "[{}]: Archives subdirectory transfer: {} -> {}", connectUrl, subdirectoryPath, newJvmId); @@ -256,7 +281,7 @@ protected void transferArchivesIfRestarted(String targetId) { fs.deleteIfExists(subdirectoryPath); logger.info( - "{} Archives subdirectory successfully transferred: {} -> {}", + "[{}]: Archives subdirectory successfully transferred: {} -> {}", connectUrl, subdirectoryPath, newJvmId); @@ -279,6 +304,8 @@ protected Future getConnectUrlFromPath(Path subdirectory) { } else if (subdirectory.getFileName().toString().equals(UPLOADED_RECORDINGS_SUBDIRECTORY) || subdirectory.getFileName().toString().equals("file-uploads")) { future.complete(UPLOADED_RECORDINGS_SUBDIRECTORY); + } else if (subdirectory.getFileName().toString().equals(LOST_RECORDINGS_SUBDIRECTORY)) { + future.complete(LOST_RECORDINGS_SUBDIRECTORY); } else { Optional connectUrl = Optional.empty(); try { @@ -299,10 +326,7 @@ protected Future getConnectUrlFromPath(Path subdirectory) { } Path getRecordingSubdirectoryPath(String jvmId) { - String subdirectory = - jvmId.equals(UPLOADED_RECORDINGS_SUBDIRECTORY) - ? UPLOADED_RECORDINGS_SUBDIRECTORY - : base32.encodeAsString(jvmId.getBytes(StandardCharsets.UTF_8)); + String subdirectory = jvmIdHelper.jvmIdToSubdirectoryName(jvmId); return archivedRecordingsPath.resolve(subdirectory); } @@ -384,7 +408,7 @@ public Future deleteRecordingFromPath( String subdirectoryName, String recordingName) { CompletableFuture future = new CompletableFuture<>(); try { - String jvmId = new String(base32.decode(subdirectoryName), StandardCharsets.UTF_8); + String jvmId = jvmIdHelper.subdirectoryNameToJvmId(subdirectoryName); Path subdirectoryPath = archivedRecordingsPath.resolve(subdirectoryName); Path recordingPath = subdirectoryPath.resolve(recordingName); validateSavePath(recordingName, recordingPath); @@ -642,7 +666,7 @@ public Future> getRecordingsAndDirectories() { } Path subdirectory = archivedRecordingsPath.resolve(subdirectoryName); String targetId = getConnectUrlFromPath(subdirectory).get(); - String jvmId = new String(base32.decode(subdirectoryName), StandardCharsets.UTF_8); + String jvmId = jvmIdHelper.subdirectoryNameToJvmId(subdirectoryName); List files = this.fs.listDirectoryChildren(subdirectory); List temp = files.stream() @@ -744,8 +768,9 @@ public Future> getRecordings() { public Future getRecordingPathFromPath(String subdirectoryName, String recordingName) { try { + boolean checkConnectUrl = !jvmIdHelper.isSpecialDirectory(subdirectoryName); Path path = archivedRecordingsPath.resolve(subdirectoryName).resolve(recordingName); - validateRecordingPath(Optional.of(path), recordingName, false); + validateRecordingPath(Optional.of(path), recordingName, checkConnectUrl); return CompletableFuture.completedFuture(path); } catch (RecordingNotFoundException | ArchivePathException e) { return CompletableFuture.failedFuture(e); @@ -758,7 +783,7 @@ public Future getRecordingPath(String recordingName) { List subdirectories = this.fs.listDirectoryChildren(archivedRecordingsPath); Optional optional = searchSubdirectories(subdirectories, archivedRecordingsPath, recordingName); - validateRecordingPath(optional, recordingName, true); + validateRecordingPath(optional, recordingName, false); future.complete(optional.get()); } catch (RecordingNotFoundException | IOException | ArchivePathException e) { future.completeExceptionally(e); @@ -785,7 +810,7 @@ public Future getRecordingPath(String sourceTarget, String recordingName) if (archivedRecording == null) { throw new RecordingNotFoundException(sourceTarget, recordingName); } - validateRecordingPath(Optional.of(archivedRecording), recordingName, false); + validateRecordingPath(Optional.of(archivedRecording), recordingName, true); future.complete(archivedRecording); } catch (RecordingNotFoundException | ArchivePathException | IOException e) { future.completeExceptionally(e); @@ -840,7 +865,7 @@ public void validateSourceTarget(String sourceTarget) } private void validateRecordingPath( - Optional optional, String recordingName, boolean isUploads) + Optional optional, String recordingName, boolean checkConnectUrl) throws RecordingNotFoundException, ArchivePathException { if (optional.isEmpty()) { throw new RecordingNotFoundException(ARCHIVES, recordingName); @@ -855,7 +880,7 @@ private void validateRecordingPath( if (!fs.isReadable(archivedRecording)) { throw new ArchivePathException(archivedRecording.toString(), "is not readable"); } - if (!isUploads && !fs.exists(archivedRecording.resolveSibling(CONNECT_URL))) { + if (checkConnectUrl && !fs.exists(archivedRecording.resolveSibling(CONNECT_URL))) { throw new ArchivePathException( archivedRecording.resolveSibling(CONNECT_URL).toString(), "does not exist"); } From 14c18a40fde8c5a320145aba28b55cbc2d8c0aba Mon Sep 17 00:00:00 2001 From: Max Cao Date: Thu, 20 Oct 2022 20:59:50 -0400 Subject: [PATCH 16/20] re-add submodule dependency for spotbugs --- .github/workflows/ci.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 63bec89505..8a3d42a78d 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -144,6 +144,7 @@ jobs: steps: - uses: actions/checkout@v2 with: + submodules: true fetch-depth: 0 - uses: skjolber/maven-cache-github-action@v1 with: From 6faf916376e22f3643df3eb169d32c1b79696f44 Mon Sep 17 00:00:00 2001 From: Max Cao Date: Fri, 21 Oct 2022 13:20:52 -0400 Subject: [PATCH 17/20] test bad itests, pass variables directly to itests --- .github/workflows/ci.yaml | 12 +++--------- repeated-integration-tests.bash | 9 +++++++-- src/test/java/itest/ApiListingIT.java | 2 +- 3 files changed, 11 insertions(+), 12 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 8a3d42a78d..f5c0930dba 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -99,10 +99,6 @@ jobs: with: java-version: '17' distribution: 'adopt' - - name: install xpath - run: | - sudo apt-get update - sudo apt-get install -y libxml-xpath-perl - uses: actions/download-artifact@v3 with: name: cryostat @@ -111,7 +107,8 @@ jobs: - uses: skjolber/maven-cache-github-action@v1 with: step: restore - - run: bash repeated-integration-tests.bash + - name: Run integration tests + run: POD_NAME=cryostat-itests CONTAINER_NAME=cryostat-itest bash repeated-integration-tests.bash - name: Print itest logs if: ${{ failure() }} run: ls -1dt target/cryostat-itest-*.log | head -n1 | xargs cat @@ -173,7 +170,7 @@ jobs: with: step: save - build: + push-to-quay: runs-on: ubuntu-latest needs: [integration-tests, spotless, spotbugs, shellcheck] env: @@ -193,9 +190,6 @@ jobs: echo "::set-output name=tags::$IMAGE_VERSION" fi if: ${{ github.event_name == 'push' && github.repository_owner == 'cryostatio' }} - - uses: skjolber/maven-cache-github-action@v1 - with: - step: save - name: Push to quay.io id: push-to-quay uses: redhat-actions/push-to-registry@v2 diff --git a/repeated-integration-tests.bash b/repeated-integration-tests.bash index 599dde39a0..49513f2b26 100755 --- a/repeated-integration-tests.bash +++ b/repeated-integration-tests.bash @@ -15,8 +15,13 @@ if [ -z "${MVN}" ]; then MVN="$(which mvn)" fi -POD_NAME="$(xpath -q -e 'project/properties/cryostat.itest.podName/text()' pom.xml)" -CONTAINER_NAME="$(xpath -q -e 'project/properties/cryostat.itest.containerName/text()' pom.xml)" +if [ -z "${POD_NAME}" ]; then + POD_NAME="$(xpath -q -e 'project/properties/cryostat.itest.podName/text()' pom.xml)" +fi + +if [ -z "${CONTAINER_NAME}" ]; then + CONTAINER_NAME="$(xpath -q -e 'project/properties/cryostat.itest.containerName/text()' pom.xml)" +fi function cleanup() { if podman pod exists "${POD_NAME}"; then diff --git a/src/test/java/itest/ApiListingIT.java b/src/test/java/itest/ApiListingIT.java index 9572d7272f..c4d5fb0b03 100644 --- a/src/test/java/itest/ApiListingIT.java +++ b/src/test/java/itest/ApiListingIT.java @@ -94,6 +94,6 @@ void shouldIncludeHttpApiMdAndNonEmptyEndpoints() throws Exception { .getJsonObject("result") .getJsonArray("endpoints") .size(), - Matchers.greaterThan(0)); + Matchers.greaterThan(1000)); } } From e7028408fe2aeda288abd369083ea0f8a513f774 Mon Sep 17 00:00:00 2001 From: Max Cao Date: Fri, 21 Oct 2022 15:06:53 -0400 Subject: [PATCH 18/20] revert cache --- .github/workflows/ci.yaml | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index f5c0930dba..639e055a51 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -111,18 +111,16 @@ jobs: run: POD_NAME=cryostat-itests CONTAINER_NAME=cryostat-itest bash repeated-integration-tests.bash - name: Print itest logs if: ${{ failure() }} - run: ls -1dt target/cryostat-itest-*.log | head -n1 | xargs cat + run: ls -1dt target/cryostat-itests-*.log | head -n1 | xargs cat - uses: skjolber/maven-cache-github-action@v1 with: step: save spotless: runs-on: ubuntu-latest - needs: [build-deps] + needs: [build-image] steps: - uses: actions/checkout@v2 - with: - fetch-depth: 0 - uses: actions/setup-java@v2 with: java-version: '17' @@ -137,7 +135,7 @@ jobs: spotbugs: runs-on: ubuntu-latest - needs: [build-deps] + needs: [build-image] steps: - uses: actions/checkout@v2 with: @@ -151,24 +149,16 @@ jobs: java-version: '17' distribution: 'adopt' - run: mvn compile spotbugs:check - - uses: skjolber/maven-cache-github-action@v1 - with: - step: save shellcheck: runs-on: ubuntu-latest - needs: [build-deps] + needs: [build-image] steps: - uses: actions/checkout@v2 - with: - fetch-depth: 0 - uses: skjolber/maven-cache-github-action@v1 with: step: restore - run: mvn shellcheck:check - - uses: skjolber/maven-cache-github-action@v1 - with: - step: save push-to-quay: runs-on: ubuntu-latest From e9bf290fe82083ce40901b81c7e00d41b83b6660 Mon Sep 17 00:00:00 2001 From: Max Cao Date: Fri, 21 Oct 2022 15:25:54 -0400 Subject: [PATCH 19/20] remove save cache saves, revert itest testing, add names to plugin checks --- .github/workflows/ci.yaml | 12 ++++++------ src/test/java/itest/ApiListingIT.java | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 639e055a51..74cc325a1d 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -128,10 +128,8 @@ jobs: - uses: skjolber/maven-cache-github-action@v1 with: step: restore - - run: mvn spotless:check - - uses: skjolber/maven-cache-github-action@v1 - with: - step: save + - name: Run spotless + run: mvn spotless:check spotbugs: runs-on: ubuntu-latest @@ -148,7 +146,8 @@ jobs: with: java-version: '17' distribution: 'adopt' - - run: mvn compile spotbugs:check + - name: Run spotbugs + run: mvn compile spotbugs:check shellcheck: runs-on: ubuntu-latest @@ -158,7 +157,8 @@ jobs: - uses: skjolber/maven-cache-github-action@v1 with: step: restore - - run: mvn shellcheck:check + - name: Run shellcheck + run: mvn shellcheck:check push-to-quay: runs-on: ubuntu-latest diff --git a/src/test/java/itest/ApiListingIT.java b/src/test/java/itest/ApiListingIT.java index c4d5fb0b03..9572d7272f 100644 --- a/src/test/java/itest/ApiListingIT.java +++ b/src/test/java/itest/ApiListingIT.java @@ -94,6 +94,6 @@ void shouldIncludeHttpApiMdAndNonEmptyEndpoints() throws Exception { .getJsonObject("result") .getJsonArray("endpoints") .size(), - Matchers.greaterThan(1000)); + Matchers.greaterThan(0)); } } From 5deace265571360a89601aa0227d295aceae9123 Mon Sep 17 00:00:00 2001 From: Max Cao Date: Fri, 21 Oct 2022 16:30:25 -0400 Subject: [PATCH 20/20] remove blank space --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 74cc325a1d..54659e1210 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -54,7 +54,7 @@ jobs: - uses: skjolber/maven-cache-github-action@v1 with: step: save - + build-image: runs-on: ubuntu-latest needs: [get-pom-properties, build-deps]