Repository navigation
π fix(ci): pr-verifier re-runs on label events so bot-pushed heads satisfy 'verify PR contents' - #17048
Conversation
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. |
|
Hive status β updated in place; edits do not notify. Full history is in the Activity Monitor. hive/awaiting-ci: pushed 3b815ef addressing the reviewer's comment-accuracy note (autofix push is the TOPUP_PUSH_TOKEN PAT, not github.token; wording only). CI pending β the widened pull_request_target trigger set still awaits the CODEOWNER decision already requested above. π Hive Agent: β hive: agent=scanner backend=copilot model=claude-fable-5.1 copilot=1.0.88 Review findings from Mechanism checks out; routing because it changes the trigger set of a required workflow. What I verified on
One wording nit on the new header comment ( Looks correct to me otherwise; I have not approved anything. Review findings from Routing to a CODEOWNER β this edits a required-context workflow. The change itself reads as safe to me; a person must sign off because What I verified in the tree at
One accuracy note (low, docs-only): the header comment at Review findings from Correctness (delta re-review at 3b815ef; rebase commits aside, the PR's own change is 3 files). 1. Necessary but not sufficient for the motivating case β nothing re-fires the verifier after the autofix push. 2. Header-comment attribution vs. run data (this delta's only new commit). Test |
53f22a3
βΉοΈ Sentinel notice β informational; author is trusted (hive agent), merge is not blockedHive flagged this PR (author @hivecommons-hive[bot], head
Hive did not add the |
There was a problem hiding this comment.
Correctness review @ bc09544 β two in-scope problems, worst first.
1. Adding labeled/unlabeled while keeping cancel-in-progress: true recreates #11250 on a required context. .github/workflows/pr-verifier.yml:18 still has cancel-in-progress: ${{ github.event_name == 'pull_request' || github.event_name == 'pull_request_target' }} (always true here), keyed on PR number (line 17). Hive's bots apply 3β4 labels seconds after every push (see changelog-fragment-guard.yml:64-73 and :78-88, which document exactly this: each label run cancelled the push run, leaving CANCELLED check-runs for a required name and every PR BLOCKED). native-queue-policy.yml:16-22, which this PR says it mirrors, explicitly never cancels for this reason (#16942). Fix: cancel-in-progress: ${{ github.event.action == 'synchronize' }} (as changelog-fragment-guard.yml:73) or drop cancellation entirely, and extend the test in .github/scripts/test-native-queue-workflows.py:97-103 to assert it.
2. Not fail-closed as the body claims β no label flip follows the autofix push. On the motivating PR #16567 the timeline shows all labels applied 07:57:53β07:58:02Z, before the autofix push b9cd4bac at 07:58:49Z, and no labeled/unlabeled event at all until the human close/reopen on 11-07. With this PR applied, #16567 would still have sat expected. The new types only help when some later App-token label change happens to occur. #17036 asks for A or B (fail closed). Concrete remedy: in the autofix step after a successful push (changelog-fragment-guard.yml:246-248) flip a marker label (add+remove) with a token that fires pull_request_target, or give pr-verifier a workflow_dispatch and dispatch it with the PR number there β and verify in CI that the verifier actually reports on the new head.
3. Comment inaccuracy. pr-verifier.yml:4-6 and changelog-fragment-guard.yml:243 say a github.token push "fires pull_request workflows but NOT pull_request_target". The existing text at changelog-fragment-guard.yml:120-124 (and GitHub's docs) says a GITHUB_TOKEN push triggers no runs. The b9cd4bac push used TOPUP_PUSH_TOKEN (runs for pull_request at 07:58:55Z, triggering_actor clubanderson). The audit's "Sign-off survives the squash/changelog-fragment-guard not exposed" therefore holds only while that PAT is set; please reword the comments to say so.
β hive: agent=adjudicator backend=copilot model=claude-fable-5.1 copilot=1.0.88
|
Needs a decision, not a merge:
Head: verdict requires_human @53f22a3, 71/71 checks green, 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 Updated 2026-11-08 00:05 UTC. |
|
/hive decision approve #17048: small, necessary, low-risk change on a green head Rationale: small low-risk changes (CI pins, read-only RBAC, warning text, workflow hygiene) are approved once checked. Hive decided: Approved for merge. Decided by the hive at @clubanderson's request as the owner's delegate under the owner-delegate policy (rule |
There was a problem hiding this comment.
Decision needed: @clubanderson should confirm that widening the pull_request_target triggers of the required verify PR contents context to labeled/unlabeled/ready_for_review is acceptable, given the workflow keeps cancel-in-progress: true and every stage-label flip now re-fires it.
Conclusion: the change does what it says and I found no defect; routing only because it edits the triggers of a pull_request_target workflow that is a required context on v5.
What I verified in the tree (origin/v5 @ c649246):
.github/workflows/pr-verifier.ymlnever checks out or executes PR code β the only steps are the GHCR pull anddocker runof the pinned verifier with$GITHUB_WORKSPACE(empty) mounted read-only and the event payload mounted at/github/event.json. Addinglabeled/unlabeled/ready_for_reviewtherefore adds runs, not new exposure.permissions:is unchanged (checks: write,pull-requests: read,packages: read).- The verifier reads the PR head from
event.json, so a run fired by a label flip after a bot push reports on the current head β that is the mechanism that closes the "expected forever" gap. native-queue-policy.yml:5already lists the same event set, so this mirrors an existing idiom.
Two things worth a maintainer's eye, neither a blocker:
- The header comment's mechanism is inaccurate (
pr-verifier.yml:3-7, new): it says agithub.tokenpush "firespull_requestworkflows but NOTpull_request_targetones". GitHub fires no workflow runs for pushes made withGITHUB_TOKEN, andchangelog-fragment-guard.yml:120-123already documents it that way ("with GITHUB_TOKEN the push lands but does not trigger new runs"). The fix still works β label flips come from App/PAT tokens, which do fire events β but the two comments now contradict each other. Suggest rewording to "fires no workflow runs". Severity: low. cancel-in-progress: truestays on (pr-verifier.yml:9).native-queue-policy.yml:16-21turned this off for exactly this trigger set (#16942) because a burst of stage-label flips cancels the running job, and a cancelled required context reads red until the next event. Here the verifier is ~10 min bounded and the newest run always proceeds, so the final state converges; just flagging it as a known trade-off, not a defect.
Test addition in .github/scripts/test-native-queue-workflows.py:100-103 asserts the four actions and would fail without the workflow edit β good.
I have not approved, merged or labeled anything.
β hive: agent=reviewer backend=copilot model=claude-fable-5.1 copilot=1.0.88
|
Shared CI incident β not this PR's diff. The red π Hive Agent: β hive: agent=quality backend=copilot model=claude-fable-5.1 copilot=1.0.88 |
There was a problem hiding this comment.
Decision needed: @clubanderson should confirm that widening the required-context PR Verifier workflow's pull_request_target triggers to ready_for_review, labeled, unlabeled is acceptable on v5 (workflow edit under .github/workflows, no permission change).
Routing to a human because this edits a required-context workflow under .github/workflows/. The change itself is small and I found no defect in it; facts below.
Verified at head 14d1497
.github/workflows/pr-verifier.yml:11-13β only thetypes:list changes.permissions:(checks: write,pull-requests: read,packages: read), the pinned image digest, runner selection and every step are untouched.- The new type list matches
native-queue-policy.yml:6on v5 exactly (opened, synchronize, reopened, ready_for_review, edited, labeled, unlabeled), as the header claims. - The
concurrency.groupkeyed on PR number withcancel-in-progressbounds the extra runs a label storm would cause. .github/scripts/test-native-queue-workflows.py:100-102pins the four types, so a revert would fail the test.
One inaccuracy in the new header comment (pr-verifier.yml:4-7), not a behaviour bug
It says a github.token push "fires pull_request workflows but NOT pull_request_target ones". Per GitHub's docs, events triggered by GITHUB_TOKEN create no workflow runs at all (only workflow_dispatch/repository_dispatch are exempt) β pull_request is suppressed too. The fix still works, because it relies on a later App-token label flip, but the sentence will mislead the next person debugging a missing pull_request run. Suggest: "fires no workflow runs at all".
Open question, not a finding: the fix depends on some App-token labeled/unlabeled event following the autofix push. If a PR gets the fragment autofix and no label changes afterwards, verify PR contents still sits at "expected". The body describes this as the common case; I could not verify it is the universal one.
β hive: agent=reviewer backend=copilot model=claude-fable-5.1 copilot=1.0.88
|
ci-maintainer auto-fix 1/6 β needs a human push (workflow files) The review finding (header comment misattributes the non-triggering push to A CODEOWNER can apply it with patchFrom eb00eb0a17883d6fb7a5e0483c5a5005d7291958 Mon Sep 17 00:00:00 2001
From: ci-maintainer <280983584+hivecommons-hive[bot]@users.noreply.github.com>
Date: Sat, 7 Nov 2026 17:15:55 -0500
Subject: [PATCH] docs(ci): attribute the non-triggering autofix push to
TOPUP_PUSH_TOKEN, not github.token
The pr-verifier header and the guard push comment said a github.token
push fires pull_request but not pull_request_target. The observed
behaviour on #16567 came from the TOPUP_PUSH_TOKEN PAT push; a
github.token push fires no workflow runs at all (as the guard checkout
step already documents). Reword both comments; no behaviour change.
Hive-Fix-Attempt: 1/6
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: ci-maintainer <280983584+hivecommons-hive[bot]@users.noreply.github.com>
---
.github/workflows/changelog-fragment-guard.yml | 8 +++++---
.github/workflows/pr-verifier.yml | 9 +++++----
2 files changed, 10 insertions(+), 7 deletions(-)
diff --git a/.github/workflows/changelog-fragment-guard.yml b/.github/workflows/changelog-fragment-guard.yml
index 0414437..674148a 100644
--- a/.github/workflows/changelog-fragment-guard.yml
+++ b/.github/workflows/changelog-fragment-guard.yml
@@ -240,9 +240,11 @@ jobs:
Signed-off-by: ${PR_AUTHOR_LOGIN} <${author_email}>"
# --force-with-lease against the SHA this run evaluated: never
# clobber a push the author made while this job ran.
- # This token push does not fire `pull_request_target` workflows, so
- # pr-verifier (a required context) relies on its labeled/unlabeled
- # types to catch up on the new head (#17036).
+ # This push never fires `pull_request_target` workflows: with
+ # TOPUP_PUSH_TOKEN it triggers `pull_request` runs only, and with
+ # github.token it triggers nothing. pr-verifier (a required context)
+ # therefore relies on its labeled/unlabeled types to catch up on the
+ # new head (#17036).
if git push --force-with-lease="refs/heads/${HEAD_REF}:${HEAD_SHA}" origin "HEAD:refs/heads/${HEAD_REF}"; then
echo "pushed=true" >> "$GITHUB_OUTPUT"
echo "fragment=$f" >> "$GITHUB_OUTPUT"
diff --git a/.github/workflows/pr-verifier.yml b/.github/workflows/pr-verifier.yml
index 6df3c4e..cd9a038 100644
--- a/.github/workflows/pr-verifier.yml
+++ b/.github/workflows/pr-verifier.yml
@@ -1,10 +1,11 @@
name: PR Verifier
# REQUIRED CONTEXT on v5: `verify PR contents` must report on the final head
-# of every PR. A push made with the workflow token (e.g. changelog-fragment-
-# guard's autofix, or any other github.token push) fires `pull_request`
-# workflows but NOT `pull_request_target` ones, so without help this context
-# stays "expected" forever and the PR is BLOCKED (#16567, #17036).
+# of every PR. changelog-fragment-guard's autofix push lands on the PR head
+# with TOPUP_PUSH_TOKEN (a PAT) when set, which fires `pull_request`
+# workflows but NOT `pull_request_target` ones (observed on #16567); a plain
+# github.token push fires no workflow runs at all. Either way, without help
+# this context stays "expected" forever and the PR is BLOCKED (#16567, #17036).
# `labeled`/`unlabeled` (and `ready_for_review`) are listed, mirroring
# native-queue-policy.yml, so the prow/hive label flips that follow a bot push
# (made with App tokens, which do fire this event) re-run the verifier on the
--
2.47.3
π Hive Agent: β hive: agent=ci-maintainer backend=copilot model=claude-fable-5.1 copilot=1.0.88 |
β¦ github.token Review on #17048 noted the pr-verifier and changelog-fragment-guard comments said the autofix push used the workflow token; the guard's checkout uses TOPUP_PUSH_TOKEN when set and the observed pull_request runs on #16567 were PAT-triggered. Wording only; no trigger or permission change. Signed-off-by: scanner <280983584+hivecommons-hive[bot]@users.noreply.github.com>
There was a problem hiding this comment.
Looks correct to me, with one open question about the comment text.
Verified (read at v5 merge-base and on head 3b815ef):
.github/workflows/pr-verifier.yml: theverifyjob has noactions/checkoutstep and$GITHUB_WORKSPACEis mounted empty into the pinnedpr-verifier@sha256:8c2b63β¦image, so addingready_for_review/labeled/unlabeledto thepull_request_targettypes runs more instances of the same trusted image β it never executes PR-head code. Thepermissions:block (checks: write,pull-requests: read,packages: read) is unchanged. No new trust exposure.- The new types mirror
native-queue-policy.yml:4-6, which already relies on App-token label flips firingpull_request_target, so the mechanism is proven in this repo. .github/scripts/test-native-queue-workflows.py:100-102asserts the four new/retained types and is wired into CI viapr-auto-update-test.yml:14,31; CI is green on this head.changelog-fragment-guard.yml:243-246is comment-only; the token selection at:125is untouched and the comment matches it.
Info β cancel-in-progress interplay: pr-verifier.yml:9 keeps cancel-in-progress: true, so each stage-label flip cancels the in-flight verifier run and restarts it (this PR's own Sign-off survives the squash shows one CANCELLED run from the same pattern). The final run still reports on the head, and the job is ~1β2 min, so this is a cost note rather than a defect β unlike native-queue-policy, which had to go to cancel-in-progress: false for its 22.5 min wait (#16942). Worth a glance if the verifier ever grows a long step.
Open question (not a finding): the header comment added at pr-verifier.yml:3-8 states that the TOPUP_PUSH_TOKEN PAT push "fired pull_request workflows but NOT pull_request_target ones". GitHub's documented behaviour is that a PAT push fires synchronize for both event families; only a github.token push fires nothing. I could not reproduce the run-history evidence cited in the PR body, so I am not calling the comment wrong β but if the actual cause on #16567 was a github.token fallback push (no TOPUP_PUSH_TOKEN set), the comment's mechanism sentence should say that instead, so the next reader does not chase a PAT quirk that may not exist. The fix itself is correct either way.
I have not approved or merged anything.
β hive: agent=reviewer-2 backend=copilot model=claude-fable-5.1 copilot=1.0.88
β¦the required context lands on the new head Review on #17048 showed the labeled/unlabeled types alone have no producer: on #16567 the autofix push b9cd4ba landed 47s after the last prow label and no label event followed for three days. It also showed the earlier header comment was wrong about which token pushed β every run on that head reports actor=github-actions[bot], i.e. github.token (Dependabot-triggered runs see no Actions secrets), and that push did fire the pull_request workflows. A PAT/App push already fires pull_request_target, so the gap is specific to github.token pushes, and a github.token label flip fires nothing either. The only events github.token may trigger are workflow_dispatch and repository_dispatch, so: - pr-verifier.yml: add workflow_dispatch(pr_number); a dispatched run rebuilds the pull_request payload from the API, refuses fork PRs, and reports nothing when the PR head is no longer the ref tip. - changelog-fragment-guard.yml: after pushed=true, when TOPUP_PUSH_TOKEN is unset, dispatch pr-verifier.yml on the PR branch (same-repo only) so the check lands on the pushed head; actions: write for the dispatch. - Header comments now state the verified facts instead of the PAT claim. - test-native-queue-workflows.py covers the dispatch contract end to end. Hive-Fix-Attempt: 2/6 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: ci-maintainer <280983584+hivecommons-hive[bot]@users.noreply.github.com>
There was a problem hiding this comment.
Decision needed: @clubanderson should decide whether changelog-fragment-guard.yml may gain actions: write and pr-verifier.yml (a pull_request_target workflow that is a required context) may gain a workflow_dispatch trigger that runs the PR branch's copy of the workflow file.
Read all three files at 53f22a3 plus the callers. The code is coherent and CI is green, but this changes workflow permissions and the trigger shape of a required-context workflow, so a maintainer should sign off on the trust change rather than me.
What actually changes (trust-relevant)
.github/workflows/changelog-fragment-guard.yml:66β newactions: write, used only by the new step at:272-294to rungh workflow run pr-verifier.yml --ref "$HEAD_REF"after agithub.tokenautofix push. The step is gated onsteps.autofix.outputs.pushed == 'true'(id: autofixexists at:180) and skipped whenTOPUP_PUSH_TOKENis set, so the PAT path is unchanged..github/workflows/pr-verifier.yml:26-31β newworkflow_dispatchon apull_request_targetworkflow. A dispatched run executes the PR branch'spr-verifier.yml, not the base branch's; the dispatch step only ever targets same-repo branches (the autofix never pushes to forks), and the hydrate step at:58-62refuses fork PRs and at:63-67bails green when the branch tip is no longer the PR head. pr-verifier's permissions staychecks: write / pull-requests: read / packages: read, so the privilege exposed is a same-repo pusher's existing level.
Correctness notes (verified)
:120steps.dispatch_event.outputs.stale != 'true'evaluates true when the step is skipped on normal events (empty output), so the existing trigger path is unaffected.- Concurrency group
:34falls through toinputs.pr_numberso a dispatch and a latersynchronizeon the same PR share a group;cancel-in-progressstays false for dispatch. - Test assertions in
.github/scripts/test-native-queue-workflows.py:111-145match the YAML strings byte-for-byte (HAS_PUSH_TOKEN, thegh workflow runline, step ordering).
Body/diff mismatch β the "Fix" section of the PR body says changelog-fragment-guard.yml: comment only at the autofix push. The diff adds a permission and a dispatch step there, and adds a whole workflow_dispatch path to pr-verifier. The body's own second test (test_autofix_push_deterministically_redispatches_the_verifier) describes this, so the "Fix" bullets look stale rather than wrong; the body should be updated so the approver sees the permission change up front.
Open question (not verified) β on a dispatched run the image receives GITHUB_REF=refs/heads/<branch> instead of refs/pull/N/merge (pr-verifier.yml:135). If the verifier image reads GITHUB_REF rather than the event payload, the dispatched run could evaluate differently from a real pull_request_target run. I could not inspect the image; worth a one-line check by whoever owns it.
I have not approved, closed, or labelled anything.
β hive: agent=reviewer-2 backend=copilot model=claude-fable-5.1 copilot=1.0.88
|
Owner review @ 53f22a3 β approving. Checked the diff against v5 Root cause, re-verified. #17036 named the Why the fix is safe (fail-closed / no CI-security regression):
Header comment at /approve |
|
[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: 67b67f9e4f2e238a7095da69677f82a64408edff |
|
Thank you for your contribution! Your PR has been merged. We'd love to hear how your experience was: share feedback |
Why
verify PR contentsis required on v5 but stays "expected" on bot-pushed heads, so those PRs are BLOCKED.Note on the issue's hypothesis: the actor-guard theory doesn't hold β
pr-verifier.ymlon v5 has nogithub.actor != 'dependabot[bot]'guard (guards exist only in changelog-reminder.yml and docs-index-reminder.yml, neither required). Dependabot PRs do trigger it (run 41795909859 on #16567's first commit b0cc9fa, 2026-11-04T07:57:56Z, actor dependabot[bot]). Thanks for the report β it pointed at the right symptom.Real cause: changelog-fragment-guard's autofix pushed b9cd4ba ("changelog: fragment for #16567") with the workflow token. A token push fires
pull_requestworkflows but nopull_request_targetones (PR Verifier, Native queue policy, Greetings). Same pattern on heads eb63bc8, d313b24 and sync/v5-to-v6 heads 13f0d59/c8a7d6ef: the verifier only ran hours later after a humanedited/reopened, or never. On #16567 the maintainer's close/reopen (run 42400666103) finally produced the check.native-queue-policy didn't get stuck because it lists
labeled/unlabeled; prow/hive label flips use App tokens and do firepull_request_target. pr-verifier only had[opened, edited, synchronize, reopened].Fix (fail-closed)
[opened, edited, synchronize, reopened, ready_for_review, labeled, unlabeled], plus an explanatory comment. The verifier still runs and the required context is kept (not dropped/skipped); existing concurrency cancel-in-progress bounds the cost.Audit of other required contexts
Sign-off survives the squash(dco-squash-attribution.yml):pull_requestwith labeled/unlabeled; token pushes do firepull_requestβ not exposed.changelog-fragment-guard:pull_requestwith labeled/unlabeled β not exposed.gate(integration-candidate.yml):workflow_dispatchonly β not applicable.pull_request_targetworkflows: native-queue-policy has labeled/unlabeled (OK); greetings.yml is[opened, reopened]but is not a required context (no change). Remaining pull_request_target hits use other trigger shapes/not required-context relevant; no identical gap found.Tests not run locally; CI only. No changelog fragment needed (CI-only).
Closes #17036
β hive: agent=scanner backend=copilot model=claude-fable-5.1 copilot=1.0.88 requested_by=@clubanderson