-
-
Notifications
You must be signed in to change notification settings - Fork 563
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
Combine license matches in new LicenseDetection #2961
Conversation
Signed-off-by: Ayan Sinha Mahapatra <[email protected]>
Remove primary license expression attributes, move matches to last. Signed-off-by: Ayan Sinha Mahapatra <[email protected]>
Move the LicenseMatch serialization functions into the LicenseDetection function. Signed-off-by: Ayan Sinha Mahapatra <[email protected]>
Create LicenseDetection functions and enable them in the API. Signed-off-by: Ayan Sinha Mahapatra <[email protected]>
Removes the unknown licenses CLI option, as this should be default behaviour. Signed-off-by: Ayan Sinha Mahapatra <[email protected]>
Update local unknown license reference code to use LicenseDetection functions. Signed-off-by: Ayan Sinha Mahapatra <[email protected]>
This updates the unknown license dereferencing code to also look for the referenced filename in root of the codebase. Signed-off-by: Ayan Sinha Mahapatra <[email protected]>
Signed-off-by: Ayan Sinha Mahapatra <[email protected]>
Signed-off-by: Ayan Sinha Mahapatra <[email protected]>
Adds tests for: - unknown license intros - unknown local license references Signed-off-by: Ayan Sinha Mahapatra <[email protected]>
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.
Thanks! that's quite a piece of work! 🙇 I provided some comments, but I did not review everything just yet. Of note you should use LicenseMatch and objects everywhere and not carry around dictionaries of scan data.
Instead convert these at the boundaries as early as possible deserialized to objects.
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.
Here is some feedback on the format. We need to streamline this to the essence and avoid repeating details to remove noise when possible.
tests/licensedcode/data/plugin_license/license-expression/scan.expected.json
Outdated
Show resolved
Hide resolved
tests/licensedcode/data/plugin_license/license-expression/scan.expected.json
Outdated
Show resolved
Hide resolved
tests/licensedcode/data/plugin_license/license-expression/scan.expected.json
Outdated
Show resolved
Hide resolved
tests/licensedcode/data/plugin_license/license-expression/scan.expected.json
Outdated
Show resolved
Hide resolved
tests/licensedcode/data/plugin_license/license-expression/scan.expected.json
Outdated
Show resolved
Hide resolved
tests/licensedcode/data/plugin_license/license-expression/scan.expected.json
Outdated
Show resolved
Hide resolved
Updates implementation to address review comments. - Remove code that wasn't being used - Update docstrings - Use constants and Enums - Fix case where local reference can't be found - Move back constants to API - Modify test expectations - Other misc changes Signed-off-by: Ayan Sinha Mahapatra <[email protected]>
Also adds a test without the --license-references option. Signed-off-by: Ayan Sinha Mahapatra <[email protected]>
81d8fe1
to
cb4ac9e
Compare
LicenseMatch data now is based on a license-expression instead of a license key. Signed-off-by: Ayan Sinha Mahapatra <[email protected]>
Add new command line option to not inline license, licenseDB and license detection level information. Signed-off-by: Ayan Sinha Mahapatra <[email protected]>
Signed-off-by: Ayan Sinha Mahapatra <[email protected]>
Signed-off-by: Ayan Sinha Mahapatra <[email protected]>
Modify code to align to the LicenseDetection model everywhere. Signed-off-by: Ayan Sinha Mahapatra <[email protected]>
Signed-off-by: Ayan Sinha Mahapatra <[email protected]>
ff41366
to
6a91773
Compare
Signed-off-by: Ayan Sinha Mahapatra <[email protected]>
3516046
to
5826429
Compare
Modify and update spdx and other output plugins to use LicenseDetection output data format for licenses. Signed-off-by: Ayan Sinha Mahapatra <[email protected]>
e68f0de
to
3e68f76
Compare
* Rename `licenses` to `license_detections` * Rename `license_expressions` to `detected_license_expression` * Rename `spdx_license_expressions` to `detected_license_expression_spdx` Also fix other uses of these attributes around scancode. Signed-off-by: Ayan Sinha Mahapatra <[email protected]>
Signed-off-by: Ayan Sinha Mahapatra <[email protected]>
bfcc3ca
to
7d5c647
Compare
* in case of unknown references being present without top-level detected, dereference using license detections in legalese/readme files at codebase root. * add example cases from samba/samba, sugarlabs/physics, debian fusiondirectory, and paddlenlp as tests. Signed-off-by: Ayan Sinha Mahapatra <[email protected]>
efc985b
to
bb84c09
Compare
Signed-off-by: Ayan Sinha Mahapatra <[email protected]>
bb84c09
to
5b0efe4
Compare
f8c52f7
to
d34a134
Compare
Signed-off-by: Ayan Sinha Mahapatra <[email protected]>
d34a134
to
afd4025
Compare
Signed-off-by: Ayan Sinha Mahapatra <[email protected]>
Signed-off-by: Ayan Sinha Mahapatra <[email protected]>
* add a new attribute `rule_url` to LicenseMatch results. * deleted License attributes 'scancode_data_url' and 'scancode_text_url' and replaced them with a single License attribute 'scancode_url' * regen test expectations accordingly Signed-off-by: Ayan Sinha Mahapatra <[email protected]>
ca5b771
to
5de2744
Compare
Signed-off-by: Ayan Sinha Mahapatra <[email protected]>
Signed-off-by: Ayan Sinha Mahapatra <[email protected]>
replaces the `package` in referenced_filename with a temporary `INHERIT_LICENSE_FROM_PACKAGE` which will be removed later in favour of a flag. Signed-off-by: Ayan Sinha Mahapatra <[email protected]>
Signed-off-by: Ayan Sinha Mahapatra <[email protected]>
@pombredanne this is all ready! |
Signed-off-by: Ayan Sinha Mahapatra <[email protected]>
Signed-off-by: Philippe Ombredanne <[email protected]>
Signed-off-by: Ayan Sinha Mahapatra <[email protected]>
Signed-off-by: Philippe Ombredanne <[email protected]>
Signed-off-by: Philippe Ombredanne <[email protected]>
Signed-off-by: Philippe Ombredanne <[email protected]>
See #2878
Tasks
Run tests locally to check for errors.