Improve License Clarity at Top Package Level#3792
Improve License Clarity at Top Package Level#3792swastkk wants to merge 60 commits intoaboutcode-org:developfrom
Conversation
Signed-off-by: swastik <[email protected]>
Signed-off-by: swastik <[email protected]>
Signed-off-by: swastik <[email protected]>
AyanSinhaMahapatra
left a comment
There was a problem hiding this comment.
@swastkk you are regenerating all the tests with useless churn. This adds more things to review and is not ideal. Let's do things differently. You can delete your last commit and push regenerated test fixtures for only the tests which were failing.
...agedcode/data/alpine/apkbuild-problems/alpine14/community/ksshaskpass/APKBUILD-expected.json
Outdated
Show resolved
Hide resolved
c5791ba to
fa8fcfc
Compare
Signed-off-by: swastik <[email protected]>
fa8fcfc to
64957ec
Compare
|
@swastkk this is not correct atm:
This new plugin could be there in |
Signed-off-by: swastik <[email protected]>
AyanSinhaMahapatra
left a comment
There was a problem hiding this comment.
Does this make sure the license_clarity_score attribute is added only on using the --summary-package command line option? No. Look at your test regenerations, none of these tests have this option enabled, still have this attribute added.
You have to pass the package_summary option like we have the package_only CLI option here: https://github.com/nexB/scancode-toolkit/blob/develop/src/packagedcode/plugin_package.py#L203, then further pass it down to create_package_and_deps at https://github.com/nexB/scancode-toolkit/blob/develop/src/packagedcode/plugin_package.py#L263 and further to package.to_dict() at https://github.com/nexB/scancode-toolkit/blob/develop/src/packagedcode/plugin_package.py#L367 to actually be able to correctly set the attribute package_summary at https://github.com/swastkk/scancode-toolkit/blob/improve-license-clarity/src/packagedcode/models.py#L1544 you added thorugh this PR. Otherwise it's always set to one value.
…mary as Postscan Plugin Signed-off-by: swastik <[email protected]>
AyanSinhaMahapatra
left a comment
There was a problem hiding this comment.
More changes required.
Please merge latest develop afterwards.
...an/copyright/debian-slim-2021-04-07/usr/share/doc/gcc-9-base/copyright-detailed.expected.yml
Outdated
Show resolved
Hide resolved
tests/summarycode/data/package_summary/basic-plugin-testing/codebase/src/a.py
Outdated
Show resolved
Hide resolved
tests/summarycode/data/package_summary/basic-plugin-testing/expected.json
Outdated
Show resolved
Hide resolved
…inor changes Signed-off-by: swastik <[email protected]>
Signed-off-by: swastik <[email protected]>
Signed-off-by: swastik <[email protected]>
eb60d58 to
9da7f6e
Compare
AyanSinhaMahapatra
left a comment
There was a problem hiding this comment.
See comments above. And sup on populating license clarity and other attributes?
...kage_summary/change-case-change-case-5.4.4.zip-extract/change-case-change-case-5.4.4/LICENSE
Show resolved
Hide resolved
...e-change-case-5.4.4.zip-extract/change-case-change-case-5.4.4/packages/change-case/README.md
Outdated
Show resolved
Hide resolved
...change-case-5.4.4.zip-extract/change-case-change-case-5.4.4/packages/change-case/src/keys.ts
Outdated
Show resolved
Hide resolved
Signed-off-by: swastik <[email protected]>
Signed-off-by: swastik <[email protected]>
…utcode-org#3817 Signed-off-by: swastik <[email protected]>
Signed-off-by: swastik <[email protected]>
…arity_score aboutcode-org#3817 Signed-off-by: swastik <[email protected]>
…e(Without other_license_detections) Signed-off-by: swastik <[email protected]>
Signed-off-by: swastik <[email protected]>
Signed-off-by: swastik <[email protected]>
Signed-off-by: swastik <[email protected]>
Signed-off-by: swastik <[email protected]>
…de-org#3889 Signed-off-by: swastik <[email protected]>
…de-org#3889 Signed-off-by: swastik <[email protected]>
Signed-off-by: swastik <[email protected]>
Signed-off-by: swastik <[email protected]>
Signed-off-by: swastik <[email protected]>
Signed-off-by: swastik <[email protected]>
AyanSinhaMahapatra
left a comment
There was a problem hiding this comment.
@swastkk See comments and another comment I made above which is still unresolved.
Signed-off-by: swastik <[email protected]>
… license-clarity-score plugins Signed-off-by: swastik <[email protected]>
Signed-off-by: swastik <[email protected]>
Signed-off-by: swastik <[email protected]>
AyanSinhaMahapatra
left a comment
There was a problem hiding this comment.
@swastkk you've made changes to the get_field_values_from_resources to send a resources list and not codebase object correctly, but note that we are still not sending anything in score.py: https://github.com/swastkk/scancode-toolkit/blob/improve-license-clarity/src/summarycode/score.py#L78 which would not work effectively if we run only the score option without summary.
You seem to be failing the tests for the same reason, please fix this part. You should be passing all tests to make sure no previous functionality is breaking in this refactor of the compute_license_score to suit the new plugin you're writing.
One minor thing:
The get_codebase_resources seems okay in summarizer.py but we are using dicts: https://github.com/swastkk/scancode-toolkit/blob/improve-license-clarity/src/summarycode/summarizer.py#L323, we should use resource objects here, and also in get_field_values_from_resources we should use resource objects, not list of resource dicts (this means wherever we have resource dicts, we should convert them to Resource objects first and then send in these functions)
Signed-off-by: swastik <[email protected]>
Signed-off-by: swastik <[email protected]>
Signed-off-by: swastik <[email protected]>
Signed-off-by: swastik <[email protected]>
|
Good example to test for: #4422 |
Signed-off-by: Swastik Sharma <[email protected]>
Fixes #3802
Tasks
Run tests locally to check for errors.
Signed-off-by: swastkk [email protected]