Skip to content

Detect agpl-3.0_326 rule text as agpl-3.0-plus - #5336

Open
aishwary-dongre wants to merge 1 commit into
aboutcode-org:developfrom
aishwary-dongre:fix-5002-agpl-3.0-plus-rule
Open

aishwary-dongre wants to merge 1 commit into
aboutcode-org:developfrom
aishwary-dongre:fix-5002-agpl-3.0-plus-rule

Conversation

@aishwary-dongre

Copy link
Copy Markdown

Fixes #5002

Brief description

agpl-3.0_326.RULE grants the AGPL "either version 3 of the Licence, or (at your option) any later version", which is AGPL-3.0-or-later, but it declared license_expression: agpl-3.0. Any file matching this notice was reported as AGPL-3.0-only.

This PR:

  • sets the expression to agpl-3.0-plus
  • renames the rule to agpl-3.0-plus_311.RULE so the name matches the expression, as in other expression corrections such as 94a4d35. 311 is what find_rule_base_location('agpl-3.0-plus') returns. No code or test fixture refers to the old file name.
  • updates replaced_by in the deprecated agpl-3.0_330.RULE from agpl-3.0 to agpl-3.0-plus. That rule is the "license" spelling of the same notice, and it is detected through this one, so its expected detection changes with it. Without this, test_validate_detect_deprecated_agpl_3_0_330_rule fails.

Before / after

Matching the full rule text against a freshly built index:

rule expression
develop agpl-3.0_326.RULE agpl-3.0
this PR agpl-3.0-plus_311.RULE agpl-3.0-plus

About #5001

#5001 reported that the GIMP header app/widgets/gimpdashboard.h matched this rule. On current develop I could not reproduce that. The current upstream file is detected as gpl-3.0-plus via gpl-3.0-plus_60.RULE at 100% coverage, both before and after this change. So this PR fixes the rule named in #5002. I am not claiming it resolves #5001, which may already have been fixed by other rule changes.

Tests

With a license index rebuilt from this branch:

  • test_validate_detect_agpl_3_0_plus_311_rule and test_ignorables_in_rule_or_license_agpl_3_0_plus_311_rule pass
  • all 2194 AGPL-related tests in test_detection_validate.py pass (--test-suite=validate -k agpl)
  • all 1508 deprecated-rule tests pass (-k deprecated). This is the class of test a changed expression can break, which is how I found agpl-3.0_330.
  • tests/licensedcode/test_license_models.py: 50 passed

I did not run the full 76k-test validation suite locally, so I am relying on the license_validate_* CI shards for the rest.

Possibly related, out of scope

Two non-deprecated rules are word-for-word variants of this notice and look like the same bug. Their file names even say plus, but they declare agpl-3.0:

  • agpl-3.0-plus_4.RULE, the http:// variant of this exact text
  • agpl-3.0-plus_6.RULE

I have not changed them because #5002 is about _326 only. Their history is mixed too: agpl-3.0-plus_3 is deprecated with replaced_by: agpl-3.0-plus, while _5 and _7 point at agpl-3.0. So I would rather have a maintainer confirm the intent first. I am happy to include them here or open a follow-up.

AI generation disclosure

I used an AI assistant on this: finding the rule-naming convention in history, building the before/after detection check, running the validation tests, and drafting this description. I reviewed and verified every claim against the repository myself, and I can explain and defend the change. Flagging it since ScanCode states no policy either way.

Tasks

  • Reviewed contribution guidelines
  • PR is descriptively titled 📑 and links the original issue above 🔗
  • Tests pass (see above for what I ran locally and what I left to CI)
  • Commits are in uniquely-named feature branch and has no merge conflicts 📁
  • Signed off (DCO)
  • Updated documentation pages (not applicable)
  • Updated CHANGELOG.rst (not applicable, rule data only)

The text of agpl-3.0_326.RULE grants the GNU Affero General Public
Licence "either version 3 of the Licence, or (at your option) any later
version", which is AGPL-3.0-or-later, but the rule declared
license_expression: agpl-3.0. Any file matching this notice was reported
as AGPL-3.0-only.

Correct the expression to agpl-3.0-plus and rename the rule to
agpl-3.0-plus_311.RULE so the file name matches its expression, as done
for other expression corrections. 311 is the next free number returned
by find_rule_base_location('agpl-3.0-plus').

The deprecated agpl-3.0_330.RULE, a "license" spelling variant of the
same notice, is detected through this rule, so its replaced_by is
updated from agpl-3.0 to agpl-3.0-plus to match. Without this its
deprecated-rule validation test fails.

Reference: aboutcode-org#5002

Signed-off-by: Aishwary Dongre <87765118+aishwary-dongre@users.noreply.github.com>

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.

agpl-3.0_326.RULE should be agpl 3.0 or later wrong detection: AGPL-3.0-only instead of GPL-3.0-or-later

1 participant