Skip to content

🌱 test(scripts): deflake confirm-fixed DRY_RUN assertion (SIGPIPE under pipefail) - #16151

Merged
kubestellar-prow[bot] merged 5 commits into
v5from
quality/deflake-confirm-fixed-sigpipe
Nov 2, 2026
Merged

kubestellar-prow[bot] merged 5 commits into
v5from
quality/deflake-confirm-fixed-sigpipe

Conversation

@hivecommons-hive

@hivecommons-hive hivecommons-hive Bot commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor

Why

build-and-test on #16149 failed in scripts/test-issue-confirm-fixed.sh with line 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' under set -o pipefail. grep -q exits on the first match, printf gets 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 -q instance exists in the script.

Trust-anchor re-pin (second file in the diff)

.github/scripts/integration-governance.cjs pins TRUSTED_SCRIPTS_TREE to the src/scripts tree hash (introduced in #16035). Because this PR edits a file under src/scripts, the pin is bumped from c1b6e83e… (tree at the v5 merge-base ae6e9f4) to b1b64771… (tree at this head, git rev-parse f3f4aa4:src/scripts). Without it verify() throws Trusted control/helper closure unavailable for any integration candidate that includes this change. No other governance logic is touched. By design every src/scripts edit will need this companion bump.

Verification

bash scripts/test-issue-confirm-fixed.sh → test-issue-confirm-fixed OK locally.

Refs #16149.

— hive: agent=quality backend=copilot model=claude-fable-5.1 copilot=1.0.88

hivecommons-hive Bot and others added 2 commits November 1, 2026 04:35
… 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>
@kubestellar-prow kubestellar-prow Bot added dco-signoff: yes Indicates the PR's author has signed the DCO. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Nov 1, 2026
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>
@github-actions

github-actions Bot commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor

Open PR overlap check

Base branch: v5

Conflicts are checked with every PR merged onto the current tip of v5, so a PR that only needs a rebase is not reported as conflicting with its siblings.

No conflicting open PRs or same-file overlaps were found.

@hivecommons-hive hivecommons-hive Bot added author/hive This repository's own hive (the App or one of its agent lanes) authored this PR dco All commits are DCO signed-off role/trusted Author is trusted for unattended merge (trusted-author role or registry/claim tier in require_tiers) stage/050-review-pending Review swarm requested; awaiting a verdict for the current head stage/070-fixing Hive-authored PR: CI red, changes requested or needs rebase; a hive agent is fixing it and removed stage/050-review-pending Review swarm requested; awaiting a verdict for the current head labels Nov 1, 2026

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correctness review (head a5b0a52) — the shell fix is correct; the PR is blocked by its own changelog fragment.

  1. changelog.d/fixed-test-confirm-fixed-sigpipe.md:1 has no - bullet → changelog-fragment-guard fails. The file is a bare sentence ("Deflaked test-issue-confirm-fixed.sh: …"); src/scripts/check-changelog-fragment.sh:74 rejects 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.md already carries a well-formed bullet for the same change, and src/scripts/test[-_]*.sh is auto-exempt from the fragment requirement (check-changelog-fragment.sh:87). Fix: delete changelog.d/fixed-test-confirm-fixed-sigpipe.md (two fragments in two categories would otherwise emit the same entry twice under ### Changed and ### 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

@hivecommons-hive

hivecommons-hive Bot commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor Author

Hive status — updated in place; edits do not notify. Full history is in the Activity Monitor.

Review findings from reviewer (folded here because this head already carries its hive review):

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 f3f4aa4 (merge-base ae6e9f4):

  • src/scripts/test-issue-confirm-fixed.sh:5 sets set -u -o pipefail, so the old printf '%s\n' "$output" | grep -q 'DRY-RUN' at line 234 really does surface printf's EPIPE as a non-zero pipeline status whenever grep -q exits before printf finishes writing. The here-string form at the new line 236 has no writer process, so there is nothing left to race. Only that one | grep -q existed in the script. Fix matches the stated root cause.
  • .github/scripts/integration-governance.cjs:98-103 rejects any candidate whose src/scripts tree differs from TRUSTED_SCRIPTS_TREE, and the error text at line 103 instructs exactly this re-pin. I checked the hashes: git rev-parse ae6e9f4:src/scripts (and origin/v5:src/scripts) = c1b6e83e… — the old pin; git rev-parse f3f4aa4:src/scripts = b1b64771… — the new pin. The body's claim holds and no other governance logic changes.

Why a human anyway: that literal is the only thing standing between a src/scripts edit and the verifier executing it, which puts it in the credentials/trust class. The bump here is forced by a 3-line test change and I found no other src/scripts delta at this head, so I expect this is a yes — but it should be a person's yes.

No defects found. I have not approved or changed anything.

hive/awaiting-ci: build-and-test failed in integration-governance.test.cjs because TRUSTED_SCRIPTS_TREE pins the src/scripts tree hash and this PR edits a file under it; re-pinned to the branch's tree. CI pending — sweep will merge when green.


🐝 Hive Agent: scanner | Instance: hosted-available-oke-11-placeholder-r05x | SHA: 02e9659

— hive: agent=scanner backend=copilot model=claude-fable-5.1 copilot=1.0.88

Review findings from reviewer-2 (folded here because this head already carries its hive review):

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 f3f4aa4):

  • src/scripts/test-issue-confirm-fixed.sh:5 sets set -u -o pipefail, and the DRY_RUN assertion (old line 234) was the single printf … | grep -q in the script — every other grep -q reads a file directly (lines 81–82, 120–122, 128–129, 139, 174, 203). With grep -q exiting on first match, printf takes EPIPE and pipefail reports it; running the old pattern 200× under pipefail locally failed 183 times. The here-string at line 236 removes the writer process, so there is nothing left to race. bash src/scripts/test-issue-confirm-fixed.sh at this head → test-issue-confirm-fixed OK.
  • .github/scripts/integration-governance.cjs:12: new pin b1b6477108b28bda15e93735f2f6723568d0281d equals git rev-parse f3f4aa4:src/scripts; the old pin c1b6e83e… equals origin/v5:src/scripts, and no other src/scripts commit has landed on v5 since merge-base ae6e9f4, so the bump is exactly what verify() (lines 96–104) requires and nothing else in the verifier changes.

Routing, not a defect: TRUSTED_SCRIPTS_TREE exists so that a caller-supplied sourceSHA cannot pick a new executable verifier tree (comment at lines 10–11). This PR edits trusted content and moves the anchor to match in the same change, which is the documented procedure (#16035) but means the review is the only independent check on the bump — and .github/scripts/ is not in .github/CODEOWNERS (only .github/workflows/** is). I have verified the hash; whether a self-pinned bump should land on automerge is a maintainer call. I have not approved or changed anything.

Signed-off-by: scanner <280983584+hivecommons-hive[bot]@users.noreply.github.com>

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@hivecommons-hive hivecommons-hive Bot added stage/050-review-pending Review swarm requested; awaiting a verdict for the current head stage/070-fixing Hive-authored PR: CI red, changes requested or needs rebase; a hive agent is fixing it and removed stage/070-fixing Hive-authored PR: CI red, changes requested or needs rebase; a hive agent is fixing it stage/050-review-pending Review swarm requested; awaiting a verdict for the current head labels Nov 1, 2026
…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>
@hivecommons-hive hivecommons-hive Bot added stage/050-review-pending Review swarm requested; awaiting a verdict for the current head and removed stage/070-fixing Hive-authored PR: CI red, changes requested or needs rebase; a hive agent is fixing it labels Nov 1, 2026

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 the printf | grep -q pipeline. The script runs under set -euo pipefail (line 24), so the old form could fail on EPIPE after grep -q's early exit; the here-string removes the writer process. bash src/scripts/test-issue-confirm-fixed.sh → test-issue-confirm-fixed OK locally.
  • .github/scripts/integration-governance.cjs:12 — TRUSTED_SCRIPTS_TREE is re-pinned to b1b6477108b28bda15e93735f2f6723568d0281d. git rev-parse pr-head:src/scripts is exactly that hash, and git diff --stat origin/v5 pr-head -- src/scripts shows the only change in the pinned tree is the 3-line edit above. The pin is consumed at integration-governance.cjs:98-99 and checked by integration-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:

  1. The PR body describes only the test fix; the re-pin is explained in the commit message of f3f4aa4 but not in the body. Worth a one-line addition to the body so the audit trail shows why .github/scripts changed.
  2. Every other open PR that touches src/scripts will 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

@hivecommons-hive hivecommons-hive Bot added stage/085-needs-decision A human decision is owed: sentinel alert, hold/needs-decision label, human-only rule or parked issue and removed stage/050-review-pending Review swarm requested; awaiting a verdict for the current head labels Nov 1, 2026
@hivecommons-hive

Copy link
Copy Markdown
Contributor Author

Needs a decision, not a merge:

  • the reviewer swarm returned requires_human @f3f4aa4
  • the review found: the reviewer marked this change high-risk
  • reviewer question: @clubanderson should confirm that re-pinning TRUSTED_SCRIPTS_TREE in .github/scripts/integration-governance.cjs (the executable-tree trust anchor from ✨ feature(integration): verify genuine required candidate contexts #16035) is acceptable as part of this otherwise-trivial test deflake.
  • the automerge lane will not merge this unattended

Head: verdict requires_human @f3f4aa4, 64/66 checks green, 2 pending, DCO yes, soak 0s of 10m0s.

What to do: approve this head (f3f4aa4) to merge as-is, or leave a changes requested review (or reply /hive decision <what to change>) and the hive will push the fix.

How to release it:

  • After reading the verdict, a trusted merger can submit a GitHub Approve review for the current head and the lane clears the hold on its next pass; /hive approve replies on a PR are acknowledged but not consumed.

Clear the cause and the hive re-evaluates on its next pass; the stage moves to stage/090-ready-for-human-merge, stage/095-pre-merge-soak or the merge queue on its own. Approval does not bypass CI, hold labels or other merge gates.

@hivecommons-hive hivecommons-hive Bot added stage/050-review-pending Review swarm requested; awaiting a verdict for the current head stage/085-needs-decision A human decision is owed: sentinel alert, hold/needs-decision label, human-only rule or parked issue and removed stage/085-needs-decision A human decision is owed: sentinel alert, hold/needs-decision label, human-only rule or parked issue stage/050-review-pending Review swarm requested; awaiting a verdict for the current head labels Nov 1, 2026
@hivecommons-hive

Copy link
Copy Markdown
Contributor Author

Needs a decision, not a merge:

  • the reviewer swarm returned requires_human @f3f4aa4
  • the review found: the reviewer marked this change high-risk
  • reviewer question: @clubanderson should confirm that the TRUSTED_SCRIPTS_TREE re-pin in .github/scripts/integration-governance.cjs (c1b6e83e → b1b64771) is acceptable as a companion to this one-line test fix, since that literal decides which src/scripts tree the integration verifier trusts to execute.
  • the automerge lane will not merge this unattended

Head: verdict requires_human @f3f4aa4, 66/66 checks green, DCO yes, soak 10m0s elapsed.

What to do: approve this head (f3f4aa4) to merge as-is, or leave a changes requested review (or reply /hive decision <what to change>) and the hive will push the fix.

How to release it:

  • After reading the verdict, a trusted merger can submit a GitHub Approve review for the current head and the lane clears the hold on its next pass; /hive approve replies on a PR are acknowledged but not consumed.

Clear the cause and the hive re-evaluates on its next pass; the stage moves to stage/090-ready-for-human-merge, stage/095-pre-merge-soak or the merge queue on its own. Approval does not bypass CI, hold labels or other merge gates.

@hivecommons-hive

Copy link
Copy Markdown
Contributor Author

Needs a decision, not a merge:

  • the reviewer swarm returned requires_human @f3f4aa4
  • the review found: the reviewer marked this change high-risk
  • reviewer question: @clubanderson should confirm that a src/scripts PR re-pinning TRUSTED_SCRIPTS_TREE to its own head tree (b1b6477108b2…) is acceptable as self-attestation, given .github/scripts/ is outside CODEOWNERS and the hive automerges green PRs.
  • the automerge lane will not merge this unattended

Head: verdict requires_human @f3f4aa4, 66/66 checks green, DCO yes, soak 10m0s elapsed.

What to do: approve this head (f3f4aa4) to merge as-is, or leave a changes requested review (or reply /hive decision <what to change>) and the hive will push the fix.

How to release it:

  • After reading the verdict, a trusted merger can submit a GitHub Approve review for the current head and the lane clears the hold on its next pass; /hive approve replies on a PR are acknowledged but not consumed.

Clear the cause and the hive re-evaluates on its next pass; the stage moves to stage/090-ready-for-human-merge, stage/095-pre-merge-soak or the merge queue on its own. Approval does not bypass CI, hold labels or other merge gates.

@clubanderson clubanderson left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@clubanderson

Copy link
Copy Markdown
Member

/lgtm
/approve

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.

@kubestellar-prow kubestellar-prow Bot added lgtm Indicates that a PR is ready to be merged. labels Nov 2, 2026
@kubestellar-prow

Copy link
Copy Markdown
Contributor

[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

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@kubestellar-prow

Copy link
Copy Markdown
Contributor

LGTM label has been added.

DetailsGit tree hash: c990679c252e2b20cddf76a467d2b614922227b3

1 similar comment
@kubestellar-prow

Copy link
Copy Markdown
Contributor

LGTM label has been added.

DetailsGit tree hash: c990679c252e2b20cddf76a467d2b614922227b3

@kubestellar-prow kubestellar-prow Bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Nov 2, 2026
@hivecommons-hive hivecommons-hive Bot added stage/050-review-pending Review swarm requested; awaiting a verdict for the current head and removed stage/085-needs-decision A human decision is owed: sentinel alert, hold/needs-decision label, human-only rule or parked issue labels Nov 2, 2026
@kubestellar-prow
kubestellar-prow Bot merged commit 5d7baf9 into v5 Nov 2, 2026
107 of 123 checks passed
@kubestellar-prow
kubestellar-prow Bot deleted the quality/deflake-confirm-fixed-sigpipe branch November 2, 2026 14:12
@github-actions

github-actions Bot commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

Thank you for your contribution! Your PR has been merged.

We'd love to hear how your experience was: share feedback

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. author/hive This repository's own hive (the App or one of its agent lanes) authored this PR copilot dco All commits are DCO signed-off dco-signoff: yes Indicates the PR's author has signed the DCO. lgtm Indicates that a PR is ready to be merged. role/trusted Author is trusted for unattended merge (trusted-author role or registry/claim tier in require_tiers) size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. stage/050-review-pending Review swarm requested; awaiting a verdict for the current head

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant