Skip to content

Introduce Independent License Clarity Thresholds Mechanism #1689

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

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

NucleonGodX
Copy link

@NucleonGodX NucleonGodX commented Jun 12, 2025

Fixes #1678

Summary of Changes

This pull request introduces a new module for managing license clarity thresholds:

About the policies.yml Structure for License Clarity Thresholds
The policies.yml file is a YAML configuration used to define various compliance policies for ScanCode.io and related tools. With these changes, a new section called license_clarity_thresholds is introduced specifically for clarity score compliance.

Example policies.yml for clarity thresholds:

license_clarity_thresholds:
  80: ok        # Scores 80 and above are 'ok'
  50: warning   # Scores 50 to 79 are 'warning'
  # Scores below 50 are automatically considered 'error'

  • Validation of threshold policy structure:

    • Keys must be integers
    • Values must be one of: ok, warning, error
    • No duplicate thresholds
    • Thresholds must be in strictly descending order
  • Evaluation logic for mapping clarity scores to compliance alerts (ok, warning, error)

  • Comprehensive test suite covering:

    • Valid and invalid YAML configurations
    • Duplicate and unordered thresholds
    • Single and multiple thresholds

Note: This module is self-contained and not yet integrated into the main compliance or project logic. It is intended for review and further development.

Future Work

  • Integration with summary generation to include clarity compliance alerts in outputs
  • UI and reporting integration to show clarity compliance results alongside existing license compliance alerts
  • Documentation updates to guide users on configuring and using license clarity thresholds in policies.yml

Signed-off-by: NucleonGodX <racerpro41@gmail.com>
Signed-off-by: NucleonGodX <racerpro41@gmail.com>
Signed-off-by: NucleonGodX <racerpro41@gmail.com>
@NucleonGodX
Copy link
Author

Changes Made:
Renamed policies.py → license_policies.py.
Created independent license_clarity.py module which works independently
Added comprehensive test coverage for both modules

Next Steps:
The next steps would be integrating it to be added to the summary generation after the scan single package pipeline, and also storing it as extra_data and displaying it in the UI, and adding it to check compliance so that it can be integrated in CI directly.(All this already discussed in the weekly meet)

Copy link
Contributor

@tdruez tdruez left a comment

Choose a reason for hiding this comment

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

@NucleonGodX The code changes look fine in general.
Make sure to run make valid to fix the code format before a commit (currently failing the CI)

Renamed policies.py → license_policies.py.

This is out of scope and unneeded for now. Please revert this part and keep the PR focus on the "License Clarity" implementation.
If another module needs a rename, it needs to be discussed and handled separately as it may break external usage and dependencies on that module.

Signed-off-by: NucleonGodX <racerpro41@gmail.com>
Signed-off-by: NucleonGodX <racerpro41@gmail.com>
@NucleonGodX
Copy link
Author

Thanks for the suggestions, I've applied them @tdruez

@tdruez
Copy link
Contributor

tdruez commented Jun 23, 2025

@NucleonGodX LGTM!
@pombredanne can you have a look before the merge?

Next Steps:
The next steps would be integrating it to be added to the summary generation after the scan single package pipeline, and > also storing it as extra_data and displaying it in the UI, and adding it to check compliance so that it can be integrated in CI > directly.(All this already discussed in the weekly meet)

Sounds like a plan!

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

Successfully merging this pull request may close these issues.

Add license clarity score-based Compliance support
2 participants