Skip to content

fix: deprecate proprietary-license rules in favor of hessla - #5538

Open
chinyeungli wants to merge 5 commits into
developfrom
4885_propruetary_lic_to_HESSLA
Open

chinyeungli wants to merge 5 commits into
developfrom
4885_propruetary_lic_to_HESSLA

Conversation

@chinyeungli

Copy link
Copy Markdown
Contributor

Fixes #4885

This PR adds two extra fields to proprietary-license_87.RULE and proprietary-license_597.RULE, as these two rules were mistakenly identified as proprietary-license. The correct license should be hessla.

is_deprecated: yes
replaced_by:
    - hessla

In addition, I added two new rules, hessla_1.RULE and hessla_2.RULE, which capture the introductory statement.

These are the only differences:

$ diff hessla_1.RULE hessla_2.RULE
8a9
>     - http://www.gnu.org/philosophy/free-sw.html
14d14
<     - https://www.gnu.org/philosophy/free-sw.html
59c59
< [fn11] https://www.gnu.org/philosophy/free-sw.html
---
> [fn11] http://www.gnu.org/philosophy/free-sw.html

Result

I used the license text from proprietary-license_597.RULE and proprietary-license_87.RULE to create "proprietary-lic-597.txt" and "proprietary-lic-87.txt" to test the detection.

The scan is now correctly detected the license as hessla

    {
      "path": "tmp/proprietary-lic-597.txt",
      "type": "file",
      "detected_license_expression": "hessla",
      "detected_license_expression_spdx": "LicenseRef-scancode-hessla",
      "license_detections": [
        {
          "license_expression": "hessla",
          "license_expression_spdx": "LicenseRef-scancode-hessla",
          "matches": [
            {
              "license_expression": "hessla",
              "license_expression_spdx": "LicenseRef-scancode-hessla",
              "from_file": "tmp/proprietary-lic-597.txt",
              "start_line": 1,
              "end_line": 129,
              "matcher": "2-aho",
              "score": 100.0,
              "matched_length": 5698,
              "match_coverage": 100.0,
              "rule_relevance": 100,
              "rule_identifier": "hessla_1.RULE",
              "rule_url": "https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/rules/hessla_1.RULE"
            },
            {
              "license_expression": "hessla",
              "license_expression_spdx": "LicenseRef-scancode-hessla",
              "from_file": "tmp/proprietary-lic-597.txt",
              "start_line": 131,
              "end_line": 327,
              "matcher": "2-aho",
              "score": 100.0,
              "matched_length": 8434,
              "match_coverage": 100.0,
              "rule_relevance": 100,
              "rule_identifier": "hessla.LICENSE",
              "rule_url": "https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/licenses/hessla.LICENSE"
            }
          ],
          "identifier": "hessla-b1c0c1a8-62db-2e47-05f5-f6aa7ffe5eb7"
        }
      ],
      "license_clues": [],
      "percentage_of_license_text": 100.0,
      "scan_errors": []
    },
    {
      "path": "tmp/proprietary-lic-87.txt",
      "type": "file",
      "detected_license_expression": "hessla",
      "detected_license_expression_spdx": "LicenseRef-scancode-hessla",
      "license_detections": [
        {
          "license_expression": "hessla",
          "license_expression_spdx": "LicenseRef-scancode-hessla",
          "matches": [
            {
              "license_expression": "hessla",
              "license_expression_spdx": "LicenseRef-scancode-hessla",
              "from_file": "tmp/proprietary-lic-87.txt",
              "start_line": 1,
              "end_line": 129,
              "matcher": "2-aho",
              "score": 100.0,
              "matched_length": 5698,
              "match_coverage": 100.0,
              "rule_relevance": 100,
              "rule_identifier": "hessla_2.RULE",
              "rule_url": "https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/rules/hessla_2.RULE"
            },
            {
              "license_expression": "hessla",
              "license_expression_spdx": "LicenseRef-scancode-hessla",
              "from_file": "tmp/proprietary-lic-87.txt",
              "start_line": 131,
              "end_line": 327,
              "matcher": "2-aho",
              "score": 100.0,
              "matched_length": 8434,
              "match_coverage": 100.0,
              "rule_relevance": 100,
              "rule_identifier": "hessla.LICENSE",
              "rule_url": "https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/licenses/hessla.LICENSE"
            }
          ],
          "identifier": "hessla-bc6119b0-bc05-53d7-c59a-edc2236059d8"
        }
      ],
      "license_clues": [],
      "percentage_of_license_text": 100.0,
      "scan_errors": []
    }

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: Chin Yeung Li tli@nexb.com

@Raman-Katiyar

Copy link
Copy Markdown

Hi, I looked into the two failing jobs on this PR (license_validate_ext_5 and license_datadriven_ext) — they pass on the base commit (2b07b4d), so they look PR-related. The likely cause: the new hessla_1.RULE and hessla_2.RULE use license_expression: hessla, but there is no hessla license definition in src/licensedcode/data/licenses/ (the deprecated proprietary-license rules also point at it via replaced_by). The rule validation rejects license expressions with no matching license key, so adding a hessla.LICENSE definition should fix the validate failure; the data-driven test expectations may need regenerating after that too.

Signed-off-by: Chin Yeung Li <tli@nexb.com>
Signed-off-by: Chin Yeung Li <tli@nexb.com>
…ate `is_license_text: yes` to `is_license_intro: yes` #4885

Signed-off-by: Chin Yeung Li <tli@nexb.com>
Signed-off-by: Chin Yeung Li <tli@nexb.com>
@chinyeungli
chinyeungli force-pushed the 4885_propruetary_lic_to_HESSLA branch from e94f3d2 to 7318c47 Compare November 24, 2026 10:43
Signed-off-by: Chin Yeung Li <tli@nexb.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.

Rename proprietary-license_87 and proprietary-license_597 to HESSLA

2 participants