diff --git a/plugins/reporters/evaluated-model/src/funTest/assets/evaluated-model-reporter-test-deduplicate-expected-output.yml b/plugins/reporters/evaluated-model/src/funTest/assets/evaluated-model-reporter-test-deduplicate-expected-output.yml index b74b8e34b9c00..4e2f2c7a7aaf8 100644 --- a/plugins/reporters/evaluated-model/src/funTest/assets/evaluated-model-reporter-test-deduplicate-expected-output.yml +++ b/plugins/reporters/evaluated-model/src/funTest/assets/evaluated-model-reporter-test-deduplicate-expected-output.yml @@ -77,6 +77,7 @@ issues: source: "FakeScanner" message: "ERROR: Timeout after 300 seconds while scanning file 'project/file-within-excluded-project.dat'." severity: "ERROR" + is_excluded: true pkg: 0 scan_result: 0 how_to_fix: "Some how to fix text." @@ -86,6 +87,7 @@ issues: source: "FakeScanner" message: "Example hint." severity: "HINT" + is_excluded: true pkg: 0 scan_result: 0 how_to_fix: "Some how to fix text." @@ -95,6 +97,7 @@ issues: source: "FakeScanner" message: "Example warning." severity: "WARNING" + is_excluded: true pkg: 0 scan_result: 0 how_to_fix: "Some how to fix text." @@ -104,6 +107,7 @@ issues: source: "FakeScanner" message: "Example error." severity: "ERROR" + is_excluded: true pkg: 0 scan_result: 0 how_to_fix: "Some how to fix text." @@ -115,6 +119,7 @@ issues: severity: "ERROR" resolutions: - 0 + is_excluded: true pkg: 0 scan_result: 0 how_to_fix: "Some how to fix text." @@ -178,6 +183,7 @@ issues: source: "FakeScanner" message: "ERROR: Timeout after 300 seconds while scanning file 'analyzer/src/funTest/assets/projects/synthetic/gradle/lib/excluded-file.dat'." severity: "ERROR" + is_excluded: true pkg: 1 scan_result: 1 how_to_fix: "Some how to fix text." diff --git a/plugins/reporters/evaluated-model/src/funTest/assets/evaluated-model-reporter-test-expected-output.json b/plugins/reporters/evaluated-model/src/funTest/assets/evaluated-model-reporter-test-expected-output.json index a2921e6be69f5..ffae77c490d0f 100644 --- a/plugins/reporters/evaluated-model/src/funTest/assets/evaluated-model-reporter-test-expected-output.json +++ b/plugins/reporters/evaluated-model/src/funTest/assets/evaluated-model-reporter-test-expected-output.json @@ -102,6 +102,7 @@ "source" : "FakeScanner", "message" : "ERROR: Timeout after 300 seconds while scanning file 'project/file-within-excluded-project.dat'.", "severity" : "ERROR", + "is_excluded" : true, "pkg" : 0, "scan_result" : 0, "how_to_fix" : "Some how to fix text." @@ -112,6 +113,7 @@ "source" : "FakeScanner", "message" : "Example hint.", "severity" : "HINT", + "is_excluded" : true, "pkg" : 0, "scan_result" : 0, "how_to_fix" : "Some how to fix text." @@ -122,6 +124,7 @@ "source" : "FakeScanner", "message" : "Example warning.", "severity" : "WARNING", + "is_excluded" : true, "pkg" : 0, "scan_result" : 0, "how_to_fix" : "Some how to fix text." @@ -132,6 +135,7 @@ "source" : "FakeScanner", "message" : "Example error.", "severity" : "ERROR", + "is_excluded" : true, "pkg" : 0, "scan_result" : 0, "how_to_fix" : "Some how to fix text." @@ -143,6 +147,7 @@ "message" : "Example error, resolved.", "severity" : "ERROR", "resolutions" : [ 0 ], + "is_excluded" : true, "pkg" : 0, "scan_result" : 0, "how_to_fix" : "Some how to fix text." @@ -210,6 +215,7 @@ "source" : "FakeScanner", "message" : "ERROR: Timeout after 300 seconds while scanning file 'analyzer/src/funTest/assets/projects/synthetic/gradle/lib/excluded-file.dat'.", "severity" : "ERROR", + "is_excluded" : true, "pkg" : 1, "scan_result" : 1, "how_to_fix" : "Some how to fix text." diff --git a/plugins/reporters/evaluated-model/src/funTest/assets/evaluated-model-reporter-test-expected-output.yml b/plugins/reporters/evaluated-model/src/funTest/assets/evaluated-model-reporter-test-expected-output.yml index 5ebf6cfac0db5..db927e106ae50 100644 --- a/plugins/reporters/evaluated-model/src/funTest/assets/evaluated-model-reporter-test-expected-output.yml +++ b/plugins/reporters/evaluated-model/src/funTest/assets/evaluated-model-reporter-test-expected-output.yml @@ -77,6 +77,7 @@ issues: source: "FakeScanner" message: "ERROR: Timeout after 300 seconds while scanning file 'project/file-within-excluded-project.dat'." severity: "ERROR" + is_excluded: true pkg: 0 scan_result: 0 how_to_fix: "Some how to fix text." @@ -86,6 +87,7 @@ issues: source: "FakeScanner" message: "Example hint." severity: "HINT" + is_excluded: true pkg: 0 scan_result: 0 how_to_fix: "Some how to fix text." @@ -95,6 +97,7 @@ issues: source: "FakeScanner" message: "Example warning." severity: "WARNING" + is_excluded: true pkg: 0 scan_result: 0 how_to_fix: "Some how to fix text." @@ -104,6 +107,7 @@ issues: source: "FakeScanner" message: "Example error." severity: "ERROR" + is_excluded: true pkg: 0 scan_result: 0 how_to_fix: "Some how to fix text." @@ -115,6 +119,7 @@ issues: severity: "ERROR" resolutions: - 0 + is_excluded: true pkg: 0 scan_result: 0 how_to_fix: "Some how to fix text." @@ -178,6 +183,7 @@ issues: source: "FakeScanner" message: "ERROR: Timeout after 300 seconds while scanning file 'analyzer/src/funTest/assets/projects/synthetic/gradle/lib/excluded-file.dat'." severity: "ERROR" + is_excluded: true pkg: 1 scan_result: 1 how_to_fix: "Some how to fix text." diff --git a/plugins/reporters/evaluated-model/src/main/kotlin/EvaluatedIssue.kt b/plugins/reporters/evaluated-model/src/main/kotlin/EvaluatedIssue.kt index 41449327292e5..cf831d905ecc3 100644 --- a/plugins/reporters/evaluated-model/src/main/kotlin/EvaluatedIssue.kt +++ b/plugins/reporters/evaluated-model/src/main/kotlin/EvaluatedIssue.kt @@ -41,6 +41,8 @@ data class EvaluatedIssue( val severity: Severity = Severity.ERROR, @JsonInclude(JsonInclude.Include.NON_EMPTY) val resolutions: List, + @JsonInclude(JsonInclude.Include.NON_DEFAULT) + val isExcluded: Boolean = false, @JsonIdentityReference(alwaysAsId = true) @JsonInclude(JsonInclude.Include.NON_NULL) val pkg: EvaluatedPackage?, diff --git a/plugins/reporters/evaluated-model/src/main/kotlin/EvaluatedModelMapper.kt b/plugins/reporters/evaluated-model/src/main/kotlin/EvaluatedModelMapper.kt index 7911b88ff3c32..b83c89cc6f342 100644 --- a/plugins/reporters/evaluated-model/src/main/kotlin/EvaluatedModelMapper.kt +++ b/plugins/reporters/evaluated-model/src/main/kotlin/EvaluatedModelMapper.kt @@ -595,6 +595,7 @@ internal class EvaluatedModelMapper(private val input: ReporterInput) { message = issue.message, severity = issue.severity, resolutions = resolutions, + isExcluded = input.ortResult.isExcluded(issue, pkg.id), pkg = pkg, scanResult = scanResult, path = path,