Skip to content

Skip the Windows Self-Test Probe Only on Git's Invalid-Path Error - #3360

Merged
ptr727 merged 5 commits into
developfrom
fix/audit-selftest-skip-invalid-path-only
Oct 22, 2026
Merged

ptr727 merged 5 commits into
developfrom
fix/audit-selftest-skip-invalid-path-only

Conversation

@ptr727

@ptr727 ptr727 commented Oct 22, 2026

Copy link
Copy Markdown
Owner

Summary

  • Skip the Windows invalid-byte self-test probe only when git add reports an invalid path, and re-raise any other CalledProcessError.
  • Pin the narrowing in the probe tests: the skip case carries the invalid-path stderr, and a new case shows an unrelated Windows add failure still raises.

The previous skip covered every Windows git add failure, so an unrelated failure in the temporary repository passed --selftest. This addresses a review finding on the develop to main promotion. The Windows message text is reasoned from git's source and was not run on Windows from this host.

Local review: one pass, one finding (the existing test's stub carried no stderr), fixed in the second commit. Revert proof: with the old audit.py, the new unrelated-failure test fails.

🤖 Generated with Claude Code

ptr727 and others added 2 commits October 22, 2026 09:21
A Windows git add failure unrelated to the name no longer reads as an unsupported filename and passes --selftest.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Copilot AI lite review requested due to automatic review settings October 22, 2026 16:24
@coderabbitai

coderabbitai Bot commented Oct 22, 2026 •

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration
  • 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

Comment @coderabbitai help to get the list of available commands.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The reviewed changes have no unresolved findings, and all approval-readiness assessments support approval.

No open issues 🎉

What changed in this PR

This pull request narrows the Windows invalid-byte self-test exception so only Git’s invalid path error is skipped; unrelated git add failures are re-raised.

Changes:

  • Require invalid path in Git’s captured stderr before skipping on Windows.
  • Update the invalid-path test fixture with representative stderr.
  • Add regression coverage for unrelated Windows git add failures.
File Description
tests/​test_audit.py Adds invalid-path stderr and coverage verifying unrelated failures are re-raised.
spec/​audit.py Restricts the Windows self-test skip condition to invalid-path errors.

Review effort: Lite

@codecov

codecov Bot commented Oct 22, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 81.32%. Comparing base (e0a6dfc) to head (cd52753).

Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #3360   +/-   ##
========================================
  Coverage    81.32%   81.32%           
========================================
  Files           18       18           
  Lines        10045    10047    +2     
========================================
+ Hits          8169     8171    +2     
  Misses        1876     1876           
Flag Coverage Δ
python-3.13 81.32% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 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.

ptr727 and others added 3 commits October 22, 2026 09:47
…eason

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…robe

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
A control file added first makes any unrelated git failure raise on every platform.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@ptr727

ptr727 commented Oct 22, 2026

Copy link
Copy Markdown
Owner Author

A recorded local strict-review pass covers head cd52753b145c0065e9d0cce7220b19199cefaf13, the content this pull request carries at that commit against develop, and it recorded 0 findings.

@ptr727
ptr727 merged commit 075ec57 into develop Oct 22, 2026
13 checks passed
ptr727 added a commit that referenced this pull request Oct 22, 2026
…dows Self-Test Skip, and Subprocess Failure Rule to Main (#3359)

## Summary

- Skip the invalid-byte audit self-test probe when Windows Git cannot
add the name, so the self-test no longer fails on a host that cannot
represent the path (#3350). The skip fires only on that one add, after a
control file's add has proven git works (#3360).
- Read a backslash-newline in the write guard by its quoting: inside
single quotes and quoted heredoc data it is text, and a continuation
after a shell operator is no word split (#3357).
- Keep each escaped backslash pair before a kept line break in the
guard's readings, as the shell does, and state the kept-span word and
names tests in full in the README and docstring (#3368).
- Add a `CODESTYLE.md` General rule: classify a subprocess failure by
which command failed and the status code it reports, never by the
wording of its message (#3366).

Closes #3338
Closes #3358
Closes #3363

Refs #3344, which stays open because only part of it is fixed here.
#3358's Markdown-body finding moves to #3354.

🤖 Generated with [Claude Code](https://claude.com/claude-code)
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.

2 participants