Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion internal/presenters/funcs.go
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,13 @@ func getFindingTypesFromTestResult(testResults testapi.TestResult) []testapi.Fin
}
findingTypes[findings.Attributes.FindingType] = true
}
return slices.Collect(maps.Keys(findingTypes))

findingTypesList := slices.Collect(maps.Keys(findingTypes))
if len(findingTypesList) == 0 {
return []testapi.FindingType{"no findings type found"}
}

return findingTypesList
}

// getManifestPathFromTestResult extracts the manifest file path from test result
Expand Down
10 changes: 0 additions & 10 deletions internal/presenters/presenter_ufm_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -456,19 +456,12 @@ func normalizeSarifForComparison(t *testing.T, sarifJSON string) map[string]inte
return sarif
}

// TODO: preserve SARIF runs even if there are no findings
filteredRuns := make([]interface{}, 0)
for _, runInterface := range runs {
run, ok := runInterface.(map[string]interface{})
if !ok {
continue
}

results, ok := run["results"].([]interface{})
if !ok || len(results) == 0 {
continue
}

// Normalize automation ID (missing project name in actual output)
normalizeAutomationID(run)

Expand All @@ -483,11 +476,8 @@ func normalizeSarifForComparison(t *testing.T, sarifJSON string) map[string]inte

// Normalize suppressions (not included in original SARIF)
normalizeSuppressions(run)

filteredRuns = append(filteredRuns, run)
}

sarif["runs"] = filteredRuns
return sarif
}

Expand Down