-
-
Notifications
You must be signed in to change notification settings - Fork 551
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 bug at following package license references #3970
base: develop
Are you sure you want to change the base?
Conversation
Reference: #3969 Signed-off-by: Ayan Sinha Mahapatra <[email protected]>
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.
With a test, this is good to go!
@@ -140,6 +140,9 @@ def add_referenced_license_matches_for_package(resource, codebase): | |||
): | |||
continue | |||
|
|||
if not (referenced_resource and referenced_resource.license_detections): |
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.
Actually, referenced_resource is referenced below outside of this loop and may not exists at all.
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.
referenced_resource needs some love after all :)
@@ -314,15 +317,15 @@ def add_referenced_filenames_license_matches_for_detections(resource, codebase): | |||
referenced_license_expression=referenced_license_expression, | |||
license_detection=license_detection, | |||
): | |||
if TRACE_REFERENCE: | |||
if TRACE_REFERENCE and referenced_resource: |
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.
referenced_resource is declared in another scope, which may be a problem. You may want to track referenced_resources_with_detections
as a list of Resource rather than referenced_detections
so you can:
- debug trace as needed
- account for when you have more than one file referenced.
Fixes #3969
Tasks
Run tests locally to check for errors.