Make the asset-version guard line-ending independent #28
No reviewers
Labels
No labels
architecture
cleanup
dependencies
performance
priority: high
priority: medium
reliability
security
testing
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
solvreven/FPL!28
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/asset-guard-line-endings"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Outcome
test_asset_version.pyhashed the four versioned assets byte-for-byte. They are text files, the repo has no.gitattributes, and CI checks them out LF ondebian-trixie-pythonwhile a Windows clone withcore.autocrlf=trueholds CRLF. The digest therefore differed by platform, and the guard was green only for whoever recorded it last.Both sides have been re-recording their own platform's value in turn, each fix correct locally and each breaking the other:
1c94db7v135d20d1fa11d2d9a94a932c205c61efb9bd20d1fa11d2d9a94bbf3c01v136 (PR #27)a932c205c61efb9ba932c205c61efb9bd20d1fa11d2d9a949c2facav137d9ca43b746e10252350840c64b1a1aa0d9ca43b746e10252So
mainhas been red in CI since9c2faca, and PR #27's asset commit was not wrong — it was right for Linux.Why this shape of fix
The repo had already solved this, one digest over.
projection_digestinpipeline.pynormalises\r\nto\nand says why, in terms that describe this bug exactly: "git stash/checkoutrewrite tracked files between LF and CRLF undercore.autocrlf=true, and on Windows that flipped this digest with zero code difference: same source, two different hashes, one commit apart." It is covered bytest_crlf_and_lf_produce_the_same_digest.The asset digest is the one place that remedy was never applied — "fixing a defect in one location is not fixing the defect", with the second location in a different file.
Chosen over a
.gitattributesentry deliberately: that would leave the guard's correctness depending on every contributor's checkout config, which is the disconnected-mechanism shape this repo keeps paying for. Normalising in the digest makes the platform difference unrepresentable instead.A CRLF/LF flip is not an asset change a browser needs a new
?v=for, so it must not move the digest.EXPECTED_VERSIONstays 137;EXPECTED_DIGESTbecomes the normalised value, identical under both conventions.Verification
Proved RED on both the property fixed and the property that must not break — driving the real test module against controlled inputs:
app.jschanged,?v=not bumpedtokens.csschanged,?v=not bumpedtests/web/test_asset_version.py: 3 passed. Nothing else in the tree references that module or its_digest, so the change is self-contained.Note for #27
bbf3c01becomes unnecessary rather than conflicting once this lands. Asked there for a rebase, so neither side has to concede a digest that was correct where it was measured.🤖 Generated with Claude Code
https://claude.ai/code/session_014adnmRztkdAPwinWXnNQ7N
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.