The honest bundle fails from a default Windows clone - #9
Merged
Conversation
Not a verifier defect. A distribution one, and it lands on exactly the
person this project is aimed at: the stranger who clones and replays.
REPRODUCTION, on a clean machine with the Git for Windows installer defaults:
git clone https://github.com/egnaro9/vac-protocol.git
cd vac-protocol
python -m vac.verify fixtures/valid # exit 1
Twenty reasons, all of this shape:
FAIL sha256-mismatch: evidence/bundle.json: manifest 64931fe8..., file
a2433da2...
core.autocrlf is ON by default in that installer, the repository carries no
.gitattributes, so checkout rewrites every text artifact to CRLF and every
sha256 in the manifest stops matching its file. The bundle is honest, the
manifest is honest, the verifier is right to refuse what it was handed: the
bytes really did change between your commit and my disk. CI is ubuntu-only,
so nothing upstream can see this, and I hit it myself as the first thing that
happened when I re-cloned to work on egnaro9#2.
It is the same class as the encoding finding in egnaro9#2, one layer out. There the
same bytes produced opposite verdicts depending on the host codec; here the
same commit produces different BYTES depending on the host's git config.
Two parts, because a fresh clone and an existing one need different things.
`* -text` in .gitattributes turns the conversion off for every future clone.
Verified end to end: cloning this branch with core.autocrlf=true yields LF
artifacts and `python -m vac.verify fixtures/valid` exits 0, where the same
clone of main exits 1.
tests/test_checkout_integrity.py is the named reason for the clones that
already happened. A developer whose checkout is already converted currently
gets twenty hash mismatches and no cause; this gives one failure that says
what happened and the two commands that repair it. It also pins the
attribute, so dropping it later fails loudly rather than silently, on the
same principle as the rest of the suite: a gate that cannot name why it fired
cannot be audited.
The test file is new and touches nothing else, so this stands alone: it is
independent of egnaro9#2 and egnaro9#3 and can land in any order.
Verified: the three new tests pass here, the first fails against main (no
.gitattributes), ruff clean.
Signed-off-by: giulio d'erme <giulio@derme.dev>
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.
Not a verifier defect. A distribution one, and it lands on exactly the person this project is aimed at: the stranger who clones and replays.
Reproduction
On a clean machine with the Git for Windows installer defaults:
Twenty reasons, all of this shape:
core.autocrlfis on by default in that installer, this repository carries no.gitattributes, so checkout rewrites every text artifact to CRLF and every sha256 in the manifest stops matching its file.The bundle is honest, the manifest is honest, and the verifier is right to refuse what it was handed: the bytes really did change between your commit and my disk. Your CI is ubuntu only, so nothing upstream can see it. I hit it as the very first thing that happened when I re-cloned to work on #2, and spent a few minutes assuming I had broken something.
It is the same class as the encoding finding in #2, one layer out. There the same bytes produced opposite verdicts depending on the host codec. Here the same commit produces different bytes depending on the host's git config.
Two parts, because a fresh clone and an existing one need different things
.gitattributeswith* -textturns the conversion off for every future clone. Verified end to end: cloning this branch withcore.autocrlf=trueyields LF artifacts andpython -m vac.verify fixtures/validexits 0, where the same clone ofmainexits 1.tests/test_checkout_integrity.pyis the named reason for the clones that already happened. A developer whose checkout is already converted currently gets twenty hash mismatches and no cause. This gives one failure that says what happened and the two commands that repair it:It also pins the attribute itself, so dropping it later fails loudly rather than silently, on the same principle as the rest of your suite: a gate that cannot name why it fired cannot be audited.
Scope
The test file is new and the attribute file is new, so this touches nothing else and is independent of #2 and #3. It can land in any order, including first.
ruffclean. The three new tests pass here; the.gitattributesone fails againstmain, which is the point.