pack_reference.sh: reject an empty reference file, not just a missing one#83
Open
mikessh wants to merge 1 commit into
Open
pack_reference.sh: reject an empty reference file, not just a missing one#83mikessh wants to merge 1 commit into
mikessh wants to merge 1 commit into
Conversation
…g one The per-file loop checked presence (`grep -q`) but not size. A `build-db` run without IgBLAST emits 0-byte alleles/markup that pass the presence check, ship in the release asset, and crash every fresh `pip install` with `polars NoDataError: empty CSV` at load_reference. v2.5.7 shipped exactly this (the asset was re-uploaded good ~3h later, but nothing in CI would have caught it). Add a 1 KB size floor per required file, measured by extracting the packed member to stdout (`tar -xzf "$OUT" -O … | wc -c`) so it is portable across bsdtar/GNU tar. Smallest real file is rat/cdr3_anchors.tsv at ~24 KB, so the floor cannot trip on a valid small-repertoire organism. pack_reference.sh runs in the reference-asset CI job before `gh release upload`, so this fails the release instead of shipping garbage. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.
Problem
scripts/pack_reference.shvalidates that each required reference file is present in the asset (grep -q) but not that it is non-empty. Abuild-dbrun without IgBLAST emits 0-bytealleles.*/markup.*, which pass the presence check, ship inarda-reference-vdj.tar.gz, and then crash every freshpip installat load time:v2.5.7 shipped exactly this. The published asset was re-uploaded good ~3 h after the release (verified: it is now byte-identical to the committed reference, all 5 organisms, 345 J+C scaffolds), but nothing in CI would have caught the empty asset — the guard just wasn't there.
Fix
A 1 KB size floor per required file, measured by extracting the packed member to stdout so it reflects what actually ships:
rat/cdr3_anchors.tsvat ~24 KB, a 24× margin under the 1 KB floor.pack_reference.shexecutes in thereference-assetCI job beforegh release upload, so an empty reference now fails the release instead of shipping.Test
OK, exit 0 (53 members, 2.8 MB).ERROR: vdj/human/markup.aa.tsv is empty (0 B)and non-zero exit before theOKsummary.🤖 Generated with Claude Code