mirror of
https://github.com/ysoftdevs/odc-analyzer.git
synced 2026-01-15 08:14:02 +01:00
Treat missing files as a warning
This commit is contained in:
@@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
@(emptyReports: Seq[Build], urlBase: String)
|
||||
<strong>Following projects have produced no results:</strong>
|
||||
@for(build <- emptyReports.toSeq.sortBy(_.projectName)){
|
||||
<li>@secureLink(build.resultLink(urlBase)){@build.projectName}</li>
|
||||
}
|
||||
Reference in New Issue
Block a user