-
Notifications
You must be signed in to change notification settings - Fork 20
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
Fix logic error in get_components_without_suppliers #176
Fix logic error in get_components_without_suppliers #176
Conversation
Only the supplier field should be checked to determine if the supplier field is missing a value. Previously the code checked both the supplier and the originator fields, on the mistaken assumption that either field counted as the package supplier. Signed-off-by: John Speed Meyers <[email protected]>
no_package_originator = package.originator is None or isinstance( | ||
package.originator, SpdxNoAssertion | ||
) |
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.
This is the critical logic change.
# both package supplier and package originator satisfy the "supplier" | ||
# requirement | ||
# https://spdx.github.io/spdx-spec/v2.3/package-information/#76-package-originator-field |
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 removed this erroneous comment.
# requirement | ||
# https://spdx.github.io/spdx-spec/v2.3/package-information/#76-package-originator-field | ||
no_package_supplier = package.supplier is None or isinstance( | ||
no_supplier = package.supplier is None or isinstance( |
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 simplified the variable naming here, changing no_package_supplier
to no_supplier
"originator" : "Organization: ExampleCodeInspect ([email protected])", | ||
"originator" : "NOASSERTION", |
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.
These changes exemplify the test suite changes I made over and over. I removed the originator value, changing it to "NOASSERTION" and did provide a value for supplier.
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.
LGTM - Thanks @jspeed-meyers
Fix #157
Only the supplier field should be checked to determine if the supplier field is missing a value. Previously the code checked both the supplier and the originator fields, on the mistaken assumption that either field counted as the package supplier. Oops.
THIS IS A BREAKING CHANGE.
I revised the test suite substantially since this was a logic error. Many test SBOM documents needed a minor tweak.