fix(dual-approval): replace echo with printf for REVIEWS jq pipe (PRI-1757) #190
Open
Gandalf the Greybeard
wants to merge 1 commits from
gandalf/fix-echo-printf-pri-1757 into main
pull from: gandalf/fix-echo-printf-pri-1757
merge into: privilegedescalation:main
privilegedescalation:main
privilegedescalation:pri-1737-inline-release
privilegedescalation:gandalf/cleanup-agent-artifacts
privilegedescalation:dev
privilegedescalation:gandalf/cleanup-root-artifacts
privilegedescalation:uat
privilegedescalation:promote/uat-artifacthub-v1.0.1
privilegedescalation:gandalf/fix-promotion-gate-ci
privilegedescalation:pri-1681-update-artifacthub-1.0.1
privilegedescalation:fix/release-tarball-pattern
privilegedescalation:gandalf/pri-1671-pnpm-install
privilegedescalation:nancy/fix-dual-approval-uat-regress
privilegedescalation:gandalf/pri-1659-inline-release-workflow
privilegedescalation:gandalf/pri-1636-inline-dual-approval
privilegedescalation:inline-ci-2adb87e5
privilegedescalation:gandalf/fix-polaris-ah-url
privilegedescalation:docs/update-headlamp-namespace
privilegedescalation:hugh/fix-stale-rbac-path-pri-1002
privilegedescalation:gandalf/remove-orphaned-polaris-rbac-pri-917
privilegedescalation:gandalf/reference-shared-infra-rbac-pri-750
privilegedescalation:hugh/update-rbac-to-shared-infra
privilegedescalation:gandalf/add-renovate-github-action
privilegedescalation:pr-142
privilegedescalation:gandalf/fix-rbac-workflow-pri-324
privilegedescalation:gandalf/rename-ns-headlamp-dev
privilegedescalation:gandalf/remove-privilegedescalation-dev-namespace
privilegedescalation:pr-132-fix
privilegedescalation:gandalf/fix-rbac-manifest-PRI-555
privilegedescalation:chore/scrub-dependabot-references
privilegedescalation:gandalf/fix-markdown-lint-pri-391
privilegedescalation:gandalf/fix-e2e-rbac-pri-313
privilegedescalation:gandalf/fix-e2e-polaris-rbac
privilegedescalation:gandalf/fix-lodash-lockfile
privilegedescalation:fix/e2e-concurrency-serialization
No Reviewers
Dismiss Review
Are you sure you want to dismiss this review?
Labels
Clear labels
P0
P0
bug
bug
cla:approved
cla:approved
confirmed
confirmed
documentation
documentation
duplicate
duplicate
e2e
e2e
enhancement
enhancement
good first issue
good first issue
help wanted
help wanted
infra
infra
invalid
invalid
pri-917
pri-917
question
question
typecheck
typecheck
typescript
typescript
wontfix
wontfix
Must fix - blocking
Must fix - blocking
Something isn't working
Something isn't working
Improvements or additions to documentation
Improvements or additions to documentation
This issue or pull request already exists
This issue or pull request already exists
New feature or request
New feature or request
Good for newcomers
Good for newcomers
Extra attention is needed
Extra attention is needed
Infrastructure/ops work
Infrastructure/ops work
This doesn't seem right
This doesn't seem right
Further information is requested
Further information is requested
This will not be worked on
This will not be worked on
No Label
Milestone
No items
No Milestone
Projects
Clear projects
No project
Assignees
cpfarhood (Chris Farhood)
ci (Continuous Integration [bot])
pe_countess (Countess von Containerheim)
flux (Flux CD)
pe_gandalf (Gandalf the Greybeard)
admin (Gitea Admin)
pe_hugh (Hugh Hackman)
pe_karen (Kubectl Karen)
renovate (Mend Renovate)
pe_nancy (Null Pointer Nancy)
pe_patty (Pixel Patty)
pe_regina (Regression Regina)
Clear assignees
No Assignees
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: privilegedescalation/headlamp-polaris-plugin#190
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking 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.