Skip to content

Skip the Invalid-Byte Selftest Probe When Windows Git Cannot Add the Name - #3350

Merged
ptr727 merged 3 commits into
developfrom
feature/audit-selftest-windows-invalid-byte
Oct 22, 2026
Merged

ptr727 merged 3 commits into
developfrom
feature/audit-selftest-windows-invalid-byte

Conversation

@ptr727

@ptr727 ptr727 commented Oct 22, 2026

Copy link
Copy Markdown
Owner

The hub_tracked probe in the audit self-test aborted on Windows when git add exited 128 on its non-UTF-8 filename. Now only that add's failure skips the probe, and only on Windows. Any other git failure still aborts, and a failing add elsewhere still fails loudly. The Windows skip on the self-test wrapper test is removed.

Tests simulate the Windows failure on Linux by patching the platform flag and subprocess.run, and skip on hosts that cannot create the name. Reverting either branch of the fix fails a test. Real Windows verification is this PR's Windows CI job.

Closes #3338

🤖 Generated with Claude Code

ptr727 and others added 3 commits October 22, 2026 06:41
The hub_tracked probe aborted audit.py --selftest on Windows when git add
exited 128 on the non-UTF-8 filename. Only that add now skips, as for a name
the filesystem refuses, and every other git failure still aborts. The Windows
skip on the selftest wrapper test is removed.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
A failing add of the probe file skips only on Windows, where git rejects the
name. Elsewhere it fails loudly. The tests now run on hosts that cannot create
the name by skipping rather than failing.

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 13:45
@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.

@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 (201cbe7) to head (749fe31).

Additional details and impacted files
@@             Coverage Diff              @@
##           develop    #3350       +/-   ##
============================================
+ Coverage    65.53%   81.32%   +15.78%     
============================================
  Files           18       18               
  Lines        10036    10045        +9     
============================================
+ Hits          6577     8169     +1592     
+ Misses        3459     1876     -1583     
Flag Coverage Δ
python-3.13 81.32% <100.00%> (+15.78%) ⬆️

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.

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

No unresolved review issues were identified, and all reviewers assessed it as ready for approval.

No open issues 🎉

What changed in this PR

This pull request updates the audit self-test to tolerate Windows Git's inability to stage an intentionally invalid-byte filename while preserving failures from other operations and platforms.

Changes:

  • Adds Windows-only handling for the invalid-byte probe's git add -A failure.
  • Adds tests for Windows skipping and failure propagation.
  • Removes the obsolete Windows skip from the Git environment test.
File Description
tests/​test_git_env.py Re-enables the self-test environment-isolation test on Windows.
tests/​test_audit.py Tests platform-specific skipping and propagation of unrelated Git failures.
spec/​audit.py Handles the Windows-specific invalid-byte staging failure without suppressing other failures.

Review effort: Lite

@ptr727
ptr727 merged commit acb46d0 into develop Oct 22, 2026
14 checks passed
@ptr727
ptr727 deleted the feature/audit-selftest-windows-invalid-byte branch October 22, 2026 14:20
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