chore: pin package-lock.json to LF in .gitattributes - #816
Conversation
fuzefront-website/backend/package-lock.json is the only lockfile in the
repo stored with CRLF. It predates gate-line-endings, so it sat unnoticed
until a PR touched it — same story as the CLAUDE.md / authentikPassword.ts
entries already pinned at the bottom of .gitattributes.
The existing globs do not cover it:
package.json text eol=lf
**/package.json text eol=lf
neither matches package-lock.json, so the lockfile was never pinned.
This matters more for a lockfile than for an ordinary source file. npm
rewrites the whole file on every resolution, so a CRLF-stored lockfile
regenerated on Linux comes back entirely LF: a 9-entry dependency change
renders as a 7,124-line diff. That hides the real change from review and
trips gate-line-endings at the same time.
Content is byte-identical modulo line endings — verified by stripping \r
from both sides and diffing (no difference). Split out of the #747
dependency work so the deps PR keeps a reviewable diff.
Refs #747
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013tMciHkPE8To7V67CsgKKc
gate-line-endings rejects CRLF in any file a PR touches, and this lockfile is the repo's only CRLF one. It was left as CRLF here to keep the dependency diff readable; the gate is right and that was the wrong call. #816 pins package-lock.json to LF in .gitattributes so this cannot recur. Once it lands, rebasing this branch collapses this file's diff back to the nine dependency entries that actually changed. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013tMciHkPE8To7V67CsgKKc
|
Both failing checks here are pre-existing on
The check summary on this PR is itself the proof that those alerts are phantom:
The entire diff of this PR is CRLF → LF in one lockfile, plus two Not porting those fixes into this PR. #817 and #818 are both green on their own gates with auto-merge armed, and porting would mean four open PRs concurrently editing the same No re-run spent: a re-run cannot clear either failure, since both originate in files this branch does not contain changes to. Generated by Claude Code |
|
Correcting my earlier comment on this PR. I attributed the
Why #818 wasn't enough#818 split the ~6-minute container scan onto its own SARIF tool, on the theory that the duration gap caused the race. Measured on this PR right after it merged: GitHub finalises a tool's check as soon as it considers the set complete, without waiting for stragglers. Two configurations under one SARIF tool race whether they finish six minutes or two seconds apart. Every pass so far just moved which configuration went missing. #820 fixes it on the actual invariant: one configuration per tool. It is working — What I checked and rejectedThe check summary hedges "Alerts not introduced by this pull request might have been detected because the code changes were too large", and this PR does rewrite 7,124 lockfile lines. That looked like a plausible second cause, so I nearly restructured this PR to shed the lockfile. It isn't the cause. #813 is the control: its diff is +49 −9,887 across 4 files — it deletes an entire 9,887-line lockfile — and its I reverted that restructuring rather than ship a change I'd talked myself into. Worth recording, since "the diff is too big" is the explanation this check's own message invites. StatusNo fix to push here — this PR's content is two Generated by Claude Code |
…ckfile-eol # Conflicts: # fuzefront-website/backend/package-lock.json
📋 Description
Pins
package-lock.jsonto LF so a CRLF-stored lockfile can't recur.This PR shrank. It originally also carried the EOL normalisation of
fuzefront-website/backend/package-lock.json(7,124 lines). #814 has since merged and regenerated that same file as LF, so the normalisation is already on master and this PR is now just the durable rule — 8 lines.🔄 Type of Change
🔧 Implementation Details
.gitattributesalready pins manifests:Neither glob matches
package-lock.json, so lockfiles were never pinned. This adds:Why it matters more for a lockfile than for ordinary source
npm rewrites the whole file on every resolution. A CRLF-stored lockfile regenerated on Linux comes back entirely LF, so a 9-entry dependency change renders as a 7,124-line diff — which hides the real change from review and trips
gate-line-endings.That is not hypothetical. It happened on #814, and then it cost this PR three red CI cycles, described below.
The Trivy failures on this PR were a real mechanism, worth recording
While this PR carried the EOL rewrite,
Trivyfailed on it repeatedly — finally as "9 new alerts including 3 high severity security vulnerabilities." The content was byte-identical to master modulo line endings (verified by stripping\rfrom both sides and diffing: zero version changes), so it introduced nothing.The alerts were
lodash,tar-fs,validator,morgan,qs,body-parser— master's own pre-existing vulnerabilities in that lockfile. Code scanning attributes alerts to changed lines, and rewriting all 7,124 lines put every vulnerable entry "in code changed by this pull request."Two corrections came out of chasing it:
Trivypassed, which looked like proof that diff size was irrelevant. But fix(deps): raise tar to >=7.5.21 and delete the dead backend/package-lock.json (clears both CRITICALs) #813 deletes lines while this PR rewrote them — deleted lines cannot carry alerts, rewritten ones can. The comparison did not apply.What actually fixed it was #814, which raises all six package families in that exact file:
With nothing vulnerable left in the file, the rewrite attributes nothing — and now the rewrite is gone from this PR entirely.
🧪 Testing
fuzefront-website/backend/package-lock.jsonresolved by taking master's copy; verified byte-identical to master and LF (0 CRLF lines).gitattributesitself verified LF / UTF-8Scope note
Many other tracked files are still CRLF (
backend/src/**, several workflows,FuzeQuality/**). A repo-wide renormalise would be an enormous diff touching code this PR has no business rewriting, andgate-line-endingsonly checks files a PR changes — so pre-existing CRLF elsewhere stays out of scope. This pins the lockfile class specifically.Code Quality