From e01a9392c0ad71ef3b94bee62ef4ba7f78089053 Mon Sep 17 00:00:00 2001 From: Frank Viernau Date: Mon, 22 Apr 2024 15:13:13 +0200 Subject: [PATCH] test(reports): Add two scan issues to `reporter-test-input.yml` Add one issue to an included- and another to an excluded project to cover both cases with tests. This prepares adding the ability to filter excluded issues to the WebApp. Note: There are three copies of `reporter-test-input.yml` which are all updated for consistency. Furthremore, the affected paths of the issues have been choosen to be within the VCS path, so that the issues do net get filtered out by `OrtResult.getScanResultsForId()`. Signed-off-by: Frank Viernau --- ...orter-test-deduplicate-expected-output.yml | 289 ++++++++++-------- ...d-model-reporter-test-expected-output.json | 289 ++++++++++-------- ...ed-model-reporter-test-expected-output.yml | 289 ++++++++++-------- .../funTest/assets/reporter-test-input.yml | 9 + .../funTest/assets/reporter-test-input.yml | 9 + .../funTest/assets/reporter-test-input.yml | 9 + ...ic-html-reporter-test-expected-output.html | 34 ++- 7 files changed, 522 insertions(+), 406 deletions(-) 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 bc7ab38f6871f..8fbac4c946265 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 @@ -65,6 +65,15 @@ issue_resolutions: comment: "A comment explaining why the issue can be ignored." issues: - _id: 0 + timestamp: "2024-04-22T10:36:10.661544294Z" + type: "SCANNER" + source: "FakeScanner" + message: "ERROR: Timeout after 300 seconds while scanning file 'project/some/file.dat'." + severity: "ERROR" + pkg: 0 + scan_result: 0 + how_to_fix: "Some how to fix text." +- _id: 1 timestamp: "1970-01-01T00:00:00Z" type: "SCANNER" source: "Dummy" @@ -72,10 +81,19 @@ issues: Caused by: DownloadException: No VCS URL provided for 'Gradle:org.ossreviewtoolkit.gradle.example:lib:1.0.0'.\ \ Please make sure the published POM file includes the SCM connection, see: https://docs.gradle.org/current/userguide/publishing_maven.html#sec:modifying_the_generated_pom" severity: "ERROR" - pkg: 0 - scan_result: 0 + pkg: 1 + scan_result: 1 how_to_fix: "Some how to fix text." -- _id: 1 +- _id: 2 + timestamp: "2024-04-22T10:36:10.661544294Z" + type: "SCANNER" + source: "FakeScanner" + message: "ERROR: Timeout after 300 seconds while scanning file 'analyzer/src/funTest/assets/projects/synthetic/gradle/lib/another/file.dat'." + severity: "ERROR" + pkg: 1 + scan_result: 1 + how_to_fix: "Some how to fix text." +- _id: 3 timestamp: "1970-01-01T00:00:00Z" type: "ADVISOR" source: "VulnerableCode" @@ -83,41 +101,44 @@ issues: severity: "ERROR" resolutions: - 0 - pkg: 1 + pkg: 2 how_to_fix: "Some how to fix text." scan_results: - _id: 0 provenance: vcs_info: type: "Git" - url: "https://github.com/oss-review-toolkit/ort.git" + url: "https://example.com/git" revision: "master" - path: "analyzer/src/funTest/assets/projects/synthetic/gradle/lib" - resolved_revision: "3dcca3e6ee0dea120922f90495bf04b4e09ae455" + path: "project" + resolved_revision: "0000000000000000000000000000000000000000" scanner: name: "FakeScanner" version: "1.0" configuration: "" start_time: "1970-01-01T00:00:00Z" end_time: "1970-01-01T00:00:00Z" - package_verification_code: "be26ae6e9285a5d349d037deeb5eff2015635739" + package_verification_code: "bab81eca7b6fae7b64d4c7343a2f5c43c4caa171" issues: - 0 - _id: 1 provenance: vcs_info: type: "Git" - url: "https://example.com/git" + url: "https://github.com/oss-review-toolkit/ort.git" revision: "master" - path: "project" - resolved_revision: "0000000000000000000000000000000000000000" + path: "analyzer/src/funTest/assets/projects/synthetic/gradle/lib" + resolved_revision: "3dcca3e6ee0dea120922f90495bf04b4e09ae455" scanner: name: "FakeScanner" version: "1.0" configuration: "" start_time: "1970-01-01T00:00:00Z" end_time: "1970-01-01T00:00:00Z" - package_verification_code: "bab81eca7b6fae7b64d4c7343a2f5c43c4caa171" + package_verification_code: "be26ae6e9285a5d349d037deeb5eff2015635739" + issues: + - 1 + - 2 - _id: 2 provenance: source_artifact: @@ -190,6 +211,97 @@ scan_results: package_verification_code: "da39a3ee5e6b4b0d3255bfef95601890afd80709" packages: - _id: 0 + id: "Gradle:org.ossreviewtoolkit:nested-fake-project:1.0.0" + is_project: true + definition_file_path: "project/build.gradle" + declared_licenses: + - 0 + declared_licenses_processed: + spdx_expression: "CC-BY-NC-3.0 AND GPL-3.0-only WITH GCC-exception-3.1" + mapped_licenses: + - 1 + - 2 + detected_licenses: + - 3 + - 4 + detected_excluded_licenses: + - 4 + binary_artifact: + url: "" + hash: + value: "" + algorithm: "" + source_artifact: + url: "" + hash: + value: "" + algorithm: "" + vcs: + type: "" + url: "" + revision: "" + path: "" + vcs_processed: + type: "Git" + url: "https://example.com/git" + revision: "master" + path: "project" + paths: [] + levels: + - 0 + scan_results: + - 0 + findings: + - type: "COPYRIGHT" + copyright: 0 + path: "project/file.java" + start_line: 1 + end_line: 1 + scan_result: 0 + path_excludes: + - 1 + - type: "LICENSE" + license: 3 + path: "project/file.java" + start_line: 1 + end_line: 2 + scan_result: 0 + path_excludes: + - 1 + - type: "LICENSE" + license: 3 + path: "project/file.kt" + start_line: 1 + end_line: 2 + scan_result: 0 + - type: "COPYRIGHT" + copyright: 0 + path: "project/file1.java" + start_line: 1 + end_line: 1 + scan_result: 0 + path_excludes: + - 1 + - type: "LICENSE" + license: 4 + path: "project/file1.java" + start_line: 1 + end_line: 2 + scan_result: 0 + path_excludes: + - 1 + - type: "LICENSE" + license: 4 + path: "project/file2.java" + start_line: 1 + end_line: 2 + scan_result: 0 + path_excludes: + - 1 + is_excluded: true + path_excludes: + - 0 +- _id: 1 id: "Gradle:org.ossreviewtoolkit.gradle.example:lib:1.0.0" is_project: true definition_file_path: "analyzer/src/funTest/assets/projects/synthetic/gradle/lib/build.gradle" @@ -222,46 +334,46 @@ packages: levels: - 0 scan_results: - - 0 + - 1 findings: - type: "LICENSE" license: 5 path: "analyzer/src/funTest/assets/projects/synthetic/gradle/lib/src/code.cpp" start_line: 1 end_line: 1 - scan_result: 0 + scan_result: 1 - type: "COPYRIGHT" copyright: 0 path: "analyzer/src/funTest/assets/projects/synthetic/gradle/lib/build.gradle" start_line: 20 end_line: 20 - scan_result: 0 + scan_result: 1 - type: "LICENSE" license: 6 path: "analyzer/src/funTest/assets/projects/synthetic/gradle/lib/build.gradle" start_line: 19 end_line: 20 - scan_result: 0 + scan_result: 1 - type: "COPYRIGHT" copyright: 0 path: "analyzer/src/funTest/assets/projects/synthetic/gradle/lib/build.gradle" start_line: 20 end_line: 20 - scan_result: 0 + scan_result: 1 - type: "LICENSE" license: 7 path: "analyzer/src/funTest/assets/projects/synthetic/gradle/lib/build.gradle" start_line: 19 end_line: 19 - scan_result: 0 + scan_result: 1 - type: "LICENSE" license: 7 path: "analyzer/src/funTest/assets/projects/synthetic/gradle/lib/build.gradle" start_line: 20 end_line: 20 - scan_result: 0 + scan_result: 1 is_excluded: false -- _id: 1 +- _id: 2 id: "Maven:org.apache.commons:commons-text:1.1" is_project: false definition_file_path: "" @@ -308,97 +420,6 @@ packages: scan_results: - 5 is_excluded: false -- _id: 2 - id: "Gradle:org.ossreviewtoolkit:nested-fake-project:1.0.0" - is_project: true - definition_file_path: "project/build.gradle" - declared_licenses: - - 0 - declared_licenses_processed: - spdx_expression: "CC-BY-NC-3.0 AND GPL-3.0-only WITH GCC-exception-3.1" - mapped_licenses: - - 1 - - 2 - detected_licenses: - - 3 - - 4 - detected_excluded_licenses: - - 4 - binary_artifact: - url: "" - hash: - value: "" - algorithm: "" - source_artifact: - url: "" - hash: - value: "" - algorithm: "" - vcs: - type: "" - url: "" - revision: "" - path: "" - vcs_processed: - type: "Git" - url: "https://example.com/git" - revision: "master" - path: "project" - paths: [] - levels: - - 0 - scan_results: - - 1 - findings: - - type: "COPYRIGHT" - copyright: 0 - path: "project/file.java" - start_line: 1 - end_line: 1 - scan_result: 1 - path_excludes: - - 1 - - type: "LICENSE" - license: 3 - path: "project/file.java" - start_line: 1 - end_line: 2 - scan_result: 1 - path_excludes: - - 1 - - type: "LICENSE" - license: 3 - path: "project/file.kt" - start_line: 1 - end_line: 2 - scan_result: 1 - - type: "COPYRIGHT" - copyright: 0 - path: "project/file1.java" - start_line: 1 - end_line: 1 - scan_result: 1 - path_excludes: - - 1 - - type: "LICENSE" - license: 4 - path: "project/file1.java" - start_line: 1 - end_line: 2 - scan_result: 1 - path_excludes: - - 1 - - type: "LICENSE" - license: 4 - path: "project/file2.java" - start_line: 1 - end_line: 2 - scan_result: 1 - path_excludes: - - 1 - is_excluded: true - path_excludes: - - 0 - _id: 3 id: "Ant:junit:junit:4.12" is_project: false @@ -717,75 +738,75 @@ packages: paths: - _id: 0 pkg: 3 - project: 0 + project: 1 scope: 1 path: [] - _id: 1 pkg: 4 - project: 0 + project: 1 scope: 1 path: - 3 - _id: 2 pkg: 5 - project: 0 + project: 1 scope: 1 path: - 3 - _id: 3 pkg: 6 - project: 0 + project: 1 scope: 0 path: - - 1 + - 2 - _id: 4 pkg: 6 - project: 0 + project: 1 scope: 1 path: - 9 - - 1 + - 2 - _id: 5 - pkg: 1 - project: 0 + pkg: 2 + project: 1 scope: 0 path: [] - _id: 6 - pkg: 1 - project: 0 + pkg: 2 + project: 1 scope: 1 path: - 9 - _id: 7 pkg: 8 - project: 0 + project: 1 scope: 1 path: - 3 - _id: 8 pkg: 9 - project: 0 + project: 1 scope: 0 path: [] - _id: 9 pkg: 9 - project: 0 + project: 1 scope: 1 path: [] dependency_trees: - key: 0 - pkg: 2 + pkg: 0 path_excludes: - 0 - key: 1 - pkg: 0 + pkg: 1 children: - key: 2 scope: 0 children: - key: 3 linkage: "DYNAMIC" - pkg: 1 + pkg: 2 children: - key: 4 linkage: "DYNAMIC" @@ -796,7 +817,7 @@ dependency_trees: children: - key: 6 linkage: "DYNAMIC" - pkg: 1 + pkg: 2 - key: 7 scope: 1 scope_excludes: @@ -821,7 +842,7 @@ dependency_trees: children: - key: 13 linkage: "DYNAMIC" - pkg: 1 + pkg: 2 children: - key: 14 linkage: "DYNAMIC" @@ -843,7 +864,7 @@ rule_violations: \ that overflow:scroll is working as expected.\n```" - _id: 1 rule: "rule 2" - pkg: 1 + pkg: 2 license: 3 license_source: "DECLARED" severity: "HINT" @@ -865,7 +886,7 @@ vulnerabilities_resolutions: [] vulnerabilities: - _id: 0 id: "VULCOID-VULNERABILITY_ID" - pkg: 1 + pkg: 2 summary: "summary text" description: "description text" references: @@ -884,10 +905,10 @@ statistics: rule_violation_resolutions: 1 vulnerability_resolutions: 0 open_issues: - errors: 1 + errors: 2 warnings: 0 hints: 0 - severe: 1 + severe: 2 open_rule_violations: errors: 1 warnings: 1 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 816c5538c3f6e..0cb5c8b38d454 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 @@ -88,10 +88,10 @@ } ], "issues" : [ { "_id" : 0, - "timestamp" : "1970-01-01T00:00:00Z", + "timestamp" : "2024-04-22T10:36:10.661544294Z", "type" : "SCANNER", - "source" : "Dummy", - "message" : "DownloadException: No source artifact URL provided for 'Gradle:org.ossreviewtoolkit.gradle.example:lib:1.0.0'.\nCaused by: DownloadException: No VCS URL provided for 'Gradle:org.ossreviewtoolkit.gradle.example:lib:1.0.0'. Please make sure the published POM file includes the SCM connection, see: https://docs.gradle.org/current/userguide/publishing_maven.html#sec:modifying_the_generated_pom", + "source" : "FakeScanner", + "message" : "ERROR: Timeout after 300 seconds while scanning file 'project/some/file.dat'.", "severity" : "ERROR", "pkg" : 0, "scan_result" : 0, @@ -99,12 +99,32 @@ }, { "_id" : 1, "timestamp" : "1970-01-01T00:00:00Z", + "type" : "SCANNER", + "source" : "Dummy", + "message" : "DownloadException: No source artifact URL provided for 'Gradle:org.ossreviewtoolkit.gradle.example:lib:1.0.0'.\nCaused by: DownloadException: No VCS URL provided for 'Gradle:org.ossreviewtoolkit.gradle.example:lib:1.0.0'. Please make sure the published POM file includes the SCM connection, see: https://docs.gradle.org/current/userguide/publishing_maven.html#sec:modifying_the_generated_pom", + "severity" : "ERROR", + "pkg" : 1, + "scan_result" : 1, + "how_to_fix" : "Some how to fix text." + }, { + "_id" : 2, + "timestamp" : "2024-04-22T10:36:10.661544294Z", + "type" : "SCANNER", + "source" : "FakeScanner", + "message" : "ERROR: Timeout after 300 seconds while scanning file 'analyzer/src/funTest/assets/projects/synthetic/gradle/lib/another/file.dat'.", + "severity" : "ERROR", + "pkg" : 1, + "scan_result" : 1, + "how_to_fix" : "Some how to fix text." + }, { + "_id" : 3, + "timestamp" : "1970-01-01T00:00:00Z", "type" : "ADVISOR", "source" : "VulnerableCode", "message" : "A test issue.", "severity" : "ERROR", "resolutions" : [ 0 ], - "pkg" : 1, + "pkg" : 2, "how_to_fix" : "Some how to fix text." } ], "scan_results" : [ { @@ -112,11 +132,11 @@ "provenance" : { "vcs_info" : { "type" : "Git", - "url" : "https://github.com/oss-review-toolkit/ort.git", + "url" : "https://example.com/git", "revision" : "master", - "path" : "analyzer/src/funTest/assets/projects/synthetic/gradle/lib" + "path" : "project" }, - "resolved_revision" : "3dcca3e6ee0dea120922f90495bf04b4e09ae455" + "resolved_revision" : "0000000000000000000000000000000000000000" }, "scanner" : { "name" : "FakeScanner", @@ -125,18 +145,18 @@ }, "start_time" : "1970-01-01T00:00:00Z", "end_time" : "1970-01-01T00:00:00Z", - "package_verification_code" : "be26ae6e9285a5d349d037deeb5eff2015635739", + "package_verification_code" : "bab81eca7b6fae7b64d4c7343a2f5c43c4caa171", "issues" : [ 0 ] }, { "_id" : 1, "provenance" : { "vcs_info" : { "type" : "Git", - "url" : "https://example.com/git", + "url" : "https://github.com/oss-review-toolkit/ort.git", "revision" : "master", - "path" : "project" + "path" : "analyzer/src/funTest/assets/projects/synthetic/gradle/lib" }, - "resolved_revision" : "0000000000000000000000000000000000000000" + "resolved_revision" : "3dcca3e6ee0dea120922f90495bf04b4e09ae455" }, "scanner" : { "name" : "FakeScanner", @@ -145,7 +165,8 @@ }, "start_time" : "1970-01-01T00:00:00Z", "end_time" : "1970-01-01T00:00:00Z", - "package_verification_code" : "bab81eca7b6fae7b64d4c7343a2f5c43c4caa171" + "package_verification_code" : "be26ae6e9285a5d349d037deeb5eff2015635739", + "issues" : [ 1, 2 ] }, { "_id" : 2, "provenance" : { @@ -244,6 +265,97 @@ } ], "packages" : [ { "_id" : 0, + "id" : "Gradle:org.ossreviewtoolkit:nested-fake-project:1.0.0", + "is_project" : true, + "definition_file_path" : "project/build.gradle", + "declared_licenses" : [ 0 ], + "declared_licenses_processed" : { + "spdx_expression" : "CC-BY-NC-3.0 AND GPL-3.0-only WITH GCC-exception-3.1", + "mapped_licenses" : [ 1, 2 ] + }, + "detected_licenses" : [ 3, 4 ], + "detected_excluded_licenses" : [ 4 ], + "binary_artifact" : { + "url" : "", + "hash" : { + "value" : "", + "algorithm" : "" + } + }, + "source_artifact" : { + "url" : "", + "hash" : { + "value" : "", + "algorithm" : "" + } + }, + "vcs" : { + "type" : "", + "url" : "", + "revision" : "", + "path" : "" + }, + "vcs_processed" : { + "type" : "Git", + "url" : "https://example.com/git", + "revision" : "master", + "path" : "project" + }, + "paths" : [ ], + "levels" : [ 0 ], + "scan_results" : [ 0 ], + "findings" : [ { + "type" : "COPYRIGHT", + "copyright" : 0, + "path" : "project/file.java", + "start_line" : 1, + "end_line" : 1, + "scan_result" : 0, + "path_excludes" : [ 1 ] + }, { + "type" : "LICENSE", + "license" : 3, + "path" : "project/file.java", + "start_line" : 1, + "end_line" : 2, + "scan_result" : 0, + "path_excludes" : [ 1 ] + }, { + "type" : "LICENSE", + "license" : 3, + "path" : "project/file.kt", + "start_line" : 1, + "end_line" : 2, + "scan_result" : 0 + }, { + "type" : "COPYRIGHT", + "copyright" : 0, + "path" : "project/file1.java", + "start_line" : 1, + "end_line" : 1, + "scan_result" : 0, + "path_excludes" : [ 1 ] + }, { + "type" : "LICENSE", + "license" : 4, + "path" : "project/file1.java", + "start_line" : 1, + "end_line" : 2, + "scan_result" : 0, + "path_excludes" : [ 1 ] + }, { + "type" : "LICENSE", + "license" : 4, + "path" : "project/file2.java", + "start_line" : 1, + "end_line" : 2, + "scan_result" : 0, + "path_excludes" : [ 1 ] + } ], + "is_excluded" : true, + "path_excludes" : [ 0 ] + }, { + "_id" : 1, "id" : "Gradle:org.ossreviewtoolkit.gradle.example:lib:1.0.0", "is_project" : true, "definition_file_path" : "analyzer/src/funTest/assets/projects/synthetic/gradle/lib/build.gradle", @@ -277,53 +389,53 @@ }, "paths" : [ ], "levels" : [ 0 ], - "scan_results" : [ 0 ], + "scan_results" : [ 1 ], "findings" : [ { "type" : "LICENSE", "license" : 5, "path" : "analyzer/src/funTest/assets/projects/synthetic/gradle/lib/src/code.cpp", "start_line" : 1, "end_line" : 1, - "scan_result" : 0 + "scan_result" : 1 }, { "type" : "COPYRIGHT", "copyright" : 0, "path" : "analyzer/src/funTest/assets/projects/synthetic/gradle/lib/build.gradle", "start_line" : 20, "end_line" : 20, - "scan_result" : 0 + "scan_result" : 1 }, { "type" : "LICENSE", "license" : 6, "path" : "analyzer/src/funTest/assets/projects/synthetic/gradle/lib/build.gradle", "start_line" : 19, "end_line" : 20, - "scan_result" : 0 + "scan_result" : 1 }, { "type" : "COPYRIGHT", "copyright" : 0, "path" : "analyzer/src/funTest/assets/projects/synthetic/gradle/lib/build.gradle", "start_line" : 20, "end_line" : 20, - "scan_result" : 0 + "scan_result" : 1 }, { "type" : "LICENSE", "license" : 7, "path" : "analyzer/src/funTest/assets/projects/synthetic/gradle/lib/build.gradle", "start_line" : 19, "end_line" : 19, - "scan_result" : 0 + "scan_result" : 1 }, { "type" : "LICENSE", "license" : 7, "path" : "analyzer/src/funTest/assets/projects/synthetic/gradle/lib/build.gradle", "start_line" : 20, "end_line" : 20, - "scan_result" : 0 + "scan_result" : 1 } ], "is_excluded" : false }, { - "_id" : 1, + "_id" : 2, "id" : "Maven:org.apache.commons:commons-text:1.1", "is_project" : false, "definition_file_path" : "", @@ -367,97 +479,6 @@ "scopes" : [ 0, 1 ], "scan_results" : [ 5 ], "is_excluded" : false - }, { - "_id" : 2, - "id" : "Gradle:org.ossreviewtoolkit:nested-fake-project:1.0.0", - "is_project" : true, - "definition_file_path" : "project/build.gradle", - "declared_licenses" : [ 0 ], - "declared_licenses_processed" : { - "spdx_expression" : "CC-BY-NC-3.0 AND GPL-3.0-only WITH GCC-exception-3.1", - "mapped_licenses" : [ 1, 2 ] - }, - "detected_licenses" : [ 3, 4 ], - "detected_excluded_licenses" : [ 4 ], - "binary_artifact" : { - "url" : "", - "hash" : { - "value" : "", - "algorithm" : "" - } - }, - "source_artifact" : { - "url" : "", - "hash" : { - "value" : "", - "algorithm" : "" - } - }, - "vcs" : { - "type" : "", - "url" : "", - "revision" : "", - "path" : "" - }, - "vcs_processed" : { - "type" : "Git", - "url" : "https://example.com/git", - "revision" : "master", - "path" : "project" - }, - "paths" : [ ], - "levels" : [ 0 ], - "scan_results" : [ 1 ], - "findings" : [ { - "type" : "COPYRIGHT", - "copyright" : 0, - "path" : "project/file.java", - "start_line" : 1, - "end_line" : 1, - "scan_result" : 1, - "path_excludes" : [ 1 ] - }, { - "type" : "LICENSE", - "license" : 3, - "path" : "project/file.java", - "start_line" : 1, - "end_line" : 2, - "scan_result" : 1, - "path_excludes" : [ 1 ] - }, { - "type" : "LICENSE", - "license" : 3, - "path" : "project/file.kt", - "start_line" : 1, - "end_line" : 2, - "scan_result" : 1 - }, { - "type" : "COPYRIGHT", - "copyright" : 0, - "path" : "project/file1.java", - "start_line" : 1, - "end_line" : 1, - "scan_result" : 1, - "path_excludes" : [ 1 ] - }, { - "type" : "LICENSE", - "license" : 4, - "path" : "project/file1.java", - "start_line" : 1, - "end_line" : 2, - "scan_result" : 1, - "path_excludes" : [ 1 ] - }, { - "type" : "LICENSE", - "license" : 4, - "path" : "project/file2.java", - "start_line" : 1, - "end_line" : 2, - "scan_result" : 1, - "path_excludes" : [ 1 ] - } ], - "is_excluded" : true, - "path_excludes" : [ 0 ] }, { "_id" : 3, "id" : "Ant:junit:junit:4.12", @@ -784,78 +805,78 @@ "paths" : [ { "_id" : 0, "pkg" : 3, - "project" : 0, + "project" : 1, "scope" : 1, "path" : [ ] }, { "_id" : 1, "pkg" : 4, - "project" : 0, + "project" : 1, "scope" : 1, "path" : [ 3 ] }, { "_id" : 2, "pkg" : 5, - "project" : 0, + "project" : 1, "scope" : 1, "path" : [ 3 ] }, { "_id" : 3, "pkg" : 6, - "project" : 0, + "project" : 1, "scope" : 0, - "path" : [ 1 ] + "path" : [ 2 ] }, { "_id" : 4, "pkg" : 6, - "project" : 0, + "project" : 1, "scope" : 1, - "path" : [ 9, 1 ] + "path" : [ 9, 2 ] }, { "_id" : 5, - "pkg" : 1, - "project" : 0, + "pkg" : 2, + "project" : 1, "scope" : 0, "path" : [ ] }, { "_id" : 6, - "pkg" : 1, - "project" : 0, + "pkg" : 2, + "project" : 1, "scope" : 1, "path" : [ 9 ] }, { "_id" : 7, "pkg" : 8, - "project" : 0, + "project" : 1, "scope" : 1, "path" : [ 3 ] }, { "_id" : 8, "pkg" : 9, - "project" : 0, + "project" : 1, "scope" : 0, "path" : [ ] }, { "_id" : 9, "pkg" : 9, - "project" : 0, + "project" : 1, "scope" : 1, "path" : [ ] } ], "dependency_trees" : [ { "key" : 0, - "pkg" : 2, + "pkg" : 0, "path_excludes" : [ 0 ] }, { "key" : 1, - "pkg" : 0, + "pkg" : 1, "children" : [ { "key" : 2, "scope" : 0, "children" : [ { "key" : 3, "linkage" : "DYNAMIC", - "pkg" : 1, + "pkg" : 2, "children" : [ { "key" : 4, "linkage" : "DYNAMIC", @@ -868,7 +889,7 @@ "children" : [ { "key" : 6, "linkage" : "DYNAMIC", - "pkg" : 1, + "pkg" : 2, "children" : [ { "key" : 7, "linkage" : "DYNAMIC", @@ -904,7 +925,7 @@ "children" : [ { "key" : 14, "linkage" : "DYNAMIC", - "pkg" : 1, + "pkg" : 2, "children" : [ { "key" : 15, "linkage" : "DYNAMIC", @@ -932,7 +953,7 @@ }, { "_id" : 1, "rule" : "rule 2", - "pkg" : 1, + "pkg" : 2, "license" : 3, "license_source" : "DECLARED", "severity" : "HINT", @@ -953,7 +974,7 @@ "vulnerabilities" : [ { "_id" : 0, "id" : "VULCOID-VULNERABILITY_ID", - "pkg" : 1, + "pkg" : 2, "summary" : "summary text", "description" : "description text", "references" : [ { @@ -975,10 +996,10 @@ "vulnerability_resolutions" : 0 }, "open_issues" : { - "errors" : 1, + "errors" : 2, "warnings" : 0, "hints" : 0, - "severe" : 1 + "severe" : 2 }, "open_rule_violations" : { "errors" : 1, 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 0b69ff95352dd..9e6b21e8171d5 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 @@ -65,6 +65,15 @@ issue_resolutions: comment: "A comment explaining why the issue can be ignored." issues: - _id: 0 + timestamp: "2024-04-22T10:36:10.661544294Z" + type: "SCANNER" + source: "FakeScanner" + message: "ERROR: Timeout after 300 seconds while scanning file 'project/some/file.dat'." + severity: "ERROR" + pkg: 0 + scan_result: 0 + how_to_fix: "Some how to fix text." +- _id: 1 timestamp: "1970-01-01T00:00:00Z" type: "SCANNER" source: "Dummy" @@ -72,10 +81,19 @@ issues: Caused by: DownloadException: No VCS URL provided for 'Gradle:org.ossreviewtoolkit.gradle.example:lib:1.0.0'.\ \ Please make sure the published POM file includes the SCM connection, see: https://docs.gradle.org/current/userguide/publishing_maven.html#sec:modifying_the_generated_pom" severity: "ERROR" - pkg: 0 - scan_result: 0 + pkg: 1 + scan_result: 1 how_to_fix: "Some how to fix text." -- _id: 1 +- _id: 2 + timestamp: "2024-04-22T10:36:10.661544294Z" + type: "SCANNER" + source: "FakeScanner" + message: "ERROR: Timeout after 300 seconds while scanning file 'analyzer/src/funTest/assets/projects/synthetic/gradle/lib/another/file.dat'." + severity: "ERROR" + pkg: 1 + scan_result: 1 + how_to_fix: "Some how to fix text." +- _id: 3 timestamp: "1970-01-01T00:00:00Z" type: "ADVISOR" source: "VulnerableCode" @@ -83,41 +101,44 @@ issues: severity: "ERROR" resolutions: - 0 - pkg: 1 + pkg: 2 how_to_fix: "Some how to fix text." scan_results: - _id: 0 provenance: vcs_info: type: "Git" - url: "https://github.com/oss-review-toolkit/ort.git" + url: "https://example.com/git" revision: "master" - path: "analyzer/src/funTest/assets/projects/synthetic/gradle/lib" - resolved_revision: "3dcca3e6ee0dea120922f90495bf04b4e09ae455" + path: "project" + resolved_revision: "0000000000000000000000000000000000000000" scanner: name: "FakeScanner" version: "1.0" configuration: "" start_time: "1970-01-01T00:00:00Z" end_time: "1970-01-01T00:00:00Z" - package_verification_code: "be26ae6e9285a5d349d037deeb5eff2015635739" + package_verification_code: "bab81eca7b6fae7b64d4c7343a2f5c43c4caa171" issues: - 0 - _id: 1 provenance: vcs_info: type: "Git" - url: "https://example.com/git" + url: "https://github.com/oss-review-toolkit/ort.git" revision: "master" - path: "project" - resolved_revision: "0000000000000000000000000000000000000000" + path: "analyzer/src/funTest/assets/projects/synthetic/gradle/lib" + resolved_revision: "3dcca3e6ee0dea120922f90495bf04b4e09ae455" scanner: name: "FakeScanner" version: "1.0" configuration: "" start_time: "1970-01-01T00:00:00Z" end_time: "1970-01-01T00:00:00Z" - package_verification_code: "bab81eca7b6fae7b64d4c7343a2f5c43c4caa171" + package_verification_code: "be26ae6e9285a5d349d037deeb5eff2015635739" + issues: + - 1 + - 2 - _id: 2 provenance: source_artifact: @@ -190,6 +211,97 @@ scan_results: package_verification_code: "da39a3ee5e6b4b0d3255bfef95601890afd80709" packages: - _id: 0 + id: "Gradle:org.ossreviewtoolkit:nested-fake-project:1.0.0" + is_project: true + definition_file_path: "project/build.gradle" + declared_licenses: + - 0 + declared_licenses_processed: + spdx_expression: "CC-BY-NC-3.0 AND GPL-3.0-only WITH GCC-exception-3.1" + mapped_licenses: + - 1 + - 2 + detected_licenses: + - 3 + - 4 + detected_excluded_licenses: + - 4 + binary_artifact: + url: "" + hash: + value: "" + algorithm: "" + source_artifact: + url: "" + hash: + value: "" + algorithm: "" + vcs: + type: "" + url: "" + revision: "" + path: "" + vcs_processed: + type: "Git" + url: "https://example.com/git" + revision: "master" + path: "project" + paths: [] + levels: + - 0 + scan_results: + - 0 + findings: + - type: "COPYRIGHT" + copyright: 0 + path: "project/file.java" + start_line: 1 + end_line: 1 + scan_result: 0 + path_excludes: + - 1 + - type: "LICENSE" + license: 3 + path: "project/file.java" + start_line: 1 + end_line: 2 + scan_result: 0 + path_excludes: + - 1 + - type: "LICENSE" + license: 3 + path: "project/file.kt" + start_line: 1 + end_line: 2 + scan_result: 0 + - type: "COPYRIGHT" + copyright: 0 + path: "project/file1.java" + start_line: 1 + end_line: 1 + scan_result: 0 + path_excludes: + - 1 + - type: "LICENSE" + license: 4 + path: "project/file1.java" + start_line: 1 + end_line: 2 + scan_result: 0 + path_excludes: + - 1 + - type: "LICENSE" + license: 4 + path: "project/file2.java" + start_line: 1 + end_line: 2 + scan_result: 0 + path_excludes: + - 1 + is_excluded: true + path_excludes: + - 0 +- _id: 1 id: "Gradle:org.ossreviewtoolkit.gradle.example:lib:1.0.0" is_project: true definition_file_path: "analyzer/src/funTest/assets/projects/synthetic/gradle/lib/build.gradle" @@ -222,46 +334,46 @@ packages: levels: - 0 scan_results: - - 0 + - 1 findings: - type: "LICENSE" license: 5 path: "analyzer/src/funTest/assets/projects/synthetic/gradle/lib/src/code.cpp" start_line: 1 end_line: 1 - scan_result: 0 + scan_result: 1 - type: "COPYRIGHT" copyright: 0 path: "analyzer/src/funTest/assets/projects/synthetic/gradle/lib/build.gradle" start_line: 20 end_line: 20 - scan_result: 0 + scan_result: 1 - type: "LICENSE" license: 6 path: "analyzer/src/funTest/assets/projects/synthetic/gradle/lib/build.gradle" start_line: 19 end_line: 20 - scan_result: 0 + scan_result: 1 - type: "COPYRIGHT" copyright: 0 path: "analyzer/src/funTest/assets/projects/synthetic/gradle/lib/build.gradle" start_line: 20 end_line: 20 - scan_result: 0 + scan_result: 1 - type: "LICENSE" license: 7 path: "analyzer/src/funTest/assets/projects/synthetic/gradle/lib/build.gradle" start_line: 19 end_line: 19 - scan_result: 0 + scan_result: 1 - type: "LICENSE" license: 7 path: "analyzer/src/funTest/assets/projects/synthetic/gradle/lib/build.gradle" start_line: 20 end_line: 20 - scan_result: 0 + scan_result: 1 is_excluded: false -- _id: 1 +- _id: 2 id: "Maven:org.apache.commons:commons-text:1.1" is_project: false definition_file_path: "" @@ -308,97 +420,6 @@ packages: scan_results: - 5 is_excluded: false -- _id: 2 - id: "Gradle:org.ossreviewtoolkit:nested-fake-project:1.0.0" - is_project: true - definition_file_path: "project/build.gradle" - declared_licenses: - - 0 - declared_licenses_processed: - spdx_expression: "CC-BY-NC-3.0 AND GPL-3.0-only WITH GCC-exception-3.1" - mapped_licenses: - - 1 - - 2 - detected_licenses: - - 3 - - 4 - detected_excluded_licenses: - - 4 - binary_artifact: - url: "" - hash: - value: "" - algorithm: "" - source_artifact: - url: "" - hash: - value: "" - algorithm: "" - vcs: - type: "" - url: "" - revision: "" - path: "" - vcs_processed: - type: "Git" - url: "https://example.com/git" - revision: "master" - path: "project" - paths: [] - levels: - - 0 - scan_results: - - 1 - findings: - - type: "COPYRIGHT" - copyright: 0 - path: "project/file.java" - start_line: 1 - end_line: 1 - scan_result: 1 - path_excludes: - - 1 - - type: "LICENSE" - license: 3 - path: "project/file.java" - start_line: 1 - end_line: 2 - scan_result: 1 - path_excludes: - - 1 - - type: "LICENSE" - license: 3 - path: "project/file.kt" - start_line: 1 - end_line: 2 - scan_result: 1 - - type: "COPYRIGHT" - copyright: 0 - path: "project/file1.java" - start_line: 1 - end_line: 1 - scan_result: 1 - path_excludes: - - 1 - - type: "LICENSE" - license: 4 - path: "project/file1.java" - start_line: 1 - end_line: 2 - scan_result: 1 - path_excludes: - - 1 - - type: "LICENSE" - license: 4 - path: "project/file2.java" - start_line: 1 - end_line: 2 - scan_result: 1 - path_excludes: - - 1 - is_excluded: true - path_excludes: - - 0 - _id: 3 id: "Ant:junit:junit:4.12" is_project: false @@ -717,75 +738,75 @@ packages: paths: - _id: 0 pkg: 3 - project: 0 + project: 1 scope: 1 path: [] - _id: 1 pkg: 4 - project: 0 + project: 1 scope: 1 path: - 3 - _id: 2 pkg: 5 - project: 0 + project: 1 scope: 1 path: - 3 - _id: 3 pkg: 6 - project: 0 + project: 1 scope: 0 path: - - 1 + - 2 - _id: 4 pkg: 6 - project: 0 + project: 1 scope: 1 path: - 9 - - 1 + - 2 - _id: 5 - pkg: 1 - project: 0 + pkg: 2 + project: 1 scope: 0 path: [] - _id: 6 - pkg: 1 - project: 0 + pkg: 2 + project: 1 scope: 1 path: - 9 - _id: 7 pkg: 8 - project: 0 + project: 1 scope: 1 path: - 3 - _id: 8 pkg: 9 - project: 0 + project: 1 scope: 0 path: [] - _id: 9 pkg: 9 - project: 0 + project: 1 scope: 1 path: [] dependency_trees: - key: 0 - pkg: 2 + pkg: 0 path_excludes: - 0 - key: 1 - pkg: 0 + pkg: 1 children: - key: 2 scope: 0 children: - key: 3 linkage: "DYNAMIC" - pkg: 1 + pkg: 2 children: - key: 4 linkage: "DYNAMIC" @@ -796,7 +817,7 @@ dependency_trees: children: - key: 6 linkage: "DYNAMIC" - pkg: 1 + pkg: 2 children: - key: 7 linkage: "DYNAMIC" @@ -825,7 +846,7 @@ dependency_trees: children: - key: 14 linkage: "DYNAMIC" - pkg: 1 + pkg: 2 children: - key: 15 linkage: "DYNAMIC" @@ -847,7 +868,7 @@ rule_violations: \ that overflow:scroll is working as expected.\n```" - _id: 1 rule: "rule 2" - pkg: 1 + pkg: 2 license: 3 license_source: "DECLARED" severity: "HINT" @@ -869,7 +890,7 @@ vulnerabilities_resolutions: [] vulnerabilities: - _id: 0 id: "VULCOID-VULNERABILITY_ID" - pkg: 1 + pkg: 2 summary: "summary text" description: "description text" references: @@ -888,10 +909,10 @@ statistics: rule_violation_resolutions: 1 vulnerability_resolutions: 0 open_issues: - errors: 1 + errors: 2 warnings: 0 hints: 0 - severe: 1 + severe: 2 open_rule_violations: errors: 1 warnings: 1 diff --git a/plugins/reporters/evaluated-model/src/funTest/assets/reporter-test-input.yml b/plugins/reporters/evaluated-model/src/funTest/assets/reporter-test-input.yml index bf9f6dd71981d..ce53862545e5b 100644 --- a/plugins/reporters/evaluated-model/src/funTest/assets/reporter-test-input.yml +++ b/plugins/reporters/evaluated-model/src/funTest/assets/reporter-test-input.yml @@ -479,6 +479,11 @@ scanner: path: "project/file1.java" start_line: 1 end_line: 1 + issues: + - timestamp: "2024-04-22T10:36:10.661544294Z" + source: "FakeScanner" + message: "ERROR: Timeout after 300 seconds while scanning file 'project/some/file.dat'." + affected_path: "project/some/file.dat" - provenance: vcs_info: type: "Git" @@ -529,6 +534,10 @@ scanner: \ Please make sure the published POM file includes the SCM connection, see:\ \ https://docs.gradle.org/current/userguide/publishing_maven.html#sec:modifying_the_generated_pom" severity: "ERROR" + - timestamp: "2024-04-22T10:36:10.661544294Z" + source: "FakeScanner" + message: "ERROR: Timeout after 300 seconds while scanning file 'analyzer/src/funTest/assets/projects/synthetic/gradle/lib/another/file.dat'." + affected_path: "analyzer/src/funTest/assets/projects/synthetic/gradle/lib/another/file.dat" - provenance: source_artifact: url: "https://repo.maven.apache.org/maven2/com/h2database/h2/1.4.200/h2-1.4.200-sources.jar" diff --git a/plugins/reporters/opossum/src/funTest/assets/reporter-test-input.yml b/plugins/reporters/opossum/src/funTest/assets/reporter-test-input.yml index bf9f6dd71981d..ce53862545e5b 100644 --- a/plugins/reporters/opossum/src/funTest/assets/reporter-test-input.yml +++ b/plugins/reporters/opossum/src/funTest/assets/reporter-test-input.yml @@ -479,6 +479,11 @@ scanner: path: "project/file1.java" start_line: 1 end_line: 1 + issues: + - timestamp: "2024-04-22T10:36:10.661544294Z" + source: "FakeScanner" + message: "ERROR: Timeout after 300 seconds while scanning file 'project/some/file.dat'." + affected_path: "project/some/file.dat" - provenance: vcs_info: type: "Git" @@ -529,6 +534,10 @@ scanner: \ Please make sure the published POM file includes the SCM connection, see:\ \ https://docs.gradle.org/current/userguide/publishing_maven.html#sec:modifying_the_generated_pom" severity: "ERROR" + - timestamp: "2024-04-22T10:36:10.661544294Z" + source: "FakeScanner" + message: "ERROR: Timeout after 300 seconds while scanning file 'analyzer/src/funTest/assets/projects/synthetic/gradle/lib/another/file.dat'." + affected_path: "analyzer/src/funTest/assets/projects/synthetic/gradle/lib/another/file.dat" - provenance: source_artifact: url: "https://repo.maven.apache.org/maven2/com/h2database/h2/1.4.200/h2-1.4.200-sources.jar" diff --git a/plugins/reporters/static-html/src/funTest/assets/reporter-test-input.yml b/plugins/reporters/static-html/src/funTest/assets/reporter-test-input.yml index bf9f6dd71981d..ce53862545e5b 100644 --- a/plugins/reporters/static-html/src/funTest/assets/reporter-test-input.yml +++ b/plugins/reporters/static-html/src/funTest/assets/reporter-test-input.yml @@ -479,6 +479,11 @@ scanner: path: "project/file1.java" start_line: 1 end_line: 1 + issues: + - timestamp: "2024-04-22T10:36:10.661544294Z" + source: "FakeScanner" + message: "ERROR: Timeout after 300 seconds while scanning file 'project/some/file.dat'." + affected_path: "project/some/file.dat" - provenance: vcs_info: type: "Git" @@ -529,6 +534,10 @@ scanner: \ Please make sure the published POM file includes the SCM connection, see:\ \ https://docs.gradle.org/current/userguide/publishing_maven.html#sec:modifying_the_generated_pom" severity: "ERROR" + - timestamp: "2024-04-22T10:36:10.661544294Z" + source: "FakeScanner" + message: "ERROR: Timeout after 300 seconds while scanning file 'analyzer/src/funTest/assets/projects/synthetic/gradle/lib/another/file.dat'." + affected_path: "analyzer/src/funTest/assets/projects/synthetic/gradle/lib/another/file.dat" - provenance: source_artifact: url: "https://repo.maven.apache.org/maven2/com/h2database/h2/1.4.200/h2-1.4.200-sources.jar" diff --git a/plugins/reporters/static-html/src/funTest/assets/static-html-reporter-test-expected-output.html b/plugins/reporters/static-html/src/funTest/assets/static-html-reporter-test-expected-output.html index a23a13065f75c..bba76702e72b7 100644 --- a/plugins/reporters/static-html/src/funTest/assets/static-html-reporter-test-expected-output.html +++ b/plugins/reporters/static-html/src/funTest/assets/static-html-reporter-test-expected-output.html @@ -454,7 +454,7 @@

Labels

Index