Skip to content

fix(OSPS-LE-02.01): pass deprecated but OSI/FSF-approved SPDX IDs#355

Merged
eddie-knight merged 2 commits into
ossf:mainfrom
joanagmaia:fix/347-OSPS-LE-02-01
Jul 7, 2026
Merged

fix(OSPS-LE-02.01): pass deprecated but OSI/FSF-approved SPDX IDs#355
eddie-knight merged 2 commits into
ossf:mainfrom
joanagmaia:fix/347-OSPS-LE-02-01

Conversation

@joanagmaia

Copy link
Copy Markdown
Contributor

Summary

  • Fixes false negatives in OSPS-LE-02.01 for deprecated-but-approved SPDX IDs (AGPL-3.0, GPL-2.0, GPL-3.0, LGPL-2.1) that GitHub's License API still returns in deprecated form.
  • Drops the || license.IsDeprecatedLicenseId clause from the fail condition in GoodLicense — licenses now fail only when neither OSI- nor FSF-approved.
  • Deprecated-but-approved IDs are tracked separately and surfaced as a non-failing advisory note in the passing message, so maintainers are informed of the SPDX identifier hygiene issue.

Root cause

evaluation_plans/osps/legal/steps.go line 95 (before fix):

if (!license.IsOsiApproved && !license.IsFsfLibre) || license.IsDeprecatedLicenseId {
    badLicenses = append(badLicenses, spdx_id)
}

The || license.IsDeprecatedLicenseId clause caused any deprecated SPDX ID to be treated as a bad license regardless of approval status, producing the misleading failure message "These licenses are not OSI or FSF approved: AGPL-3.0" for projects like Grafana and Renovate.

Test plan

  • Existing 5 TestGoodLicense cases unchanged and passing
  • New case: AGPL-3.0 (isOsiApproved:true, isFsfLibre:true, isDeprecatedLicenseId:true) → Passed with deprecation note
  • New case: MIT AND AGPL-3.0 mix → Passed with note listing only AGPL-3.0
  • New case: AGPL-3.0 AND BadLicense mix → Failed referencing only BadLicense
  • New case: deprecated + unapproved → Failed
  • make vet && make test green

Closes #347

Note: once merged and released, linuxfoundation/insights#1898 and linuxfoundation/insights#1735 should be re-evaluated.

🤖 Generated with Claude Code

@joanagmaia joanagmaia requested a review from a team as a code owner July 3, 2026 11:17
@github-actions github-actions Bot added the fix label Jul 3, 2026
@jmeridth

jmeridth commented Jul 3, 2026

Copy link
Copy Markdown
Member

@joanagmaia please sign your commits to satisfy DCO check.

The GoodLicense step was failing any license with isDeprecatedLicenseId=true,
even when isOsiApproved=true or isFsfLibre=true. This produced false negatives
for widely-used licenses like AGPL-3.0, GPL-2.0, GPL-3.0, and LGPL-2.1, which
GitHub's License API still returns in deprecated form.

Drop the deprecation clause from the fail condition. Track deprecated-but-approved
IDs separately and surface them as a non-failing advisory note in the passing
message, so maintainers are informed of the SPDX identifier hygiene issue without
the control being marked as failed.

Fixes ossf#347

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Signed-off-by: Joana Maia <jmaia@contractor.linuxfoundation.org>
@joanagmaia joanagmaia force-pushed the fix/347-OSPS-LE-02-01 branch from e7210d8 to 9c19e86 Compare July 3, 2026 12:21
@joanagmaia

Copy link
Copy Markdown
Contributor Author

Hey @eddie-knight, do you think you could check this one out? Also proposed a fix for this reported issue #347

@eddie-knight eddie-knight left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Good thinking!

@eddie-knight eddie-knight merged commit c1095c9 into ossf:main Jul 7, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

OSPS-LE-02.01 fails for deprecated SPDX IDs that are still OSI/FSF approved (e.g. AGPL-3.0)

3 participants