Skip to content

fix(agent,ci): ignore CRLF conversion when comparing generated files - #593

Merged
zeshi-du merged 3 commits into
TestSprite:mainfrom
yeziR4:fix/crlf-artifact-comparisons
Nov 10, 2026
Merged

zeshi-du merged 3 commits into
TestSprite:mainfrom
yeziR4:fix/crlf-artifact-comparisons

Conversation

@yeziR4

@yeziR4 yeziR4 commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

What does this PR do?

On a Windows CRLF checkout, unchanged agent skill files and CI workflows were treated as local edits. Compare the four accepted sites with a shared CRLF-insensitive helper so equivalent files stay untouched, while real edits still require --force and retain their backup.

Related issue

Closes #464

Season 4 CLI Improvement Bonus

  • I'm entering this PR for the Season 4 CLI Improvement Bonus

Discord username: ___h___r

Type of change

  • Bug fix (non-breaking change that fixes an issue)

Validation

  • Regression tests cover own-file install, agent status, the Codex managed section, and ci init; equivalent CRLF bytes are preserved.
  • Real CRLF edits remain modified/blocked, and forcing an edited CI workflow preserves its original backup and writes canonical LF.
  • Focused suites: 193 passed, 2 platform skips.
  • Lint, formatting, and typecheck passed. Full suite: 122 files passed; 4,796 tests passed, 11 skipped. Coverage: lines 92.14%, statements 89.96%, branches 84.99%, functions 83.65%.
  • Real installer end-to-end: 54 passed, 1 platform skip; the remaining eight-target test hit its 5s timeout and passed when rerun with a 20s timeout.

Notes for reviewers

Only comparisons change; marker/hash parsing and write formats are unchanged. Codex assisted with implementation and validation.

Summary by CodeRabbit

  • Bug Fixes
    • Improved handling of Windows-style CRLF line endings across agent installations, managed sections, and CI workflow initialization.
    • Prevented unnecessary file rewrites and backups when content differs only by line-ending format.
    • Preserved safeguards for genuinely modified files, including status reporting, reinstall protection, forced replacement, and backups.
    • Existing files with line-ending-only differences are now treated as unchanged, while other local edits continue to be detected.

@coderabbitai

coderabbitai Bot commented Oct 20, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

Agent artifact and CI workflow comparisons now ignore CRLF-versus-LF differences. Equivalent files remain unchanged. Files with other content differences retain the existing modified, refusal, and force-with-backup behavior.

Changes

Agent and CI CRLF Handling

Layer / File(s) Summary
Agent artifact comparisons
src/lib/text-equality.ts, src/commands/agent.ts, src/commands/agent.test.ts
A shared comparison helper normalizes CRLF to LF when checking managed sections, installed files, and status. Tests cover equivalent files and CRLF files with edits.
CI workflow comparison
src/commands/ci.ts, src/commands/ci.spec.ts
CI workflow comparison treats CRLF-only differences as unchanged. Tests verify that edited workflows still require force and that force saves the original file as .bak.

Estimated code review effort: 2 (Simple) | ~12 minutes

Change: Bug fix · Severity of issue fixed: Medium

Merge Risk: Minimal · up to ca78f

Equivalent CRLF files remain unchanged while genuine edits retain overwrite protection. No merge-blocking issue was identified.

Pre-merge checks: Passed 5

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly summarizes the main change: agent and CI comparisons now ignore CRLF-only differences in generated files.
Linked Issues check Passed Issue #464 requires CRLF-insensitive comparisons at the four agent and CI sites, while real edits remain modified or blocked. The reviewed summary shows equalIgnoringCrlf used for Codex managed sect…
Out of Scope Changes check Passed The reported changes are limited to the shared text comparison helper, the four issue #464 comparison sites, and their regression tests in src/commands/agent.test.ts and src/commands/ci.spec.ts. E…
Docstring Coverage Passed Docstring coverage is inconclusive: files from earlier reviews still need to be rechecked within the check's analysis limits. Not blocking.
Full details: Linked Issues check

Explanation

Issue #464 requires CRLF-insensitive comparisons at the four agent and CI sites, while real edits remain modified or blocked. The reviewed summary shows equalIgnoringCrlf used for Codex managed sections, own-file install and status checks, and ci init. Regression tests cover equivalent CRLF content, preserved bytes, real edits, --force, and CI backup behavior. The summary reports that marker parsing and write formats remain unchanged.

Full details: Out of Scope Changes check

Explanation

The reported changes are limited to the shared text comparison helper, the four issue #464 comparison sites, and their regression tests in src/commands/agent.test.ts and src/commands/ci.spec.ts. Each change supports the linked issue. No unrelated change is shown.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 663d55e and ca78fc8.

Files selected for processing: 2

  • src/commands/ci.spec.ts
  • src/commands/ci.ts

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 2 remain after this review.

@github-actions

Copy link
Copy Markdown

🏆 Season 4 CLI Improvement Bonus: entry recorded. Thanks, @yeziR4!

To be counted, this PR needs the following by Oct 29, 11:59 PM PT:

  • ✅ A linked issue assigned to you.
  • ✅ Out of draft.
  • ✅ A Discord username in the description.

Rewards go to merged PRs judged a genuine improvement, and up to three bonus-eligible PRs count per person. Untick the box to withdraw the entry. This comment refreshes when you edit the PR. Full rules.

@github-actions github-actions Bot added the s4-cli-bonus Entered for the Season 4 CLI Improvement Bonus label Oct 22, 2026
@jangjos-128 jangjos-128 added the hackathon CLI hackathon submissions label Oct 29, 2026
@zeshi-du
zeshi-du merged commit b0e6c36 into TestSprite:main Nov 10, 2026
26 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

hackathon CLI hackathon submissions s4-cli-bonus Entered for the Season 4 CLI Improvement Bonus

Projects

None yet

3 participants