diff --git a/app/com/ysoft/odc/BambooDownloader.scala b/app/com/ysoft/odc/BambooDownloader.scala index 8ef1942..5f2ad1c 100644 --- a/app/com/ysoft/odc/BambooDownloader.scala +++ b/app/com/ysoft/odc/BambooDownloader.scala @@ -130,10 +130,11 @@ final class BambooDownloader @Inject()(@Named("bamboo-server-url") val server: S } resultsFuture.map{ originalResults => val buildFailureFilteredResults = originalResults.map{case (name, resultTry) => - name -> resultTry.flatMap{ case result @ (build, _, _) => + name -> resultTry.flatMap{ case result @ (build, reportFiles, _) => // Note that this is triggered only if the artifact directory exists. // If it does not, it will throw “java.util.NoSuchElementException: key not found: Report results-XML” instead. if (build.state != "Successful" || build.buildState != "Successful") Failure(new RuntimeException("failed build")) + else if (reportFiles.flatFiles.isEmpty) Failure(new RuntimeException("no output files")) else Success(result) } } diff --git a/app/controllers/DependencyCheckReportsProcessor.scala b/app/controllers/DependencyCheckReportsProcessor.scala index bff2614..6005377 100644 --- a/app/controllers/DependencyCheckReportsProcessor.scala +++ b/app/controllers/DependencyCheckReportsProcessor.scala @@ -75,10 +75,6 @@ final class DependencyCheckReportsProcessor @Inject() ( val unknownIdentifierTypes = allDependencies.flatMap(_._1.identifiers.map(_.identifierType)).toSet -- Set("maven", "cpe") val extraWarnings = Seq[Option[Warning]]( if(unknownIdentifierTypes.size > 0) Some(IdentifiedWarning("unknown-identifier-types", views.html.warnings.unknownIdentifierType(unknownIdentifierTypes), WarningSeverity.Info)) else None, - { - val emptyResults = successfulResults.filter{case (k, (_, dir, _)) => dir.flatFiles.size < 1} - if(emptyResults.nonEmpty) Some(IdentifiedWarning("empty-results", views.html.warnings.emptyResults(emptyResults.values.map{case (build, _, _) => build}.toSeq, server), WarningSeverity.Warning)) else None - }, { val resultsWithErrorMessages = successfulResults.filter{case (k, (_, _, log)) => log.dataString.lines.exists(l => (l.toLowerCase startsWith "error") || (l.toLowerCase contains "[error]"))} if(resultsWithErrorMessages.nonEmpty) Some(IdentifiedWarning("results-with-error-messages", views.html.warnings.resultsWithErrorMessages(resultsWithErrorMessages.values.map{case (build, _, _) => build}.toSeq, server), WarningSeverity.Error)) else None diff --git a/app/views/warnings/emptyResults.scala.html b/app/views/warnings/emptyResults.scala.html deleted file mode 100644 index 6eafc9b..0000000 --- a/app/views/warnings/emptyResults.scala.html +++ /dev/null @@ -1,5 +0,0 @@ -@(emptyReports: Seq[Build], urlBase: String) -Following projects have produced no results: -@for(build <- emptyReports.toSeq.sortBy(_.projectName)){ -