-
Notifications
You must be signed in to change notification settings - Fork 314
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SpdxDocumentFile: Report issues from subprojects that cannot be mapped to a package ID. #8851
SpdxDocumentFile: Report issues from subprojects that cannot be mapped to a package ID. #8851
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #8851 +/- ##
============================================
+ Coverage 67.54% 67.63% +0.08%
- Complexity 1166 1167 +1
============================================
Files 244 244
Lines 7775 7780 +5
Branches 865 866 +1
============================================
+ Hits 5252 5262 +10
+ Misses 2167 2161 -6
- Partials 356 357 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
d5f09b6
to
7babf76
Compare
plugins/package-managers/spdx/src/funTest/kotlin/SpdxDocumentFileFunTest.kt
Fixed
Show fixed
Hide fixed
plugins/package-managers/spdx/src/funTest/kotlin/SpdxDocumentFileFunTest.kt
Fixed
Show fixed
Hide fixed
plugins/package-managers/spdx/src/funTest/kotlin/SpdxDocumentFileFunTest.kt
Fixed
Show fixed
Hide fixed
2a46c29
to
882eea0
Compare
db036d3
to
6999b77
Compare
plugins/package-managers/spdx/src/funTest/kotlin/SpdxDocumentFileFunTest.kt
Outdated
Show resolved
Hide resolved
plugins/package-managers/spdx/src/funTest/kotlin/SpdxDocumentFileFunTest.kt
Outdated
Show resolved
Hide resolved
plugins/package-managers/spdx/src/main/kotlin/utils/SpdxResolvedDocument.kt
Outdated
Show resolved
Hide resolved
plugins/package-managers/spdx/src/main/kotlin/utils/SpdxResolvedDocument.kt
Outdated
Show resolved
Hide resolved
plugins/package-managers/spdx/src/main/kotlin/utils/SpdxResolvedDocument.kt
Outdated
Show resolved
Hide resolved
762e91a
to
f6e27e9
Compare
plugins/package-managers/spdx/src/main/kotlin/utils/SpdxResolvedDocument.kt
Outdated
Show resolved
Hide resolved
f6e27e9
to
7b47460
Compare
* Retrieve the issues from [issuesByReferenceId] that are not associated with [any package][packagesById]. These | ||
* issues can be related to general issues within the SPDX document. | ||
*/ | ||
fun getIssuesWithoutSpdxPackage() = issuesByReferenceId.mapNotNull { (id, issue) -> |
Check warning
Code scanning / detekt
Format signature to be single when possible, multiple lines otherwise. Warning
7b47460
to
4ffac63
Compare
4ffac63
to
6ec315d
Compare
@@ -16,7 +16,7 @@ externalDocumentRefs: | |||
spdxDocument: "./subproject/subproject-with-conan-reference.spdx.yml" | |||
checksum: | |||
algorithm: "SHA1" | |||
checksumValue: "53840294281f7d1bf401b746162da11dcf9306eb" | |||
checksumValue: "032a087b0da8f353c03671a72179b807b4ec7eb3" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe we have tests for SpdxResolvedDocument
in place that verify the checksum, so please explain in the commit message how this could have been wrong.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried to explain it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, thanks. Let me try to rephrase that for my understanding: The checksum was always wrong, but that fact did not result in an issue or test failure until the previous commit. Now that issues are properly propagated, it would result in a test failure of SpdxDocumentFileFunTest
whose expected result files contain no issues. Correct?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Correct.
Add synthetic project and an associated test to verify that issues from an external document ref are added to the result. Signed-off-by: Marcel Bochtler <[email protected]>
Ensure that issues added in `getSpdxPackageForId()` are not dropped, but rather added to the resulting `PackageReference`. Signed-off-by: Marcel Bochtler <[email protected]>
Before, issues from external document refs, which could not be mapped to a `packageId`, failed to be added as issue in the ORT result. Add these missing transitive issues, by explicitly check for any issues that are not related to known packages. Signed-off-by: Marcel Bochtler <[email protected]>
As the issue is caused by an external document reference, it wasn't reported as an issue. The previous commit fixes this issue. Therefore, fix the checksum to keep the correct expected result for the `SpdxDocumentFileFunTest`. Signed-off-by: Marcel Bochtler <[email protected]>
6ec315d
to
43c2fa4
Compare
Please ensure that your pull request adheres to our contribution guidelines. Thank you!