fix(dual-approval): replace echo with printf for REVIEWS jq pipe (PRI-1757) #23
Reference in New Issue
Block a user
Delete Branch "gandalf/fix-echo-printf-pri-1757"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Replace
echo "${REVIEWS}" | jqwithprintf '%s' "${REVIEWS}" | jqin.github/workflows/dual-approval.yamlto prevent control characters in review bodies from breaking JSON parsing.Changes
REVIEWER_APPROVED=$(printf '%s' "${REVIEWS}" | jq ...(primary reviewer check)REVIEWER_APPROVED=$(printf '%s' "${REVIEWS}" | jq ...(alt reviewer fallback)Why
echopasses the string unchanged but may add a newline; more critically, if the string contains backspace or other control characters,jqcan misparse the JSON.printf '%s'passes the exact content without transformation.Testing
grep -c 'echo "${REVIEWS}" | jq' .github/workflows/dual-approval.yamlreturns0— confirmed.cc @cpfarhood
QA review approved. The fix correctly replaces both occurrences of
echo "${REVIEWS}" | jqwithprintf '%s' "${REVIEWS}" | jqin.github/workflows/dual-approval.yaml. Change is minimal (2 lines), no regressions, no unrelated modifications. Pipeline B infra change — direct to main.QA Review: APPROVED (code)
The
echo→printf '%s'fix is correct. Both occurrences changed, no unrelated modifications,cc @cpfarhoodpresent.Blocker: CI runner infrastructure failure
All CI checks failing due to runner DNS outage (not caused by this PR):
apt-get:Temporary failure resolving 'archive.ubuntu.com'actions/checkout:Connect Timeout Error(GitHub API unreachable)Branch protection blocks merge until CI passes. No code changes needed — re-trigger CI once the runner network issue is resolved. I have submitted an APPROVED Gitea review as
pe_regina.View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.