Repository navigation
test(push-guard): pin utf-8 on the test_push_guard subprocess call - #20141
Conversation
First Principles Review (Opus 5.5) — ⏭️ skippedRevision |
UX Review (Opus 5.5) — ⏭️ skippedRevision |
Design Review (Opus 5.5) — ✅ PASSDesign-level review of Design-Verdict: PASS Nothing to check. [DESIGN-REVIEWED] 0127b68 Description read[DESCRIPTION-READ] 167bd554c36780c328e77adc84b1fc4057da5d5f8b3509289b725a79767860f9 That sha256 names everything this verdict read: the PR description, plus the 1 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with |
Opus 5.5 Review — ✅ no blocking findingsReviewed Verdict parsed from the review's SHA-scoped output markers for commit False positive or not applicable? A repository writer can comment: |
GPT 6.1 Review — ✅ no blocking findingsGPT 6.1 completed its review of This comment is updated in place on each push. Review detailsNo findings. False positive or not applicable? A repository writer can comment: |
|
Closing and reopening so CI runs on hosted runners: same-repo runs from this account queue on the fleet label without a runner (details on #19683). |
1a18301 to
0127b68
Compare
|
Closing and reopening so CI runs on hosted runners: same-repo runs from this account queue on the fleet label without a runner (details on #19683). |
KiroCrewCaptain
left a comment
There was a problem hiding this comment.
Tier 1 auto-approve: test (2 files). Criteria: no conflict, no requested changes, security path denylist clean, design-doc gate clean, security checklist all-NO, no reviewer-lane findings, readiness signal fresh for this head SHA, declared category matches the diff. Category: pins utf-8 decoding on one test subprocess call and drops that file from the subprocess-encoding baseline.
Problem / Motivation
Goal: The
githelper intest/test_push_guard.pydecodes its output as UTF-8 on every platform, and one more entry leaves.github/subprocess-encoding-baseline.txt._git(test/test_push_guard.py:129) callssubprocess.run(..., text=True)with noencoding=. A text-mode subprocess call without an explicit encoding decodes the child's output with the locale's code page: UTF-8 on POSIX, the legacy ANSI code page on Windows, so a non-ASCII byte from the child comes back as mojibake there (#5249).scripts/check_subprocess_encoding.pyis the ratchet for this class: every remaining offender is listed in.github/subprocess-encoding-baseline.txtas<count> <path>, and the counts may only shrink. This file is listed as1 test/test_push_guard.py.Why it matters
_gitis the file's shared helper for running git in its fixture repositories (482 call sites), so a decode that depends on the host code page sits under every one of them. This is burn-down of the ratchet, not a fix for an observed failure. On a UTF-8 locale nothing changes. The baseline goes from 198 known calls in 93 files to 197 in 92.Not a goal
**UTF8_TEXTsplat and noerrors=policy. The file pinsencoding="utf-8"inline on its file reads and writes and does not importUTF8_TEXT; the mapping also carriestext=True, which this call already passes, anderrors="replace", which would loosen the decode.What changed (motivation → approach → change)
_githelper'ssubprocess.runis text-mode with no encoding, so the gate lists the file in the baseline.git, which emits UTF-8 (seesrc/kiro_crew/subprocess_utf8.py).encoding="utf-8",is added aftertext=True,in_git(test/test_push_guard.py:129), and the line1 test/test_push_guard.pyis removed from.github/subprocess-encoding-baseline.txt. Two files, +1 / -1 lines.Backwards compatibility
Removes nothing: a keyword argument on one test helper. No production code, public API or protocol changes, and on a UTF-8 locale the decode is the same strict UTF-8 as before.
Tests
Proof, run on this branch (Linux):
RATCHET_SCOPE_WHOLE_TREE=1 python3 scripts/check_subprocess_encoding.pyexits 1 (1 new offender(s),test/test_push_guard.py:129).python3 scripts/check_subprocess_encoding.py --testexits 0 (9 flagged probes, 9 clean probes).python3 scripts/check_subprocess_encoding.pyexits 0 on the diff scope with both files in scope, and withRATCHET_SCOPE_WHOLE_TREE=1(197 known calls in 92 files, was 198 in 93).pytest test/test_push_guard.py -q: 235 passed before, 235 passed after.-n0withtest/test_taskrunner_atomic_persistence.pyandtest/test_taskrunner_execution_capture_async.pyafter it: 271 passed.flake8 test/test_push_guard.pyexits 0.GITHUB_BASE_REF=main python scripts/check_black_formatting.pyexits 0 (Black 26.3.1).scripts/check_comment_history.pyexits 0.Manual verification
N/A: the change is one keyword argument on a test helper, covered by the gate and the file's own tests. Windows was not run here.
Related Issues
No issue exists; burn-down of the subprocess-encoding baseline (precedents: the gate's own PR #5378, and the earlier burn-downs #14648, #14664 and #16447).
Checklist