Skip to content

chore: switch .gitattributes to LF + renormalize index - #10

Merged
blehnen merged 2 commits into
mainfrom
chore/gitattributes-lf-normalize
Apr 29, 2026
Merged

chore: switch .gitattributes to LF + renormalize index#10
blehnen merged 2 commits into
mainfrom
chore/gitattributes-lf-normalize

Conversation

@blehnen

@blehnen blehnen commented Apr 29, 2026

Copy link
Copy Markdown
Owner

Summary

The repo's existing .gitattributes was forcing CRLF for *.cs, *.csproj, *.yml, etc. — sensible when the project was Windows-only, but actively broken once Linux tooling enters the picture. Symptoms in production right now:

  • Every Dependabot PR diff shows whole-file changes from CRLF↔LF churn.
  • Jenkins's pre-merge step (git merge main into a PR branch) fails with
    error: Your local changes to the following files would be overwritten by merge: .github/workflows/docs.yml on a fresh checkout.
  • PR Bump Testcontainers from 4.4.0 to 4.11.0 #9 (Testcontainers 4.11) is blocked on this exact failure.

Two commits

  1. a0658f8 — switch .gitattributes policy from CRLF to LF. Replaces the per-extension eol=crlf rules with eol=lf, plus * text=auto eol=lf as the catch-all. Per-extension entries serve as documentation and belt-and-suspenders.
  2. ebb784fgit add --renormalize . Mechanical rewrite of the 18 files that were stored as CRLF in the index (the four GitHub workflow YAML files plus 14 .csproj files). Byte-level only; no content semantics change. The diff looks scary because every line shows a deletion + re-addition, but the actual content is identical modulo \r.

Verification

  • dotnet build FrigateRelay.sln -c Release clean, 0 warnings, 0 errors.
  • .github/scripts/secret-scan.sh scan passes (this script itself is now usable on Linux — it had been failing locally with $'\r': command not found before normalization).
  • bash .github/scripts/run-tests.sh --skip-integration — all unit-test projects green.

After merge

  • Dependabot PRs stop showing whole-file diffs.
  • Jenkins's pre-merge step stops bailing on a clean checkout. PR Bump Testcontainers from 4.4.0 to 4.11.0 #9 needs a rebase, then it builds.
  • Windows editors (Visual Studio / VS Code / Rider) keep working unchanged — they preserve existing line endings when editing.

Test plan

  • CI (GH Actions) passes on this PR.
  • After merge, rebase PR Bump Testcontainers from 4.4.0 to 4.11.0 #9 and confirm Jenkins's pre-merge step now succeeds.
  • Spot-check a Windows checkout to confirm files come out with LF (or CRLF if the user has core.autocrlf=true, which is fine — the index stays LF either way).

blehnen and others added 2 commits April 29, 2026 15:06
The previous policy forced CRLF for *.cs / *.csproj / *.yml / etc.
That worked while the repo was Windows-only, but it actively breaks
the moment Linux tooling enters the picture (Jenkins agents,
Dependabot, GitHub Actions Linux runners, *nix editors). They all
write LF, which then disagrees with the eol=crlf attribute on every
checkout, leaving the working tree "dirty" on first read.

Symptoms this causes today:
- Every Dependabot PR shows whole-file diffs from line-ending churn.
- Jenkins's pre-merge step (`git merge main` into a PR branch) fails
  with "Your local changes to the following files would be overwritten
  by merge: .github/workflows/docs.yml" — the working tree is dirty
  on a fresh clone before any user-driven action.

Fix: pin every text file to LF in both the index and the working tree.
Windows editors (Visual Studio / VS Code / Rider) preserve existing
line endings, so this is invisible to Windows developers in practice.

This commit only changes the .gitattributes policy. The follow-up
commit runs `git add --renormalize .` to rewrite every file in the
index to match the new policy.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Follows the .gitattributes policy switch in the previous commit.
`git add --renormalize .` rewrites every text file in the index to
match the new eol=lf attribute. The 18 files affected here are the
CRLF holdouts that have been driving Dependabot's whole-file diffs
and Jenkins's pre-merge "working tree dirty" failures (especially
.github/workflows/*.yml and the *.csproj files).

This is a byte-level change only — no content semantics shift, no
behavior change. The diff looks scary because every line of each
file is a deletion + re-addition (line endings are part of the
line for git), but the actual content is byte-identical modulo \r.

Verified by:
- `dotnet build FrigateRelay.sln -c Release` exits 0, warnings-as-
  errors clean.
- All test projects continue to pass via run-tests.sh.

After this lands, Dependabot PRs stop churning whole files,
Jenkins's pre-merge step stops refusing on a clean checkout, and
PR #9 (Testcontainers 4.11) can rebase cleanly.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@codecov

codecov Bot commented Apr 29, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 89.98%. Comparing base (c299f11) to head (ebb784f).
⚠️ Report is 4 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main      #10   +/-   ##
=======================================
  Coverage   89.98%   89.98%           
=======================================
  Files          51       51           
  Lines        1408     1408           
  Branches      235      235           
=======================================
  Hits         1267     1267           
  Misses         74       74           
  Partials       67       67           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@blehnen
blehnen merged commit 8fca6cf into main Apr 29, 2026
11 checks passed
@blehnen
blehnen deleted the chore/gitattributes-lf-normalize branch April 29, 2026 20:15
blehnen added a commit that referenced this pull request May 11, 2026
Closes the 10 actionable findings from CodeRabbit on PR #46:

- Extract canonical `StaticOptionsMonitor<T>` to `tests/FrigateRelay.TestHelpers/`
  and delete six per-file copies (`StaticMonitor<T>` / `StaticOptionsMonitor<T>`)
  scattered across the Host test suite. Subsumes the simplifier's deferred
  Phase 17 cleanup. Resolves CR #4, #5, #6.
- Use named `metricsTagWriter:` argument at every downstream call site for
  `EventPump` and `ChannelActionDispatcher` (mirrors `snapshotResolver:` style;
  guideline: new required-leading params get named args). Resolves CR #2.
- Add `Lock`-based synchronization to `CapturingLogger<T>.Entries` add path
  and `WaitForEntriesAsync` count read — closes a latent races where pump
  background-thread writes could corrupt the `List<T>` backing field while a
  test's poll-loop reads from the test thread. Resolves CR #3.
- Hoist `normalizedCamera` local in `ChannelActionDispatcher` exception
  handler so the second `IncrementExhausted` / `IncrementActionsFailed` call
  reuses the first allocation. Cold path, but free win. Resolves CR #1.
- `using var sp` on every `ServiceProvider` in
  `CodeProjectAiPluginRegistrarTests` so HttpClientFactory + logging are
  disposed between test methods. Resolves CR #7.
- Fix README.md observability link to include the
  `#bounding-camera-tag-cardinality-otelmetricstagsknowncameras-v130`
  anchor on the href side (was only in the link text). Resolves CR #8.
- Escape the regex pipe inside the inline-code span at
  `.shipyard/phases/16/VERIFICATION.md:44` so the markdown table doesn't
  see it as a column delimiter. Resolves CR #9.
- Correct `.shipyard/phases/16/results/SIMPLIFICATION-16.md` subtitle
  from the stale "parallel validators" (Phase 14 scope) to the actual
  Phase 16 scope. Resolves CR #10.

Verification:
- `dotnet build FrigateRelay.sln -c Release` — 0 warnings, 0 errors.
- Full unit suite (`.github/scripts/run-tests.sh --skip-integration`):
  313/313 pass across all 10 test projects.
  - Host.Tests: 154/154 (was 154 pre-fix; no regression).
  - CodeProjectAi.Tests: 13/13.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant