Repository navigation
test(deploy): pin utf-8 on the test_deploy_web_profiles subprocess call - #20140
Conversation
UX Review (Opus 5.5) — ⏭️ skippedRevision |
First Principles Review (Opus 5.5) — ⏭️ skippedRevision |
Design Review (Opus 5.5) — ✅ PASSDesign-level review of Design-Verdict: PASS Nothing to check. [DESIGN-REVIEWED] fef9675 Description read[DESCRIPTION-READ] c2c96cf5b267d18e2d414ca007ddb1ebf53bc2ccb32e75c53eef65fc3754586a 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). |
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 on one test subprocess call and drops its line from the encoding baseline.
Problem / Motivation
Goal: Make one test's subprocess call decode its output as UTF-8 on every platform instead of the host code page, and take that file off the subprocess-encoding baseline.
test/test_deploy_web_profiles.pyruns one text-modesubprocess.run(line 226, intest_create_aws_profile_writes_only_allowlisted_keys) withtext=Trueand noencoding=. Without an explicit encoding Python decodes the child's output with the locale's code page: UTF-8 on POSIX, the legacy ANSI code page on Windows, where any non-ASCII byte comes back as mojibake (#5249 is the public reference for this class).scripts/check_subprocess_encoding.pykeeps a shrink-only list of such calls in.github/subprocess-encoding-baseline.txt, and this file is listed there as1 test/test_deploy_web_profiles.py.Why it matters
Test-only: no shipped behaviour changes, and nothing fails today because the child prints ASCII JSON. The call is still a place where the Linux and Windows runs of this test could decode differently, and its baseline entry can only be removed by pinning it. With the entry gone, the ratchet holds this file at zero, so a new unpinned call added here later fails CI instead of passing as grandfathered.
Not a goal
python -ccredential helper thatsrc/kiro_crew/deploy/profiles.pygenerates also callsawsin text mode. It is a string literal the gate does not scan, it is generated only on POSIX (the function returns early on Windows), and it is production code outside this test-only change.What changed (motivation → approach → change)
The call decoded with the locale because
text=Truewas given withoutencoding=. The change is the argument the gate asks for:encoding="utf-8"onsubprocess.run(parts, capture_output=True, text=True, env=env)attest/test_deploy_web_profiles.py:226, the same formtest/test_deploy_round1_fixes.pyalready uses for itsbash -ncheck. The child is the generatedcredential_processcommand (python -c, which runs a fakeawsscript found onPATH) and it prints ASCII JSON fromjson.dumps, which UTF-8 decodes identically on every platform. The baseline line1 test/test_deploy_web_profiles.pyis deleted in the same change. Two files change: one edited call and one removed baseline line.Backwards compatibility
Removes nothing: a test-only edit plus one removed baseline entry; no shipped code, API or data changes.
Tests
RATCHET_SCOPE_WHOLE_TREE=1 python3 scripts/check_subprocess_encoding.py): exit 1, "1 new offender(s)",test/test_deploy_web_profiles.py:226. The plain run judges only the committed diff, so it needs the override to see this.python3 scripts/check_subprocess_encoding.py --testexit 0, andpython3 scripts/check_subprocess_encoding.pyexit 0 with both files in scope.pytest test/test_deploy_web_profiles.py -q: 20 passed before, 20 passed after. Run in one process at-n0withtest/test_taskrunner_atomic_persistence.pyandtest/test_taskrunner_execution_capture_async.pyafter it (the file first, to expose a leaked patch): exit 0.GITHUB_BASE_REF=main python3 scripts/check_black_formatting.pyexit 0 under the pinned black (26.3.1). The file is already in.github/black-baseline.txt; no formatter hunk touches the edited line, which is 91 characters against the limit of 100.Manual verification
N/A — the ratchet and the file's own tests are sufficient; the Windows decode itself cannot be exercised on Linux.
Screenshots / video
N/A — test-only change, no user-visible UI.
Related Issues
No issue exists; burn-down of the subprocess-encoding baseline (precedents: the gate's own PR #5378, and #8443, which shrank the same baseline).
Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)