From 2f4003f14d9e99ab1fbc7d7b658d343e55fc4dd1 Mon Sep 17 00:00:00 2001 From: Garry Tan Date: Tue, 2 Jun 2026 15:06:06 -0700 Subject: [PATCH] fix(ci): ci-cache-hash re-admit matched a literal \t, a no-op on GNU grep MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The policy-doc re-admit (75992b77) put `\t` inline in the ALLOW patterns passed to `grep -E`. BSD grep (macOS local) treats `\t` as a tab so it worked locally; GNU grep (Ubuntu CI) treats it as literal `t`, so nothing re-admitted and docs/TESTING.md / docs/RELEASING.md stayed deny-listed — the two policy-doc tests failed on CI shard 6 (1097 pass / 2 fail). Build ALLOW_RE with `printf '\t(%s)'` so the tab is a real byte, identical in construction to DENY_RE (line 117), which the CI log shows matches correctly on GNU grep. End-to-end: editing docs/TESTING.md now flips the hash; a normal docs/*.md add still does not (deny stays scoped). --- scripts/ci-cache-hash.sh | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/scripts/ci-cache-hash.sh b/scripts/ci-cache-hash.sh index 0e6f4af15..a8e3af767 100755 --- a/scripts/ci-cache-hash.sh +++ b/scripts/ci-cache-hash.sh @@ -129,15 +129,21 @@ INCLUDED=$(printf '%s\n' "$LS_FILES" | grep -vE "$DENY_RE" || true) # anchor on the `\t` boundary in `git ls-files -s` output, matching # the deny-list convention above. Re-admitted lines that don't exist yet # (pre-relocation) simply match nothing. +# Path predicates only (no leading tab here) — the `\t` boundary is added +# via printf below so it is a REAL tab byte, not the two-char string `\t`. +# GNU grep (CI/Ubuntu) does not interpret `\t` in an ERE as a tab the way +# BSD grep (macOS) does, so an inline `\t` matches nothing on CI and the +# re-admit silently no-ops. Mirror the DENY_RE construction exactly. ALLOW_PATTERNS=( - '\tdocs/TESTING\.md$' - '\tdocs/RELEASING\.md$' + 'docs/TESTING\.md$' + 'docs/RELEASING\.md$' ) ALLOW_ALT="" for p in "${ALLOW_PATTERNS[@]}"; do if [ -z "$ALLOW_ALT" ]; then ALLOW_ALT="$p"; else ALLOW_ALT="$ALLOW_ALT|$p"; fi done -READMIT=$(printf '%s\n' "$LS_FILES" | grep -E "($ALLOW_ALT)" || true) +ALLOW_RE=$(printf '\t(%s)' "$ALLOW_ALT") +READMIT=$(printf '%s\n' "$LS_FILES" | grep -E "$ALLOW_RE" || true) if [ -n "$READMIT" ]; then INCLUDED=$(printf '%s\n%s\n' "$INCLUDED" "$READMIT" | grep -v '^$' | LC_ALL=C sort -u) fi