Skip to content

Commit 5e900ad

Browse files
wkl3nksschuberth
authored andcommitted
fix(fossid): Don't create issue for zero pending identifications
Don't create an issue about pending identifications in FossID if actually no pending identifications exist. This bug prevents the use of configuration option 'treatPendingIdentificationsAsError', as it reports an issue with severity ERROR even if there are zero pending identifications. Signed-off-by: klw1imb <wolfgang.klenk2@bosch.com>
1 parent 38a41d6 commit 5e900ad

File tree

1 file changed

+10
-8
lines changed
  • plugins/scanners/fossid/src/main/kotlin

1 file changed

+10
-8
lines changed

plugins/scanners/fossid/src/main/kotlin/FossId.kt

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -927,15 +927,17 @@ class FossId internal constructor(
927927

928928
val fossIdScanUrl = buildFossIdScanUrl(config.serverUrl, result.scanId)
929929

930-
issues.add(
931-
0,
932-
Issue(
933-
source = descriptor.id,
934-
message = "This scan has $pendingFilesCount file(s) pending identification in FossID. " +
935-
"Please review and resolve them at: $fossIdScanUrl",
936-
severity = if (config.treatPendingIdentificationsAsError) Severity.ERROR else Severity.HINT
930+
if (pendingFilesCount > 0) {
931+
issues.add(
932+
0,
933+
Issue(
934+
source = descriptor.id,
935+
message = "This scan has $pendingFilesCount file(s) pending identification in FossID. " +
936+
"Please review and resolve them at: $fossIdScanUrl",
937+
severity = if (config.treatPendingIdentificationsAsError) Severity.ERROR else Severity.HINT
938+
)
937939
)
938-
)
940+
}
939941

940942
val ignoredFiles = rawResults.listIgnoredFiles.associateBy { it.path }
941943

0 commit comments

Comments
 (0)