fix(docs): pin the byte-asserted docs/resources files to LF line endings - #8779
Conversation
A Windows checkout with core.autocrlf=true converted docs/resources/starter-prompt.md to CRLF. The starter-prompt generator rejects a carriage return, so the repository check failed before the contributor changed the file. Fixes NVIDIA#8648
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughThe change adds LF checkout rules for selected prompt assets, verifies the Git attribute contract, and documents Windows line-ending diagnosis and checkout normalization. ChangesStarter-prompt line endings
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
Suggested labels: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
PR Review Advisor — No blocking findings reportedAdvisor assessment: No blocking advisor findings reported Model lanes
Second-opinion terminology and E2E selections are advisory. Live E2E does not run automatically for pull requests. 2 semantic terminology decisionsTerminology decisions are advisory. They affect the assessment only when a separate finding identifies concrete semantic impact.
E2E guidanceAdvisory only. A maintainer can dispatch the default E2E suite for the commit under review. Recommended E2E: None 1 warning · 0 suggestionsWarningsWarnings do not block.
|
… tests The first revision pinned only starter-prompt.md. The prompt assets and local-credential-form.html carry the same byte-exact assertions, so an autocrlf checkout still broke them. The attribute tests now disable the global and system attribute files, require each path to exist, report a failed git spawn, and assert the checkout line ending rather than the .gitattributes spelling. Document the one-time normalization for a checkout that already holds CRLF, because a new attribute does not rewrite the working tree.
|
Thanks for merging A self-review found that the first revision was incomplete, so the scope grew:
One judgement call worth your view: the rule names three paths rather than applying |
|
Flagging a red check that is not caused by this diff.
The step retried three times over about 40 seconds and failed each time with the same TLS error, so it never reached the guardrail logic. The same check passed on the previous push to this branch (run 31359918764). I read it as a transient runner problem rather than a growth-budget violation. I cannot re-run it, because |
|
I need to disclose a duplicate that I should have found before I opened this. #8657 targets the same issue and was opened on 2026-08-09T22:09:58Z, about 31 hours before this PR. It was cross-referenced on #8648 at the time, so it was visible when I claimed the issue. I searched the open issues and missed the open pull requests, which The two differ:
#8657 is both earlier and broader, so I do not think this PR should land as a competing change. I checked whether the tests here transfer: with I offered those tests on #8657. Happy to close this PR in favour of that one, or to keep it open if you would rather compare the two approaches. Your call. |
Signed-off-by: Apurv Kumaria <akumaria@nvidia.com>
Security review: PASSReviewed the complete PR diff through branch revision Review checklist
Verification
No security findings or security-review blocker remain for this branch revision. |
|
Merge-train comparison for #8648 Both PRs remain blocked on a maintainer policy choice:
Neither PR has approval or all required checks. I will not close either PR until a maintainer selects the policy. The unselected PR can then close with this comparison and the selected replacement as evidence. |
prekshivyas
left a comment
There was a problem hiding this comment.
Comparator review for issue #8648: neither competing PR is mergeable yet, and #8779 is closer to ready.
- Tier 0: open, contributor-compliant, and CodeRabbit-clear; fails current CI/branch-protection/refresh gates.
- Correctness/quality score: 16.0/16.0. The file-specific LF pins match the issue; the generated output is correctly excluded because it is untracked;
git check-attrtests fail on the pre-fix contract, cover the byte-pinned resource set, and retain an unaffected-path negative control. - #8657 scores 9.0/16.0 because it broadens normalization to every tracked text file and has no checked-in attribute regression.
No supersession declaration or transferred work was found. Refresh this branch onto current main, obtain the full required checks, and make the maintainers' choice between the competing PRs explicit before approval.
prekshivyas
left a comment
There was a problem hiding this comment.
The LF attributes match the exact-byte contracts, the tests isolate repository attributes and cover every pinned path plus an unpinned control, and the contributor recovery guidance warns before the destructive normalization command. CI passes on commit 97bccf9, and GitHub reports no merge conflict.
Summary
A Windows checkout with
core.autocrlf=truerewrotedocs/resources/starter-prompt.mdto CRLF, and the starter-prompt generator rejects a carriage return, sonpm run checks:repositoryfailed before the contributor changed anything..gitattributesnow pins every file whose exact working-tree bytestest/starter-prompt-docs.test.tsasserts, so the checkout keeps the line endings those contracts expect.Related Issue
Fixes #8648.
Changes
docs/resources/starter-prompt.md,docs/resources/prompt-assets/*.md, anddocs/resources/local-credential-form.htmltotext eol=lf, with a comment naming the contracts the rule protects.test/starter-prompt-docs.test.tsthat resolve the checkout line ending throughgit check-attrfor each pinned path, plus one control for an unpinned file.CONTRIBUTING.md.The generator keeps its existing carriage-return rejection. This PR changes no runtime source file and no workflow.
Why the Rule Covers More Than the Starter Prompt
The invariant is that a file whose exact bytes are asserted must check out with LF.
test/starter-prompt-docs.test.tsasserts exact bytes for four more files: the three prompt assets are byte-compared against their pinned Git blobs, andlocal-credential-form.htmlis compared against the SHA-256 that users verify before they run the local credential helper.Pinning only the starter prompt left those four at
eol: unspecified. A Windows contributor would still fail the same suite, and the failure text would tell them to repin the digests to CRLF-corrupted content, which would break the published hash for every user. Removing the rules now fails 5 tests rather than 1.Verification
Reproduced end to end in a scratch clone with
core.autocrlf=true:starter-prompt.mdmainThe bug also survives a pull, which is why the normalization note exists. Starting from a CRLF clone of
mainand checking out this branch leaves the file CRLF whilegit statusreports no change. Onlygit rm --cached -r .followed bygit reset --hardrestores LF. I verified that sequence before documenting it.Attribute coverage after the change:
Test behavior:
Tests 24 passed (24).Tests 5 failed | 19 passed (24).core.attributesFilecontaining* text=auto:24 passed, because the tests spawngitwithGIT_ATTR_NOSYSTEM=1and an absentcore.attributesFile. Without that isolation the result would come from the contributor's own Git configuration rather than from this repository.* text=autoappended to.gitattributes:24 passed. The control asserts only the absence of the LF pin, so it does not freeze repository-wide normalization policy.Each attribute lookup asserts that the path exists first, because
git check-attranswersunspecifiedwith exit code 0 for a path that does not exist. A failedgitspawn now raises an error naming the path, status, signal, and stderr instead of surfacingexpected null to be 0.npm run docs:check-starter-promptreportsGenerated Starter Prompt snippet is current, andnpm run checks:repositorypasses.I verified this on macOS using scratch clones configured with
core.autocrlf=true. I did not run a Windows host.Note on the Issue Scope
The issue also lists the generated output.
.gitignoreignoresdocs/_build/, anddocs/_build/StarterPrompt.generated.mdxis untracked, so aneol=lfattribute there never applies at checkout. I left it out rather than add inert configuration, as described in this issue comment.Type of Change
Quality Gates
local-credential-form.htmlis a credential-adjacent asset, but this PR changes none of its bytes. It pins the line endings that keep its published SHA-256 verifiable.Documentation Writer Review
docs-updatedCONTRIBUTING.md, which gains aWindows Line Endingssubsection under Prerequisites. The review checked the added text againstWRITING.mdanddocs/CONTRIBUTING.mdfor terminology, structure, voice, and code-sample presentation. It confirmed title case for the heading, one instruction per sentence, the condition stated before the action, the destructive-command warning placed before the command block, and a language-specificbashblock holding only command text. It verified the documented normalization sequence in a scratch clone rather than citing it from memory.npm run test:titles:checkruns insidenpm run checks:repository, which passed.Verification Checklist
Signed-off-by:line and every commit appears asVerifiedin GitHubpre-commit,commit-msg, andpre-pushhooks passed, ornpm run validate:prpassed after refreshingorigin/mainwhen hooks were skipped or unavailablenpx vitest run --project integration test/starter-prompt-docs.test.tsreportsTests 24 passed (24), and5 failed | 19 passedwhen the attribute rules are absent.npm testfor broad runtime/test-harness changes;npm run checkfor repo-wide validation/coverage changes — command/result:npm run docsbuilds without warnings (doc changes only)Notes on the unchecked verification items:
npm run checks:repositoryalso passed through thepre-commithook, and thepre-pushCLI and plugin type checks passed.CONTRIBUTING.mdat the repository root and adds no page underdocs/, so the Fern docs build and page-style items do not apply.Signed-off-by: Vishnu Rajeev 19866703+VishnuR23@users.noreply.github.com
Summary by CodeRabbit
Documentation
Tests