From 21f9950806e0395e89bcfd70b76def9d4133b937 Mon Sep 17 00:00:00 2001 From: Marc Handalian Date: Mon, 4 Apr 2022 21:18:32 -0700 Subject: [PATCH] Update ThirdPartyAuditTask to check for and list pointless exclusions. (#2760) This change swaps the order of the task to first check for no pointless exclusions. If not caught first these will be thrown inside of the bogusExcludesCount block that logs a useless error message. Signed-off-by: Marc Handalian --- .../org/opensearch/gradle/precommit/ThirdPartyAuditTask.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/buildSrc/src/main/java/org/opensearch/gradle/precommit/ThirdPartyAuditTask.java b/buildSrc/src/main/java/org/opensearch/gradle/precommit/ThirdPartyAuditTask.java index 097710b3f1a6e..2a49ae05db1fb 100644 --- a/buildSrc/src/main/java/org/opensearch/gradle/precommit/ThirdPartyAuditTask.java +++ b/buildSrc/src/main/java/org/opensearch/gradle/precommit/ThirdPartyAuditTask.java @@ -237,6 +237,7 @@ public void runThirdPartyAudit() throws IOException { Set jdkJarHellClasses = runJdkJarHellCheck(); if (missingClassExcludes != null) { + assertNoPointlessExclusions("are not missing", missingClassExcludes, missingClasses); long bogousExcludesCount = Stream.concat(missingClassExcludes.stream(), violationsExcludes.stream()) .filter(each -> missingClasses.contains(each) == false) .filter(each -> violationsClasses.contains(each) == false) @@ -247,7 +248,6 @@ public void runThirdPartyAudit() throws IOException { "All excluded classes seem to have no issues. " + "This is sometimes an indication that the check silently failed" ); } - assertNoPointlessExclusions("are not missing", missingClassExcludes, missingClasses); missingClasses.removeAll(missingClassExcludes); } assertNoPointlessExclusions("have no violations", violationsExcludes, violationsClasses);