From 23cfe5f3a04d743e9341accb70b24fd21b7c0d35 Mon Sep 17 00:00:00 2001 From: John Halley Gotway Date: Tue, 23 Apr 2024 16:43:42 -0600 Subject: [PATCH 1/3] Per #521, same sonar-project.properties changes but for the main_v5.1 branch --- .github/jobs/build_docker_image.sh | 4 ++-- internal/scripts/sonarqube/sonar-project.properties | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/jobs/build_docker_image.sh b/.github/jobs/build_docker_image.sh index d8e0e963..4d375382 100755 --- a/.github/jobs/build_docker_image.sh +++ b/.github/jobs/build_docker_image.sh @@ -18,7 +18,7 @@ if [ $? != 0 ]; then exit 1 fi -# Copy the dist directory from the image +# Copy the build directory from the image id=$(docker create ${DOCKERHUB_TAG}) -time_command docker cp $id:/METviewer/dist dist +time_command docker cp $id:/METviewer/build build docker rm -v $id diff --git a/internal/scripts/sonarqube/sonar-project.properties b/internal/scripts/sonarqube/sonar-project.properties index 3586fc31..7a1298ce 100644 --- a/internal/scripts/sonarqube/sonar-project.properties +++ b/internal/scripts/sonarqube/sonar-project.properties @@ -4,8 +4,8 @@ sonar.projectName=METviewer sonar.projectVersion=SONAR_PROJECT_VERSION sonar.branch.name=SONAR_BRANCH_NAME sonar.sources=java -sonar.java.libraries=dist/lib -sonar.java.binaries=dist/metviewer/WEB-INF/classes +sonar.java.libraries=lib +sonar.java.binaries=build sonar.sourceEncoding=UTF-8 # SonarQube server From 028a74fd66202d5f429a0e4f6cb7857e39023381 Mon Sep 17 00:00:00 2001 From: John Halley Gotway Date: Wed, 24 Apr 2024 14:44:06 -0600 Subject: [PATCH 2/3] Per #521, based on feedback from Tatiana, exclude the METviewer test directory from the scan and code coverage computations. --- internal/scripts/sonarqube/sonar-project.properties | 2 ++ 1 file changed, 2 insertions(+) diff --git a/internal/scripts/sonarqube/sonar-project.properties b/internal/scripts/sonarqube/sonar-project.properties index 7a1298ce..4f0d210f 100644 --- a/internal/scripts/sonarqube/sonar-project.properties +++ b/internal/scripts/sonarqube/sonar-project.properties @@ -7,6 +7,8 @@ sonar.sources=java sonar.java.libraries=lib sonar.java.binaries=build sonar.sourceEncoding=UTF-8 +sonar.exclusions=java/edu/ucar/metviewer/test +sonar.coverage.exclusions=java/edu/ucar/metviewer/test # SonarQube server sonar.host.url=SONAR_HOST_URL From ad38bcb7725d2b0830e1b619c0a96c2ea59961a9 Mon Sep 17 00:00:00 2001 From: John Halley Gotway Date: Wed, 24 Apr 2024 16:21:42 -0600 Subject: [PATCH 3/3] Per #521, try specifying the file exclusions rather than top-level directories --- internal/scripts/sonarqube/sonar-project.properties | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/scripts/sonarqube/sonar-project.properties b/internal/scripts/sonarqube/sonar-project.properties index 4f0d210f..c6cf4de9 100644 --- a/internal/scripts/sonarqube/sonar-project.properties +++ b/internal/scripts/sonarqube/sonar-project.properties @@ -7,8 +7,8 @@ sonar.sources=java sonar.java.libraries=lib sonar.java.binaries=build sonar.sourceEncoding=UTF-8 -sonar.exclusions=java/edu/ucar/metviewer/test -sonar.coverage.exclusions=java/edu/ucar/metviewer/test +sonar.exclusions=java/edu/ucar/metviewer/test/*,java/edu/ucar/metviewer/test/**/* +sonar.coverage.exclusions=java/edu/ucar/metviewer/test/*,java/edu/ucar/metviewer/test/**/* # SonarQube server sonar.host.url=SONAR_HOST_URL