fix(tools): handle broken pipe in debt_report #27515
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/27515"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by NobleBrains on 2026-11-26T15:57:12Z.
What
Handle
BrokenPipeErrorcleanly intools/debt_report.pyby redirectingsys.stdouttoos.devnulland exiting with status 0 instead of printing a traceback when piped toheador similar commands. Add a subprocess regression test intools/tests/test_debt_report.py.Tested
python3 tools/debt_report.py | head -n 5(exits 0 with no traceback)python3 -m unittest tools/tests/test_debt_report.py(23 tests passed)python3 tools/check_conventions.py(passed)Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)Summary by CodeRabbit
Imported from boykopovar/AnyPS5. Originally posted by coderabbitai[bot] on 2026-11-26T16:00:54Z.
Review: COMMENTED
4a9a2243-cc7a-4bc4-9d6c-8e06badeeccbReviewing files that changed from the base of the PR and between
10fef81d2aand496c78c432.tools/debt_report.pytools/tests/test_debt_report.pyIncluded review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 4 remain after this review.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-26T16:25:15Z.
Review: COMMENTED
Reviewed — no blocking findings
The changed code handles broken pipes in both output modes, but the described checks were not run in this review, so a formal approval is not justified.
What I ran
Reviewed head
611ab079d2f3eb66ece712ab4659d0133e27a781. No commands were run; this review environment provides the pinned reader but no shell.Results
Findings
Blocking
None.
Non-blocking
None.
Not verified
The reported subprocess reproduction, 23 unit tests, and convention check were not run here. Both changed files listed in the manifest were read; no changed files were excluded. The separate
files.jsonexclusion list was not available through the reader.To get this to a good state
Nothing is required.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-26T20:50:16Z.
Review: COMMENTED
Reviewed — comments
Changes are required before merge: make the broken-pipe regression test close the pipe only after the child has started writing, so it deterministically exercises the handled error.
What I ran
Reviewed head
0bb90d11718c1a125f94bda24ad71255ab8fb50c. No commands or tests were run; source was inspected throughrepo_read.py.Results
Findings
Blocking
None.
Non-blocking
tools/tests/test_debt_report.py:218-222). The child can receive a broken pipe immediately, beforemainfinishes writing and reaches its explicit flush. That means the test can pass without covering the flush-time error path this change is intended to handle. Keep the read end open until the child has written enough output to fill the pipe, then close it and assert clean exit; alternatively use a controlled downstream process that closes after reading a small amount.Not verified
files.json; excluded-file details were not verified. The manifest lists both changed files as included, and both were read.To get this to a good state
Nothing is required. The test determinism point above is optional.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-28T12:17:55Z.
Review: COMMENTED
Reviewed — no blocking findings
The reviewed change handles broken pipe errors in both report formats, and I found no verified blocking defect; execution checks were not run in this review.
What I ran
Reviewed head
dbd83acebfbf146573b5da0404baf1ffd82e122busing the prepared diff andrepo_read.pyreader tools. I did not run commands or tests.Results
Findings
Blocking
None.
Non-blocking
None.
Sources
Not verified
No repository files were excluded by the manifest: both reviewed files were included and read.
files.jsonwas not available through the reader. Runtime behavior, test execution, and convention checks were not verified.To get this to a good state
Nothing is required. Optional: run the author's reported unit test and convention check commands on this head.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-29T08:06:38Z.
Review: APPROVED
Reviewed — looks good
The change handles broken-pipe errors during report output and adds a subprocess regression test; review was limited to the two included changed files at head
dc08a11244e438caff25858774d57669b75e5d57.What I ran
Read the prepared description, commits, manifest, diff, and both changed files through
repo_read.py. I did not run tests or other commands.Results
Findings
Blocking
None.
Non-blocking
None.
Not verified
Tests, conventions checks, and runtime behavior were not independently verified. The description reports 23 unit tests passed, the pipe example exited successfully without a traceback, and conventions passed. No files were excluded from the prepared manifest; both reviewed files were read.
To get this to a good state
Nothing is required.
Imported from boykopovar/AnyPS5. Originally posted by ligmaSec on 2026-12-03T07:27:03Z.
Review: COMMENTED
All 25 debt-report tests passed. The new subprocess test closes the Linux pipe and verifies clean exit without a traceback. The Windows-specific
EINVALhandling was reviewed in source.AI-assisted: yes.