Repository navigation
fix(ci-gate): strip 4-byte UTF-8 from status descriptions before truncating (stacked on #142) - #145
hyperpolymath wants to merge 2 commits into
Conversation
…cating The statuses API rejects a description with a codepoint above U+FFFF (HTTP 422), and consumer check and workflow names carry emoji, so the POST failed and the failure handler posted a false red. clip() in ci-gate-publish.sh (the one write site for verdicts, die() included) and the early re-run pending line now strip U+10000..U+10FFFF first, then cut to 140 characters. Tests run the extracted expressions, plus an end-to-end publisher run against a fake gh that refuses 4-byte descriptions. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01J4QvDiRggj6apeRQKPpAVR
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the
|
Replace the gsub("[\\x{10000}-\\x{10FFFF}]"; "") strip with the canonical
expression shipped in #144, explode | map(select(. <= 65535)) | implode. It is
applied before the 140-character cap, exactly as before.
There is no behaviour change: both forms drop every codepoint above U+FFFF, and
they were tested equal on jq 1.6, 1.7, 1.7.1, 1.8.0 and 1.8.1.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01J4QvDiRggj6apeRQKPpAVR
|
|
Locally, Generated by Claude Code |
|
Closing on the owner's decision. #139 merged with all of #142's commits, and the 4-byte sanitiser now lands through #148, which supersedes #144 as well. Nothing here needs to be kept. Generated by Claude Code |



Bug
The reusable
ci-gate.ymlposts commit statusCI/gate. GitHub's statuses API rejects anydescriptioncontaining a codepoint above U+FFFF (HTTP 422 "Description doesn't accept 4-byte Unicode"). Consumer workflow, job and check names carry emoji (for example a name starting with a red circle or a yellow circle), and those names reach the description (failed: ...,waiting for ...,re-run started: <run name>). The POST fails, the step exits 1, and the failure handler postsCI/gate = failure: a false red.Fix and chokepoint
Strip every codepoint above U+FFFF with the regex-free
explode | map(select(. <= 65535)) | implode(the same expression as #144, defined once asBMP_ONLYin the publisher) BEFORE truncating to 140 characters.clip()inscripts/ci-gate-publish.sh: the single write site for verdicts (post(), sodie()too). The verdict script's descriptions all reach GitHub only through it..github/workflows/ci-gate.yml: a second write site that runs before any suite file can be read, so it carries the same expression inline.tests/ci-gate.shasserts that this inline copy contains the publisher'sBMP_ONLYtext exactly.The earlier revision of this PR used the equivalent
gsub("[\\x{10000}-\\x{10FFFF}]"; ""). It was replaced to align with #144; there is no behaviour change, and both forms were tested equal on jq 1.6, 1.7, 1.7.1, 1.8.0 and 1.8.1.jq versions verified
tests/ci-gate.shpasses in full (512 passed, 0 failed) under each of jq 1.6, 1.7, 1.7.1, 1.8.0 and 1.8.1, and under the system jq (1.7). The negative control still uses the original pre-fix expression, which keeps the emoji.Test evidence (
tests/ci-gate.sh)ghthat refuses 4-byte descriptions like the real API.bash -n. Other lock/contract tests were run:lock-transitive-closure(23/5),lock-pin-contract,lock-self-source-controls,workflow-lock-scope(needs mikefarah yq) andgate-action-ownersfail identically at the unmodified base in this sandbox, so they are not caused by this change.ci-gate-tamper-guard73/0,composite-shell-contract28/0.Supersession
The canonical fix lands on #139's stack. #139 already contains #142's commits, so #142 may be superseded; this PR only exists so #142's head is not left with the bug if it merges first.
Gate-file change
This changes
ci-gate.ymlandci-gate-publish.sh; an admin may need to apply thegate-change-approvedlabel. Agents do not apply it.What is NOT proven
gh.%G?) could not be confirmed locally (no allowed-signers file in the sandbox).Generated by Claude Code