Skip to content

fix(license): get GitHub to recognize AGPL-3.0#58

Merged
Gradata merged 1 commit into
mainfrom
fix/license-detection
Apr 15, 2026
Merged

fix(license): get GitHub to recognize AGPL-3.0#58
Gradata merged 1 commit into
mainfrom
fix/license-detection

Conversation

@Gradata

@Gradata Gradata commented Apr 15, 2026

Copy link
Copy Markdown
Owner

Summary

GitHub currently reports this repo's license as Other / NOASSERTION:

$ gh api repos/Gradata/gradata --jq .license
{"key":"other","name":"Other","node_id":"MDc6TGljZW5zZTA=","spdx_id":"NOASSERTION","url":null}

Root cause

GitHub detects licenses via github/linguist, which delegates to the licensee Ruby gem. Licensee requires the LICENSE file to match a canonical SPDX template within 0.95 similarity. Our file tanked the match for three reasons:

  1. Two prefix lines before the canonical text (biggest offender):
    SPDX-License-Identifier: AGPL-3.0-or-later
    Copyright (C) 2026 Gradata
    
  2. CRLF line endings (file was ASCII text, with CRLF line terminators)
  3. Word-wrap deviation in the boilerplate block near the end (published by\nthe vs canonical published\nby the)

Fix

  • Replaced LICENSE with the exact canonical AGPL-3.0 text from github/choosealicense.com (LF endings, no BOM, no prefix, 662 lines).
  • Added .gitattributes pinning LICENSE text eol=lf so Windows core.autocrlf=true cannot re-insert CRLF on checkout and break detection again.
  • SPDX marker + dual-license preamble + copyright already live in LICENSE-NOTICE.md, so the legal notice is preserved.

Test plan

  • CI green
  • Merge to main
  • Verify gh api repos/Gradata/gradata --jq .license returns {"key":"agpl-3.0","spdx_id":"AGPL-3.0"}
  • Verify GitHub repo sidebar shows "AGPL-3.0 license"

Co-Authored-By: Claude Opus 4.6 (1M context) noreply@anthropic.com

GitHub shows "Unknown/Other" license because the LICENSE file had two
prefix lines (SPDX-License-Identifier + Copyright (C) 2026 Gradata)
before the canonical AGPL-3.0 text, plus CRLF line endings and a
word-wrap deviation near the boilerplate. Licensee (the gem GitHub
uses via github/linguist) requires >=95% similarity to the SPDX
template, and the prefix bytes + CRLF tanked the match.

- Replaced LICENSE with the exact canonical AGPL-3.0 text from
  github/choosealicense.com (LF endings, no BOM, no prefix).
- Added .gitattributes to pin LICENSE to `eol=lf` so core.autocrlf
  on Windows cannot re-insert CRLF on checkout.
- SPDX marker + dual-license preamble remain in LICENSE-NOTICE.md
  (already present), so the legal notice is preserved.

After merge, `gh api repos/Gradata/gradata --jq .license` should
return `{"key":"agpl-3.0","spdx_id":"AGPL-3.0"}` instead of the
current `{"key":"other","spdx_id":"NOASSERTION"}`.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

@greptile-apps greptile-apps Bot 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.

Gradata has reached the 50-review limit for trial accounts. To continue receiving code reviews, upgrade your plan.

@coderabbitai

coderabbitai Bot commented Apr 15, 2026

Copy link
Copy Markdown

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 20be4dad-875a-4bc1-8611-e7eb9c0bd47b

📥 Commits

Reviewing files that changed from the base of the PR and between 52a735e and 079d9fe.

📒 Files selected for processing (2)
  • .gitattributes
  • LICENSE

📝 Walkthrough
  • License file normalization: Replaced LICENSE with the canonical AGPL-3.0 text from choosealicense.com to achieve ≥95% similarity required by GitHub's licensee gem for license detection
  • Line ending enforcement: Added .gitattributes rule (LICENSE text eol=lf) to pin LICENSE file to LF line endings, preventing Windows core.autocrlf from reintroducing CRLF
  • Metadata relocation: Moved SPDX identifier and copyright notice to LICENSE-NOTICE.md to preserve dual-licensing information while meeting GitHub's strict template matching requirements
  • Result: Enables GitHub to recognize repository license as AGPL-3.0 instead of "Other" / "NOASSERTION"

Walkthrough

Minimal configuration and licensing updates: a .gitattributes rule was added to enforce LF line endings for the LICENSE file, and the LICENSE file was modified to remove the SPDX identifier and copyright header while rephrasing a portion of the license text.

Changes

Cohort / File(s) Summary
Git Configuration
.gitattributes
Added rule to enforce LF line endings (eol=lf) for the LICENSE file.
License Content
LICENSE
Removed SPDX license identifier and copyright notice; adjusted license grant phrasing while maintaining the referenced version terms.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Possibly related PRs

Suggested labels

docs

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/license-detection

Comment @coderabbitai help to get the list of available commands and usage tips.

@Gradata Gradata merged commit cdeba33 into main Apr 15, 2026
3 of 5 checks passed
@coderabbitai coderabbitai Bot added the docs label Apr 15, 2026
@Gradata Gradata deleted the fix/license-detection branch April 15, 2026 07:55
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.

1 participant