Repository navigation
Conversation
acd2c25 to
2aa869a
Compare
2aa869a to
226adc7
Compare
Git-on-my-level
left a comment
There was a problem hiding this comment.
Thanks for the focused Windows preflight fix. This looks like the right direction: the changed Git subprocess reads now decode repository content as UTF-8 explicitly, and the added tests cover the deployment boundary, deferred-work marker, and line-ratchet paths that were still relying on the host locale.
I also ran the touched tests in a stripped environment:
python .github/scripts/test_check_deployment_secret_boundary.py-> 9 passedpython .github/scripts/test_check_product_file_line_count_ratchet.py-> 9 passedpython .github/scripts/test_run_checks.py DeferredMarkerTests-> 3 passed
No blocking code issues found from my review. Since this touches GitHub/preflight guard scripts that enforce security/workflow policy, I am leaving this as a positive maintainer signal rather than formal approval; a human maintainer should still sign off before merge.
by AI on behalf of David — if you need David’s attention urgently, please @Git-on-my-level and escalate with need human response.
kodjima33
left a comment
There was a problem hiding this comment.
CI check-script portability fix (UTF-8 decode of Git content on Windows). Approve-only — .github/ tooling stays out of agent merge authority.
The product line-count ratchet read baseline paths and JSON blobs with the Windows host code page. Decode all three Git content reads explicitly as UTF-8 and lock both sharded and legacy paths with a subprocess contract test.
226adc7 to
72a25e7
Compare
kodjima33
left a comment
There was a problem hiding this comment.
Verified: text=True decoded git output with the Windows ANSI code page; the change is encoding='utf-8' on three preflight guards plus formatter reflow — no check is weakened, new regression test asserts the encoding kwarg.
* fix(preflight): decode gh metadata as UTF-8 Decode captured gh PR JSON with the producer's UTF-8 encoding instead of the Windows host code page. Add a Unicode metadata contract and register the recurring subprocess locale failure class with #10595 and #10844 as evidence. Tests: MetadataTests passed 14/14; the real #10823 body loaded under preferred_encoding=cp936; Ruff, Black, py_compile, and diff checks passed. Failure-Class: new * fix(preflight): propagate UTF-8 through Windows runner * fix(preflight): pin suggestion subprocess UTF-8 * test(preflight): pin nested subprocess UTF-8 * fix(preflight): emit direct Windows output as UTF-8 --------- Co-authored-by: 491034170 <[email protected]>
…#10595) * fix(preflight): decode deployment Git output as UTF-8 * fix(preflight): decode deferred-work Git output as UTF-8 * fix(preflight): decode line-ratchet Git output as UTF-8 The product line-count ratchet read baseline paths and JSON blobs with the Windows host code page. Decode all three Git content reads explicitly as UTF-8 and lock both sharded and legacy paths with a subprocess contract test. --------- Co-authored-by: 491034170 <[email protected]>
What changed and why
Decode Git repository content explicitly as UTF-8 in three deterministic preflight guards instead of using the Windows host locale:
git ls-treeandgit show;git diffandgit show;git ls-treeandgit show.Git repository paths and blobs are UTF-8 data, but Python's
text=Trueused the active Windows code page (GBK in the reproduced environment). A valid Unicode source comment or baseline justification could therefore crash these guards before they enforced policy.Product invariants affected
none
How it was verified
python .github/scripts/check_deployment_secret_boundary.py --base HEADfailed withUnicodeDecodeError: 'gbk' codec can't decode byte ...; the same production command passed after the fix.scripts/pr-preflightcrashed while decoding a real Unicode TypeScript diff.baseline_at_ref()while decoding a real baseline shard; the same production command now passes withoutPYTHONUTF8.python .github/scripts/test_check_deployment_secret_boundary.py-> 9 passed.python .github/scripts/test_run_checks.py DeferredMarkerTests-> 3 passed.python .github/scripts/test_check_product_file_line_count_ratchet.py-> 9 passed.scripts/pr-preflight --pr-body-file ...in an integration worktree with fix(ci): support Windows in manifest preflight #10594 applied -> all 15 selected checks passed withoutPYTHONUTF8.git diff --checkpassed on all changed Python files.Tests
The deployment fixture commits UTF-8 workflow content, exercising the real
git showpath. Mocked subprocess contracts require all seven Git content reads across the three guards to passencoding="utf-8"; the line-ratchet contract covers both sharded and legacy baseline paths, so Linux CI also rejects a future return to locale-driven decoding.Failure class (fixes)
Failure-Class: none
Root cause and durable guard (bug fixes)
Python inherited the Windows locale when
subprocess.run(..., text=True)decoded Git output. All affected guards now declare strict UTF-8 decoding at the Git boundary, with production-path and configuration-contract regression coverage.