Skip to content

Add workaround for files with permissive binary licenses #13847

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

Merged
merged 2 commits into from
Nov 10, 2020

Conversation

harmut01
Copy link
Contributor

@harmut01 harmut01 commented Nov 3, 2020

Summary of changes

Fixes #13840

Add function for checking that files with Permissive Binary Licenses are not erroneously flagged as missing permissive licenses. Scancode does not currently have our license in its database as PBL is not a recognized SPDX license. This is a temporary solution until we are able to get the license into a scancode toolkit release.

  • adds function has_binary_license to determine if a file has a PBL license
  • changes condition in SPDX check branch to ensure that files with PBL are analysed, eventually marked as SPDX and not non-permissive-licenses

Impact of changes

Affects CI, files with PBL licenses

Migration actions required

None

Documentation

None


Pull request type

[x] Patch update (Bug fix / Target update / Docs update / Test update / Refactor)
[] Feature update (New feature / Functionality change / New API)
[] Major update (Breaking change E.g. Return code change / API behaviour change)

Test results

[] No Tests required for this change (E.g docs only update)
[] Covered by existing mbed-os tests (Greentea or Unittest)
[x] Tests / results supplied as part of this PR

Reviewers


@0xc0170 @hugueskamba @ARMmbed/mbed-os-maintainers

@0xc0170 0xc0170 requested review from hugueskamba and a team November 3, 2020 15:30
Add function "has_binary_license" to check if a file has a non-permissive license contains one. PBL is not recognized by scancode,
causing it to be flagged as a non-permissive license. CI doesn't allow
any non-permissive licenses, although, files flageed as SPDX are
allowed. Workaround causes all files with a valid PBL to be flagged as
missing an SPDX.

Add condition in "has_spdx_text_in_scancode_output" to ignore any spdx
identifier with "unknown" in the name. Scancode erroneously matches PBL to matched_rule.identifer "spdx-license-identifier: unknown-spdx". This prevents the workaround from working.
0xc0170
0xc0170 previously approved these changes Nov 4, 2020
@harmut01
Copy link
Contributor Author

harmut01 commented Nov 5, 2020

@hugueskamba I've pushed new changes that should address some of your points.

@0xc0170 0xc0170 added the release-type: patch Indentifies a PR as containing just a patch label Nov 5, 2020
@mergify mergify bot dismissed stale reviews from 0xc0170 and hugueskamba November 6, 2020 09:51

Pull request has been modified.

@harmut01 harmut01 force-pushed the pbl_scancode_fix branch 2 times, most recently from 74ab164 to 224d87a Compare November 6, 2020 11:34
@harmut01
Copy link
Contributor Author

harmut01 commented Nov 6, 2020

@hugueskamba @0xc0170 please see the latest changes for your review.

0xc0170
0xc0170 previously approved these changes Nov 6, 2020
@mergify mergify bot dismissed 0xc0170’s stale review November 6, 2020 15:50

Pull request has been modified.

@harmut01 harmut01 requested a review from hugueskamba November 6, 2020 15:53
Add function "has_binary_license" to check if a file has a
non-permissive license contains one. PBL is not recognized by scancode,
causing it to be flagged as a non-permissive license. CI doesn't allow
any non-permissive licenses, although, files flageed as SPDX are
allowed. Workaround causes all files with a valid PBL to be flagged as
missing an SPDX.

Add condition in "has_spdx_text_in_scancode_output" to ignore any spdx
identifier with "unknown" in the name. Scancode erroneously matches PBL
to matched_rule.identifer "spdx-license-identifier: unknown-spdx". This
prevents the workaround from working.
@harmut01 harmut01 requested a review from 0xc0170 November 6, 2020 17:36
@0xc0170
Copy link
Contributor

0xc0170 commented Nov 10, 2020

CI started

@mbed-ci
Copy link

mbed-ci commented Nov 10, 2020

Jenkins CI Test : ✔️ SUCCESS

Build Number: 1 | 🔒 Jenkins CI Job | 🌐 Logs & Artifacts

CLICK for Detailed Summary

jobs Status
jenkins-ci/mbed-os-ci_unittests ✔️
jenkins-ci/mbed-os-ci_build-greentea-GCC_ARM ✔️
jenkins-ci/mbed-os-ci_build-cloud-example-ARM ✔️
jenkins-ci/mbed-os-ci_build-cloud-example-GCC_ARM ✔️
jenkins-ci/mbed-os-ci_build-example-ARM ✔️
jenkins-ci/mbed-os-ci_build-example-GCC_ARM ✔️
jenkins-ci/mbed-os-ci_build-greentea-ARM ✔️
jenkins-ci/mbed-os-ci_cmake-example-ARM ✔️
jenkins-ci/mbed-os-ci_cmake-example-GCC_ARM ✔️
jenkins-ci/mbed-os-ci_greentea-test ✔️
jenkins-ci/mbed-os-ci_cmake-example-test ✔️
jenkins-ci/mbed-os-ci_dynamic-memory-usage ✔️
jenkins-ci/mbed-os-ci_cloud-client-pytest ✔️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

scancode: missing our pbl license in scanning the licenses
6 participants