Repository navigation
🐛 automerge: name held workflow runs and stop base-refreshing them - #18945
hivecommons-hive[bot] merged 7 commits into
Conversation
A PR whose workflow runs GitHub holds for approval, and that the hive will not approve, was invisible: the approval probe ran only on pending heads, so a fork head whose pull_request_target check (Prow) passed read green, the missing-check base refresh merged the base into it again and again (projectbluefin/server#686: three pushes, every new head held again), and the activity monitor showed the lane's next reason ("author association", "waiting for a verdict"). - Probe green heads that are missing a required check too. - The approval sweep records, per head, when it will not approve the runs (no trusted run, or auto-approval off); the ledger carries it onto the cycles that skip the sweep. PullRequest.HeldWorkflowRunIDs reads it. - The stage engine parks such a PR at 085 with reason workflow-approval-required:held-runs:<run ids>, over the lane's next reason; the 085 comment and the dashboard popover name the runs. - The missing-check base refresh marks every check missing at the time after one update, so a PR missing twelve checks is updated once. The trust policy is unchanged. Signed-off-by: Danathar <6772335+Danathar@users.noreply.github.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BQYnPGFJx81c8JXR3o1sg1
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
@Danathar this PR is back in your court ( Review asks:
Reply here or push a new head to this branch (same sign-off); CI and the review swarm re-run automatically and the PR returns to the normal path. Queued in your relay fix queue (7 waiting): fixes are handed out before new work as soon as you have capacity. |
|
Scanner triage (fork PR, comment only): the 🐝 Hive Agent: — hive: agent=scanner backend=claude model=claude-sonnet-5-5 claude=2.1.327 |
|
scanner triage @2a7c8fb: two items. (1) 🐝 Hive Agent: — hive: agent=scanner backend=claude model=claude-sonnet-5-5 claude=2.1.327 |
The per-package coverage gate counts only prstage's own tests. Signed-off-by: Danathar <6772335+Danathar@users.noreply.github.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BQYnPGFJx81c8JXR3o1sg1
Open PR overlap check✅ Resolved: no conflicting open PRs or same-file overlaps remain against |
…nd-reason Signed-off-by: Danathar <6772335+Danathar@users.noreply.github.com> # Conflicts: # src/docs/operator-reference/sweeps-and-operations.md
There was a problem hiding this comment.
Read the diff and the tree at 2ff7a8a. The held-runs park and the probe widening look correct to me: HeldWorkflowRunIDs only fires once the sweep has set Denied/PermissionDenied, so a trusted head still waits for the sweep, and workflowApprovalWithLedger carries both flags per head.
One low-severity point, on the once-per-set change (inline). Everything else I checked held up.
— hive: agent=reviewer-2 backend=claude model=claude-sonnet-5-5 claude=2.1.327
…date Review on hivecommons#18945: a missing check with no evidence it runs anywhere was marked refreshed with the rest, so it never earned its own update once its workflow landed on the base. Signed-off-by: Danathar <6772335+Danathar@users.noreply.github.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BQYnPGFJx81c8JXR3o1sg1
|
Hive status — updated in place; edits do not notify. Full history is in the Activity Monitor. Evidence bundle `#18945875f860` sha256:a3150a4f354c94e939d4da1c2daf2cf7bb79a178db0bdc0b075d33acb84fb3ae — download from the dashboard or `hivectl review evidence #18945`.merged by Hive trusted-author auto-merge: author |
Summary
Sometimes GitHub holds a PR's workflow runs for "Approve and run" and the hive will not approve them, for example an untrusted fork head. Until now the hive never noticed this. Two things went wrong:
This PR shows the held runs as the blocker and stops the refresh loop. The trust policy is unchanged: untrusted fork runs are still never approved automatically.
What was actually happening
role/untrusted). The head has one green check:prow / prow, from apull_request_targetrun. Itspull_requestruns (Build image artifacts, Unit tests, Docs checks, Lint workflows) are allaction_required. That green check makesCIStatus"success". The approval probe inEnrichCIStatusonly ran on "pending" heads, soCIActivity.WorkflowApprovalstayed nil.missingCheckRefreshSkiptherefore saw "12 required checks missing, CI settled" and merged the base in.github-actions[bot]). These heads have no check runs at all, so they already read "pending" and were probed. The bug there was only the reason shown: 050, "waiting for a verdict".Build Utahis held.The fix
workflowApprovalProbeWanted: CI pending, as before, or CI green while a required check never reported at all. A red head is still not probed. Only a head that might be held pays for the listing (✨ Activity Monitor chevrons: active-with-text / icon-only spec, CI and review ring glyph, workflow-approval stall caption #16599). The probe now runs after the protection facts are attached, because it needsMissingRequiredChecks.SweepWorkflowApprovalsnow marks a headDeniedwhen no gated run on it is trusted, or whengovernor.ci.auto_approve_workflowsis off.workflowApprovalWithLedgercarries it onto cycles that skip the sweep: conserve budget, off-cadence cycles, webhook wakes.PullRequest.HeldWorkflowRunIDs()returns the run ids only whenDeniedorPermissionDeniedis set. A trusted head (Renovate, Dependabot, the App, a dashboard-admitted head) waits for the sweep as before and is never parked.HeldWorkflowRuns, is published with the shared-CI index the same way as the fork-guard checks, and round-trips throughFacts.HeldWorkflowRunsStageparks the PR at 085 with reasonworkflow-approval-required:held-runs:<run ids>. This wins over the lane's next reason: author association, no linked issue, no verdict, or a lane error.workflow-approval-required:<ctx>(the/ok-to-testpath) orunauthorized:<step>.workflow-approval-pendingskip, which now sees the probe.Acceptance, case by case
github-actions[bot]PR with held runs the policy doesn't trust: the same 085 row instead of 050.Setting note:
github-actions[bot]inauto_approve_workflow_actorsgithub-actions[bot]is not added to the default in this PR.github-actions[bot]-authored PR can only come from a workflow in the repository itself, so for same-repo heads the risk is low.settings_parity_allowlist.txt:261). A dashboard control for it is a parity follow-up and isn't in this PR.Existing issues
I searched for "missing-check base refresh", "workflow approval" plus "fork", "action_required" plus "untrusted", and
auto_approve_workflow_actors, and found no issue covering this.unauthorized:step.Tests
pkg/github:TestWorkflowApprovalProbeWanted: covers pending, green with a missing required check, green with every check, red, and no listing.TestHeldWorkflowRunIDs.TestSweepWorkflowApprovalsMarksDeniedHeads: covers a trusted head; an untrusted head, including the ledger carrying the denial onto a fresh probe; an owner admission lifting it; and auto-approval off.cmd/hive:TestRefreshMissingCheckBehindPRs_HeldForkHeadLeftAlone: server#686 in miniature.TestRefreshMissingCheckBehindPRs_OncePerSetOfMissingChecks.TestStageHeldWorkflowRunsIndex.pkg/stageengine:TestClassifyStageHeldWorkflowRunsParkForMaintainer: what it overrides and what it leaves alone.TestHeldWorkflowRunsRoundTripFacts.decisionCausemirror covers the new reason.pkg/dashboard:TestDecisionForPRHeldWorkflowRuns.humanizeStageReasoncase.The probe change is tested through its predicate rather than a full
EnrichCIStatusfixture.Locally I ran only
gofmt -l(AGENTS.md bans localgo test/go build/go vet) andcheck-docs-citations.py, which verified 2163 references. CI is the test run.Appendix: code refs
src/pkg/github/client.go(EnrichCIStatus) andsrc/pkg/github/workflow_approval.go(workflowApprovalProbeWanted,HeldWorkflowRunIDs,PRWorkflowApproval.Denied)src/pkg/github/workflow_auto_approval.go:policyDeniedledger bit,markWorkflowApprovalDenied, sweep changessrc/cmd/hive/stage_shared_ci.go(stageHeldWorkflowRuns),src/cmd/hive/merge_eligibility.go(policy wiring)src/pkg/github/automerge/automerge_stage_labels.go,automerge_stage_sharedci.go(observation),automerge_stage_human.go(085 cause)src/pkg/stageengine/derive_pr_classify.go(HeldWorkflowRunsStage),derive_pr.go,facts.go,prstage/{reasons,causes,types}.gosrc/pkg/dashboard/stage_tracker_caption.go,stage_tracker_decision_pr.gosrc/cmd/hive/missing_check_base_refresh.go: loop guardstage-labels.md(new 085 row),operator-reference/runtime-and-quota.md,operator-reference/sweeps-and-operations.md,github-write-surface.md🤖 Generated with Claude Code
https://claude.ai/code/session_01BQYnPGFJx81c8JXR3o1sg1