Skip to content

Fix masked license validation test names (#5257) - #5263

Open
harishwargad wants to merge 5 commits into
aboutcode-org:developfrom
harishwargad:fix/unique-license-validation-tests
Open

harishwargad wants to merge 5 commits into
aboutcode-org:developfrom
harishwargad:fix/unique-license-validation-tests

Conversation

@harishwargad

@harishwargad harishwargad commented Aug 12, 2026 •

Copy link
Copy Markdown

Fixes #5257

Summary

This PR addresses issue #5257 where license rule file pairs mapped to the exact same dynamically generated Python validation test method names (e.g., cnri-python-1.6.1.RULE and cnri-python-1.6_1.RULE both producing cnri_python_1_6_1_rule), causing tests to overwrite/mask each other during dynamic test generation.

Building on the initial test setup from stale PR #5258, this PR completes the rule file renames.

Changes Made

  • Renamed cnri-python-1.6_1.RULE -> cnri-python-1.6-v1.RULE and proprietary_10.RULE -> proprietary_10_alt.RULE using git mv so generated safe Python method names are unique.
  • Added a regression test in tests/licensedcode/test_rule_file_names.py to ensure all rule file names generate unique safe Python method names in the future.
  • Updated CHANGELOG.rst and AUTHORS.rst.

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 📁
  • Updated documentation pages (if applicable)
  • Updated CHANGELOG.rst (if applicable)

Signed-off-by: @harishwargad

Signed-off-by: harishwargad <harishwargad@gmail.com>

@AyanSinhaMahapatra AyanSinhaMahapatra 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 @harishwargad see comments for changes

Signed-off-by: harishwargad <harishwargad@gmail.com>
@harishwargad
harishwargad force-pushed the fix/unique-license-validation-tests branch from e71c0f1 to 549666f Compare August 29, 2026 14:38
@harishwargad

Copy link
Copy Markdown
Author

Hi @AyanSinhaMahapatra,

Thanks for reviewing! I've updated the PR with your requested changes:

  1. Reused rules_data_dir imported directly from licensedcode.models.
  2. Updated rule file renames to use numeric suffixes (cnri-python-1.6_19.RULE and proprietary_155.RULE).
  3. Simplified the test assertion using a direct list comprehension.

All local pytest checks are passing cleanly. Ready for your review!

@harishwargad

Copy link
Copy Markdown
Author

Hello @AyanSinhaMahapatra, just wanted to drop a gentle reminder.

The requested changes have been implemented!

@Shriprasad-P Shriprasad-P left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Review

PR: Fix masked license validation test names (#5257)

Touched: AUTHORS.rst, CHANGELOG.rst, src/licensedcode/data/rules/cnri-python-1.6_19.RULE, src/licensedcode/data/rules/proprietary_155.RULE, tests/licensedcode/test_rule_file_names.py

  • Addresses a concrete correctness/reliability issue based on the title and diff.
  • Includes or touches tests — good for locking the behavior.
  • Size looks manageable (+27/-0).

Commenting as a drive-by reviewer after reading the diff. Happy to look again if maintainers want a deeper pass on a specific file.

@harishwargad

Copy link
Copy Markdown
Author

Thank you @Shriprasad-P for the review =)

Copilot AI balanced review requested due to automatic review settings September 29, 2026 03:31

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@harishwargad
harishwargad requested a balanced review from Copilot November 19, 2026 18:07

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

@harishwargad

Copy link
Copy Markdown
Author

Hi @AyanSinhaMahapatra ,

Gentle ping on this when you get a moment to review!

All changes requested earlier are in place, and 31/33 CI checks are passing. I looked into the remaining failure in license_validate_ignorables_2 and confirmed it comes from an upstream rule (src/licensedcode/data/rules/fsl-1.1_2.RULE from commit 9eaa41d90c, missing ignorable_urls) rather than the files touched in this PR.

Happy to sync the branch once develop updates, or make any further adjustments you'd like. Thanks!

This branch has not been deployed

No deployments
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.

Some license test files are masking each other

4 participants