From 5f7bfb58902fd9e5218a3ad813865bae637c6e32 Mon Sep 17 00:00:00 2001 From: Jon Kazama Date: Sat, 16 May 2026 14:08:19 +0200 Subject: [PATCH] fix(preflight): avoid jq SIGPIPE race in verify-changelog-sync The Block C check used `jq -r '.[0].Changelog' | grep -qE ...` to spot the **vX.Y.Z** marker. With `set -o pipefail`, grep -q closing stdin on the first match makes jq trip SIGPIPE on the rest of the multi-KB Changelog string, which the script then surfaces as a false-positive "Changelog missing **vX.Y.Z** subblock" failure. Interactive shells sometimes raced through fast enough to hide the issue, but the pre-push runner hit it reliably (saw it on the v1.4.10 release-cut push attempt). Switched the pipe to a process substitution so jq writes into a FIFO and SIGPIPE never enters the picture. Both directions of the marker check now stay deterministic. --- scripts/verify-changelog-sync.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/scripts/verify-changelog-sync.sh b/scripts/verify-changelog-sync.sh index 012f12d..4d864c8 100755 --- a/scripts/verify-changelog-sync.sh +++ b/scripts/verify-changelog-sync.sh @@ -19,7 +19,12 @@ TAG="v$VER" grep -qE "^[[:space:]]*\*\*v${VER}[^0-9]" "$YAML" \ || fail "$YAML changelog missing **v${VER}** subblock. Fix: add the v${VER} block at the top of the changelog field." -jq -r '.[0].Changelog' "$REPO_JSON" | grep -qE "^[[:space:]]*\*\*v${VER}[^0-9]" \ +# Process substitution instead of `jq | grep -q` — grep -q closes stdin on the +# first match, jq keeps writing the multi-KB Changelog string and trips SIGPIPE, +# which `set -o pipefail` then turns into a false-positive FAIL. Manifested as a +# `jq: writing output failed: Broken pipe` line plus a misleading "Changelog +# missing **vX.Y.Z** subblock" message during pre-push runs. +grep -qE "^[[:space:]]*\*\*v${VER}[^0-9]" <(jq -r '.[0].Changelog' "$REPO_JSON") \ || fail "$REPO_JSON Changelog missing **v${VER}** subblock. Fix: copy the yaml changelog over." FORGE_FILE="$FORGE_DIR/${TAG}.md"