Repository navigation
fix(corpus): show a reviewed licence instead of UNKNOWN do-not-copy (#1893) - #1910
Conversation
…tor reads UNKNOWN A vetted hub manifest carries a human review of each repo's licence at the pin (spdx, use, by, at, note). corpus add ignored it: a CC0-1.0 repo whose LICENSE.md the detector cannot classify was recorded UNKNOWN, warned "do not copy" at clone time and on every xerj code passage. - read_hub_manifest keeps each row's review; corpus add records it in the cloned corpus.json when the checkout lands at the reviewed sha (a locally kept review still wins). - licence::effective_licence: the detector's reading, unless it is UNKNOWN/NONE-FOUND and a completed review (by set, use not UNREVIEWED, SPDX-shaped) names the licence. A licence the detector did identify is never overridden. licence_map and the clone-time lines use it. Fixes #1893
|
Xerj Merger made the fix: reviewed. When the detector reads UNKNOWN or NONE-FOUND, a completed hub review now supplies the licence label: |
Fixes #1893.
Bug:
18f-content-guide's registry manifest carries a completed review:"spdx": "CC0-1.0","by": "xerj-org", LICENSE.md verified. The licence detector reads UNKNOWN, so:xerj corpus addwarned^ UNKNOWN: adapt the APPROACH, do not copy the code;! manifest says licence=CC0-1.0, checkout reads UNKNOWN;xerj codepassage was labelled UNKNOWN with!!do-not-copy.Fix
read_hub_manifestkeeps each row'sreviewblock.corpus addrecords that review in the clonedcorpus.jsonwhen the checkout lands at the reviewed sha. A review kept locally from a previous build still wins.New
licence::effective_licence(recorded, review)returns the detector's reading, unless it is UNKNOWN or NONE-FOUND and a completed review names the licence. Completed means:byis set;useis notUNREVIEWED;A licence the detector did identify (for example GPL) is never overridden.
licence_map(the labelsxerj codeuses) and the clone-time lines go through it.The recorded
licencefield stays the detector's reading.Tests
a_completed_review_names_an_unknown_licence,a_draft_or_odd_review_does_not_count, andlicence_map_uses_a_completed_review_for_an_unknown_licence.xerj-commonxccode: 95 passed.xerj-autoindexlib: 1495 passed. clippy-D warningsand fmt are clean.^/!!do-not-copy lines any more. The(line unknown)is [bug]:xerj codeprints "(line unknown)" on every passage while telling the agent to cite file:line #1892, which fix(xerj code): cite real file lines for prose/Markdown hits (#1892) #1908 addresses.