Repository navigation
hub: limit go-vulndb to data/osv - #2229
Merged
Merged
Conversation
A repo-pin manifest could not name a subdirectory, so corpus add --from on go-vulndb cloned all of golang/vulndb. The CLI that honors "paths" is #2228 on main. This manifest declares the directory the field report actually indexed: data/osv (4,577 advisory files at the existing pin). validate_hub.py accepts a paths array and refuses the same shapes the consumer gate refuses (absolute, .., globs, empty). The check runs on every corpus-hub validate, including a small self-check of those rules. Refs #1842 Co-authored-by: xerj-org <xerj-org@users.noreply.github.com>
5 of 8 tasks
Owner
Author
|
Xerj Merger made the fix: go-vulndb's hub manifest now pins |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this changes, and why
go-vulndb.jsonpins golang/vulndb but could not say "onlydata/osv".corpus add --fromtherefore cloned the whole repository. The field report on #1842 got a searchable corpus only by copyingdata/osvout by hand (4,577 files). The pin and the withdrawn crypto-misuse manifest were fixed on this branch by #1641. This is the remaining manifest half.The repo entry now sets
"paths": ["data/osv"]. The CLI that sparse-checks out that field is #2228, againstmain.validate_hub.py(thecorpus-hub validateworkflow) accepts apathsarray and refuses an empty array, a string, an absolute path,.., and globs — the same shapes the consumer gate refuses. A missingpathsfield still means the whole pin.CONTRIBUTING.mddocuments the field.filesandbytesare unchanged: they already described thedata/osvtree, not the whole repo.Evidence
That run includes the new self-check (good path
data/osv, and refusals for.., absolute paths, globs, empty, and 33 entries) and the updated manifest. The self-check aborts the script on failure, so a green run is the path rules holding.Separately,
gh api repos/golang/vulndb/git/trees/5cd8418cf9c867d344fda07a73ea844b0f34bca2:data/osv --jq '.tree | length'printed4577, which is thefilesvalue this manifest already recorded.Checks
python3 tools/xerj-code/hub/validate_hub.py— the corpus-hub validate gatecargo fmt/cargo test/ ES-YAML — not applicable: this PR does not change Rust. The consumer gate and the checkout are fix(corpus): harvest a repo pin's paths, not the whole tree #2228.tools/xerj-code/hub/CONTRIBUTING.mddescribespaths.github/was edited. The existingcorpus-hub validatew 8000 orkflow already runsvalidate_hub.py.Not run: a live
xerj corpus add --fromof golang/vulndb. The checkout behaviour is tested on a local fixture in #2228. This PR only declares the directory.Provenance
validate_hub.pyexit 0 with the counts above; the GitHub git tree fordata/osvat5cd8418cf9c8has 4577 entries.corpus add --fromof this manifest materializesdata/osvand notdata/reports. A binary from before fix(corpus): harvest a repo pin's paths, not the whole tree #2228 ignores unknown manifest fields and still clones the whole pin.Refs #1842