Repository navigation
🌱 test(scripts): deflake confirm-fixed DRY_RUN assertion (SIGPIPE under pipefail) - #16151
Conversation
… pipefail) `printf '%s\n' "$output" | grep -q 'DRY-RUN'` races: grep -q exits on first match, printf gets EPIPE, and with `set -o pipefail` the whole condition is reported false even though every assertion held. Seen in build-and-test on #16149 ("printf: write error: Broken pipe"). Use a here-string so there is no writer to kill. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: quality <280983584+hivecommons-hive[bot]@users.noreply.github.com>
Generated by changelog-fragment-guard from the PR title (#5675). Edit the wording freely, or replace this file with the no-changelog label if the change is not user-visible. Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Signed-off-by: hivecommons-hive[bot] <280983584+hivecommons-hive[bot]@users.noreply.github.com>
Open PR overlap checkBase branch: Conflicts are checked with every PR merged onto the current tip of No conflicting open PRs or same-file overlaps were found. |
There was a problem hiding this comment.
Correctness review (head a5b0a52) — the shell fix is correct; the PR is blocked by its own changelog fragment.
changelog.d/fixed-test-confirm-fixed-sigpipe.md:1has no-bullet →changelog-fragment-guardfails. The file is a bare sentence ("Deflakedtest-issue-confirm-fixed.sh: …");src/scripts/check-changelog-fragment.sh:74rejects any fragment not starting with-(CI job 124811018719:##[error]a fragment must start with a '- ' entry bullet). It is also redundant:changelog.d/changed-16151.mdalready carries a well-formed bullet for the same change, andsrc/scripts/test[-_]*.shis auto-exempt from the fragment requirement (check-changelog-fragment.sh:87). Fix: deletechangelog.d/fixed-test-confirm-fixed-sigpipe.md(two fragments in two categories would otherwise emit the same entry twice under### Changedand### Fixed).
Verified the fix itself: src/scripts/test-issue-confirm-fixed.sh:24 sets set -euo pipefail, line 236 is the only grep -q fed by a pipe from a process (lines 81–203 all grep files), and the here-string removes the writer that raced EPIPE. No other assertion changed.
— hive: agent=ci-maintainer backend=copilot model=claude-fable-5.1 copilot=1.0.88
|
Hive status — updated in place; edits do not notify. Full history is in the Activity Monitor. Review findings from The code change is correct; the governance re-pin is mechanically right but is a trust anchor, so I am routing that part to an approver rather than judging it alone. What I verified against the tree at
Why a human anyway: that literal is the only thing standing between a No defects found. I have not approved or changed anything. hive/awaiting-ci: build-and-test failed in integration-governance.test.cjs because 🐝 Hive Agent: — hive: agent=scanner backend=copilot model=claude-fable-5.1 copilot=1.0.88 Review findings from The fix is correct and I reproduced the flake; the only open point is who signs off a trust-anchor re-pin. Correctness (verified against the tree at
Routing, not a defect: |
Signed-off-by: scanner <280983584+hivecommons-hive[bot]@users.noreply.github.com>
There was a problem hiding this comment.
The script fix is correct; the PR is blocked only by a malformed changelog fragment.
Fix verified. src/scripts/test-issue-confirm-fixed.sh:5 sets set -u -o pipefail, so printf '%s\n' "$output" | grep -q 'DRY-RUN' could indeed return non-zero when grep -q exits on first match and printf takes EPIPE — exactly the line 234: printf: write error: Broken pipe seen on #16149. The here-string at test-issue-confirm-fixed.sh:236 removes the writer process. I checked every other grep -q in the script (lines 81, 82, 120-122, 128-129, 139, 174, 203): all read $CALL_LOG/$BODY_LOG directly, none is fed by a pipe, so the body's "only this one instance" claim holds.
Why CI is red. changelog-fragment-guard fails on this head with:
a fragment must start with a '- ' entry bullet (or a '' marker) — it IS the entry; the compiler owns the ### headings
changelog.d/fixed-test-confirm-fixed-sigpipe.md is a bare sentence with no - prefix. The hive-generated changelog.d/changed-16151.md already carries a well-formed entry for this PR, so the simplest fix is to delete fixed-test-confirm-fixed-sigpipe.md (or, if you prefer the fixed category, prefix it with - and drop changed-16151.md so there is one fragment). Either way this is a one-line push on quality/deflake-confirm-fixed-sigpipe; I have not pushed to the branch.
— hive: agent=reviewer-2 backend=copilot model=claude-fable-5.1 copilot=1.0.88
…branch ships integration-governance.test.cjs runs verify() against the real HEAD:src/scripts tree; editing src/scripts/test-issue-confirm-fixed.sh changed that hash, so the pinned literal must follow it in the same change. Signed-off-by: scanner <280983584+hivecommons-hive[bot]@users.noreply.github.com>
There was a problem hiding this comment.
Decision needed: @clubanderson should confirm the TRUSTED_SCRIPTS_TREE re-pin in .github/scripts/integration-governance.cjs (c1b6e83… → b1b6477…) is acceptable to land in the same bot-authored PR that changes the pinned src/scripts tree.
Code looks correct to me; routing only because the newest head (f3f4aa4) moves a trust anchor.
What I verified on f3f4aa4:
src/scripts/test-issue-confirm-fixed.sh:236—grep -q 'DRY-RUN' <<<"$output"replaces theprintf | grep -qpipeline. The script runs underset -euo pipefail(line 24), so the old form could fail on EPIPE aftergrep -q's early exit; the here-string removes the writer process.bash src/scripts/test-issue-confirm-fixed.sh→test-issue-confirm-fixed OKlocally..github/scripts/integration-governance.cjs:12—TRUSTED_SCRIPTS_TREEis re-pinned tob1b6477108b28bda15e93735f2f6723568d0281d.git rev-parse pr-head:src/scriptsis exactly that hash, andgit diff --stat origin/v5 pr-head -- src/scriptsshows the only change in the pinned tree is the 3-line edit above. The pin is consumed atintegration-governance.cjs:98-99and checked byintegration-governance.test.cjs, so the bump is mechanically required by this change — this is the first bump since the pin landed in #16035.
Two notes for the maintainer, neither a defect:
- The PR body describes only the test fix; the re-pin is explained in the commit message of
f3f4aa4but not in the body. Worth a one-line addition to the body so the audit trail shows why.github/scriptschanged. - Every other open PR that touches
src/scriptswill need the same re-pin and will conflict with this one on line 12. That is the pin working as designed, just something to sequence.
I have not approved or changed anything.
— hive: agent=reviewer-2 backend=copilot model=claude-fable-5.1 copilot=1.0.88
|
Needs a decision, not a merge:
Head: verdict requires_human @f3f4aa4, 64/66 checks green, 2 pending, DCO yes, soak 0s of 10m0s. What to do: approve this head ( How to release it:
Clear the cause and the hive re-evaluates on its next pass; the stage moves to |
|
Needs a decision, not a merge:
Head: verdict requires_human @f3f4aa4, 66/66 checks green, DCO yes, soak 10m0s elapsed. What to do: approve this head ( How to release it:
Clear the cause and the hive re-evaluates on its next pass; the stage moves to |
|
Needs a decision, not a merge:
Head: verdict requires_human @f3f4aa4, 66/66 checks green, DCO yes, soak 10m0s elapsed. What to do: approve this head ( How to release it:
Clear the cause and the hive re-evaluates on its next pass; the stage moves to |
clubanderson
left a comment
There was a problem hiding this comment.
Owner-requested maintainer decision: approve this exact head, including the companion TRUSTED_SCRIPTS_TREE enrollment. This is not acceptance of unattended self-attestation. I independently compared both complete pinned Git trees: the only changed entry between c1b6e83ee24e5108657ef7f9b15865fd23f4ebce and b1b6477108b28bda15e93735f2f6723568d0281d is test-issue-confirm-fixed.sh, with unchanged mode; the new literal exactly matches this head src/scripts tree. The script delta only replaces the SIGPIPE-prone printf/grep pipeline with a here-string and preserves the three assertions. The governance verifier still requires both source and tested-head script trees to match the enrolled literal. The changelog fragment is now well formed and required checks pass. Future trust-pin changes require their own authorized review of the entire changed executable closure; a green bot-authored PR or an updated pin alone is not authorization.
|
/lgtm The exact-head native approval records the independently verified trust-tree delta. This authorizes this enrollment only, not a blanket policy allowing automated self-approval of future trust-anchor changes. |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: clubanderson The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
LGTM label has been added. DetailsGit tree hash: c990679c252e2b20cddf76a467d2b614922227b3 |
1 similar comment
|
LGTM label has been added. DetailsGit tree hash: c990679c252e2b20cddf76a467d2b614922227b3 |
|
Thank you for your contribution! Your PR has been merged. We'd love to hear how your experience was: share feedback |
Why
build-and-teston #16149 failed inscripts/test-issue-confirm-fixed.shwithline 234: printf: write error: Broken pipe→FAIL: DRY_RUN=1 performed writes, although the dump showed only GET calls and a DRY-RUN line — i.e. the assertion held.Root cause:
printf '%s\n' "$output" | grep -q 'DRY-RUN'underset -o pipefail.grep -qexits on the first match,printfgets EPIPE, and the pipeline status becomes non-zero nondeterministically.Fix
Feed grep via a here-string so there is no writer process to kill. Only this one
| grep -qinstance exists in the script.Trust-anchor re-pin (second file in the diff)
.github/scripts/integration-governance.cjspinsTRUSTED_SCRIPTS_TREEto thesrc/scriptstree hash (introduced in #16035). Because this PR edits a file undersrc/scripts, the pin is bumped fromc1b6e83e…(tree at the v5 merge-baseae6e9f4) tob1b64771…(tree at this head,git rev-parse f3f4aa4:src/scripts). Without itverify()throwsTrusted control/helper closure unavailablefor any integration candidate that includes this change. No other governance logic is touched. By design everysrc/scriptsedit will need this companion bump.Verification
bash scripts/test-issue-confirm-fixed.sh→test-issue-confirm-fixed OKlocally.Refs #16149.
— hive: agent=quality backend=copilot model=claude-fable-5.1 copilot=1.0.88