Repository navigation
fix(ci): pin vendored checksums to the upstream commit - #144
Merged
Merged
Conversation
Verify each '# upstream' hash against the blob at the commit recorded in .export-upstream, so rewriting a vendored file together with its checksum line fails CI. Require both hash lines for every manifest path, run sha256sum --strict so a malformed line fails instead of warning, and append directory expansions to manifest.paths. Extend --self-test with cases for each gap and a tampered-file case, and add the pinned check to CI.
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.
Fixes #115
Vendored checksums vouched for themselves: an edit could weaken a vendored file and rewrite both hash lines, and
--verifystill passed. This PR ties every# upstreamhash to the blob at the pinned commit.Contract: Hrana 3 is the source of truth for transport and data;
java.sqlis the source for the JDBC surface; xerial/sqlite-jdbc is a behavioral reference only. This change is protocol-neutral vendoring/CI tooling and touches no driver or protocol code.What changed
tools/export-upstream --verify-pinnedruns--verify, resolves thetagin.export-upstreamto the pinnedsha, and fetches each manifest blob at that commit withgh api(raw media type). A recorded upstream hash that differs fails and names the file.--verifynow requires both the# upstreamline and the current hash line for every manifest path. A manifest path with no entry fails.sha256_checkruns--strict, so a malformed checksum line fails instead of warning, and failed file names are printed.findoutput tomanifest.pathsinstead of printing to stdout..github/workflows/ci.ymlruns--verify-pinnedwithGH_TOKEN.--self-testgains cases for a path with no checksum entry, a missing upstream line, a missing current line, a malformed line, a directory entry, and a tampered file whose both hashes are rewritten. That last case must fail and name the file.EXPORT_UPSTREAM_PINNED_TREElets the pinned self-test run offline.Red before the fix (base ba3f2e7)
Verified upstream-xerial_sqlite-jdbc ...(exit 0).sha256sum: WARNING: 1 line is improperly formatted, thenVerified ...(exit 0).--verifyexit 0.findoutput to stdout rather than adding it tomanifest.paths.Green at head 61c9809
--self-test:Self-test passed.--verify: passes.--verify-pinned: passes againstcab7981c19ce04d691f0675f0b2586afc2bbf803.--verifypasses,--verify-pinnedfails namingsrc/test/java/org/sqlite/FetchSizeTest.java.verifyBUILD SUCCESS at trunk and head.--verifypasses.-pl libsql-conformance -am testBUILD SUCCESS.-Pxerial-control verifypasses.spotless:checkpasses.-pl libsql-jdbc testBUILD SUCCESS, 264 tests.testBUILD SUCCESS.-pl libsql-jdbc testmedian 2.06 s at trunk, 2.08 s at head (+1.0%, within the 10% rule).Divergences
None. No protocol or JDBC behavior changes; the only behavior change is in the maintainer verifier and CI.
Logs are under
/tmp/xerial-parity-i115/.