Skip to content

Follow license reference to another file - #2616

Merged
pombredanne merged 7 commits into
aboutcode-org:developfrom
akugarg:follow_reference
Aug 27, 2021
Merged

Follow license reference to another file#2616
pombredanne merged 7 commits into
aboutcode-org:developfrom
akugarg:follow_reference

Conversation

@akugarg

@akugarg akugarg commented Jul 30, 2021

Copy link
Copy Markdown
Contributor

Signed-off-by: akugarg akanksha.garg2k@gmail.com

Fixes #1364

Tasks

  • Reviewed contribution guidelines
  • PR is descriptively titled 📑 and links the original issue above 🔗
  • Tests pass -- look for a green checkbox ✔️ a few minutes after opening your PR
    Run tests locally to check for errors.
  • Commits are in uniquely-named feature branch and has no merge conflicts 📁

akugarg added 2 commits July 30, 2021 00:11
Signed-off-by: akugarg <akanksha.garg2k@gmail.com>
Signed-off-by: akugarg <akanksha.garg2k@gmail.com>
@akugarg

akugarg commented Aug 3, 2021

Copy link
Copy Markdown
Contributor Author

Hey! @AyanSinhaMahapatra How we will go about adding same logic for packagecode like we discussed yesterday?

Comment thread src/licensedcode/plugin_license.py
Comment thread src/licensedcode/plugin_license.py Outdated
Comment thread src/licensedcode/plugin_license.py Outdated
Comment thread tests/licensedcode/test_plugin_license.py
Comment thread tests/licensedcode/data/plugin_license/license_reference/scan/license-notice.txt Outdated
Comment thread src/licensedcode/plugin_license.py Outdated
Comment thread src/licensedcode/plugin_license.py Outdated
Comment thread src/licensedcode/plugin_license.py Outdated
Comment thread src/licensedcode/plugin_license.py
Comment thread src/licensedcode/plugin_license.py
@AyanSinhaMahapatra

Copy link
Copy Markdown
Member

Also, for packagedcode, say for npm, see here. We have a function converting a list of license declarations to a license-expression. It would have been ideal if we return some form of License Detections here instead of just the expressions (which is WIP), but in a short term we could check first for these kind of license references to file (and report only the license conclusion without the unknown).

Comment thread src/licensedcode/plugin_license.py Outdated
Signed-off-by: akugarg <akanksha.garg2k@gmail.com>
@akugarg
akugarg force-pushed the follow_reference branch 2 times, most recently from 3200da4 to d4f1436 Compare August 14, 2021 09:09
@akugarg

akugarg commented Aug 14, 2021

Copy link
Copy Markdown
Contributor Author

@AyanSinhaMahapatra @pombredanne Please have a look!
Also Can we keep the reference part for npm pacakges in a different PR from this one ?

Comment thread src/licensedcode/plugin_license.py Outdated
Comment thread src/licensedcode/plugin_license.py Outdated
Comment thread src/licensedcode/plugin_license.py Outdated
Comment thread src/licensedcode/plugin_license.py Outdated
Comment thread src/licensedcode/plugin_license.py Outdated
Comment thread src/licensedcode/plugin_license.py Outdated

@pombredanne pombredanne left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! beside the review comments, I would also like to see some unit tests for find_reference_licenses

Comment thread src/licensedcode/plugin_license.py Outdated
Comment thread src/licensedcode/plugin_license.py Outdated
Comment thread src/licensedcode/plugin_license.py Outdated
Comment thread src/licensedcode/plugin_license.py Outdated
Comment thread src/licensedcode/plugin_license.py Outdated
Comment thread src/licensedcode/plugin_license.py Outdated
Comment thread src/licensedcode/plugin_license.py Outdated
Comment thread src/licensedcode/plugin_license.py Outdated
Comment thread src/licensedcode/plugin_license.py
Comment thread src/licensedcode/plugin_license.py Outdated
@akugarg
akugarg force-pushed the follow_reference branch 2 times, most recently from d478c25 to 10385da Compare August 15, 2021 11:44
Comment thread src/licensedcode/plugin_license.py Outdated
Signed-off-by: akugarg <akanksha.garg2k@gmail.com>

@pombredanne pombredanne left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have a few final review items for you. Thanks!

Comment thread src/licensedcode/plugin_license.py
Comment thread src/licensedcode/plugin_license.py Outdated
Comment thread src/licensedcode/plugin_license.py Outdated
Comment thread src/licensedcode/plugin_license.py Outdated
Signed-off-by: akugarg <akanksha.garg2k@gmail.com>
Comment thread src/licensedcode/plugin_license.py Outdated
Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>

@pombredanne pombredanne left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM... Thank you ++

@pombredanne
pombredanne merged commit cee6d68 into aboutcode-org:develop Aug 27, 2021
@pombredanne pombredanne mentioned this pull request Aug 27, 2021
4 tasks
@akugarg
akugarg deleted the follow_reference branch August 27, 2021 14:16
pombredanne added a commit that referenced this pull request Aug 29, 2021
Only follow license references match an exact filename
In #2616 we introduced matching path of referenced_filenames
based on matching filename or path suffix. This removes path suffix
matching which is problematic.

Before this we were using .endswith(path) and this led to weird and
incorrect license dereferences

Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Follow references to license in another file: ScanCode reports the "SEE LICENSE IN <filename>" text in an NPM package.json as "Unkown"

3 participants