Skip to content

🐛 fix(stage): a required check that never reported keeps the PR at 060 - #16822

Merged
hivecommons-hive[bot] merged 1 commit into
hivecommons:v6from
Danathar:fix/stage-required-checks-missing
Nov 5, 2026
Merged

hivecommons-hive[bot] merged 1 commit into
hivecommons:v6from
Danathar:fix/stage-required-checks-missing

Conversation

@Danathar

@Danathar Danathar commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

Executive summary

projectbluefin/utah#1074, utah#1072 and utah-packages#873 were labelled stage/090-ready-for-human-merge with "4/4 checks green … Ready for a human merge". They were opened with GITHUB_TOKEN, so no workflow ran: the ruleset-required contract and build_main / Check all testing builds successful never reported, and GitHub would refuse the merge.

The stage pass now reads the base branch's required checks, names the ones with nothing reported, and keeps the PR at 060-reviewed until they report.

What

Head picture Before After
every check that ran is green, a required check never reported 090, "4/4 checks green" 060, "4/4 checks green, required not reported: contract"; reason names the checks
required checks all reported green 090 090 (unchanged)

Why

The stage evidence's check digest (SummarizeCommitChecks) counts only checks that reported on the head. An absent required check was neither red nor pending, so RouteHuman saw a clean head. A required-check fold that lists missing contexts (summarizeRequiredChecks) already existed; the digest did not use it.

How

  • github.SummarizeCommitChecksRequired fills a new CommitChecksSummary.MissingRequired from the same status and check-run reads.
  • automerge: the default reader passes the base branch's required set (requiredStatusCheckContexts: protection, rulesets, else config), cached per repo and branch for humanChecksTTL on the stage tracker. A test-swapped CheckSummarizer is unchanged.
  • stagelabels: CheckSummary.Missing. RouteHuman treats it as a pending gate (060 is "a gate is still pending"), and the summary line names it.

Tests

Test Covers
TestHumanHandoffWaitsOnMissingRequiredChecks 060 and no ready comment while missing; 090 once they report
TestHeadRequiredChecksReadsBaseBranchOnce default reader names contract; one protection read per branch
TestRouteHumanMissingRequiredChecksIsAPendingGate route, reason and summary text
TestSummarizeCommitChecksRequiredNamesMissing digest names the missing context; nil set names nothing
Mutants 6/6 caught
go test stagelabels, github/..., stageengine/..., writeback, dashboard pass (the shared automerge fake API now answers the protection and rules reads: unprotected, no rules)

Notes

  • The dashboard merge verdict for utah#1074 also omits required-check-missing. That is the band and verdict side, left to the band-classification fix.
  • A required check whose workflow GitHub never scheduled blocks the merge on GitHub too, so naming it is the merge gate's view, not a stricter one. The merge sweep's skipped-by-design exemption applies to the trusted-bot lane only and does not reach this route.

🤖 Generated with Claude Code

https://claude.ai/code/session_01BQYnPGFJx81c8JXR3o1sg1

projectbluefin/utah#1074 read "4/4 checks green … Ready for a human merge"
while its ruleset-required checks never ran (opened with GITHUB_TOKEN). The
check digest now names required contexts with nothing reported on the head
(base branch required set, cached per repo and branch) and RouteHuman waits
on them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BQYnPGFJx81c8JXR3o1sg1
Signed-off-by: Danathar <Danathar@users.noreply.github.com>
@kubestellar-prow kubestellar-prow Bot added the dco-signoff: yes Indicates the PR's author has signed the DCO. label Nov 5, 2026
@kubestellar-prow

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign danathar for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found 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 kubestellar-prow Bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Nov 5, 2026

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Read at head bc6ebce against v6, including requiredStatusCheckContexts → RequiredStatusCheckPolicy (commit_ci.go:181-210) and the existing summarizeRequiredChecks fold (commit_checks_summary.go:109-171). The fix is sound; one low-severity gap in the cache.

Verified correct

  • automerge_stage_human.go:89-104: headChecks releases tracker.mu before calling summarizeChecks, and the new headRequiredChecks closure takes the lock itself only for the map read/write — no lock is held across the API call, no re-entrancy.
  • SummarizeCommitChecksRequired (commit_checks_summary.go:45-55) reuses the same fetchCommitChecks read, so no extra API round-trip per head; summarizeRequiredChecks already existed and is used by the merge sweep, so the name-matching semantics are the gate's own.
  • stagelabels/human.go:579-581: the missing-required reason is appended to wait, which is the existing 060 path — so a PR at 090 whose required check later vanishes correctly drops back, and Known == false still routes as before. Body's claim "a test-swapped CheckSummarizer is unchanged" holds (automerge_stage_human.go:48-49).
  • go build ./pkg/github/... ./pkg/stagelabels/ passes at this head.

Low: an unreadable required set is cached as "none required" for 10 minutes

automerge_stage_human.go:74-84: when requiredStatusCheckContexts returns known == false (API error, or RequiredStatusCheckPolicy's "none" branch at commit_ci.go:210), set is forced to nil and that nil is written to tracker.required[key] with a fresh at. For the next humanChecksTTL (10m, line 31) every PR on that base branch gets MissingRequired empty, i.e. exactly the pre-fix picture — so a transient 5xx on the protection read lets a GITHUB_TOKEN-opened PR reach 090 and post its one-shot "Ready for a human merge" comment, then drop back to 060 on the next pass. Not a regression against v6, but it is the window the PR is meant to close. Two cheap options: skip the cache write when !known (retry next pass), or carry known into CheckSummary so an unknown required set is itself a pending gate, like Checks.Known == false already is.

Not blocking from my side.

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

@github-actions

github-actions Bot commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

Open PR overlap check

Base branch: v6

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

PR Title Relation Files
#16688 🌱 Forward-merge v5 into v6 (2 commits) same files src/docs/labels-and-control-signals/stage-labels.md
src/pkg/github/automerge/automerge_stage_labels.go
src/pkg/github/automerge/automerge_stage_labels_test.go
#16816 🐛 fix(adoption): refuse a fixer push that undoes the adopted PR's change same files src/docs/labels-and-control-signals/stage-labels.md
#16821 🐛 fix(stage): word a hive hold's release step for the gate that set it same files src/pkg/stagelabels/human.go

@hivecommons-hive
hivecommons-hive Bot merged commit 80d7072 into hivecommons:v6 Nov 5, 2026
71 of 74 checks passed
@hivecommons-hive

Copy link
Copy Markdown
Contributor

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

Evidence bundle `#16822bc6ebce` sha256:bf387435792ae56d2a64fb57e277366d66b6f1b3ad739f08e5684dc78366d4ac — download from the dashboard or `hivectl review evidence #16822`.

hivecommons-hive Bot added a commit that referenced this pull request Nov 10, 2026
…ranches instead of "Blocked only by" trust (#17551)

projectbluefin/utah#1072 (head c38126c, 2026-11-06/07) had every required
check green but GitHub reported it BEHIND a `main` whose ruleset requires
up-to-date branches. The 090 entry comment still said "Blocked only by
`role/untrusted`" and offered "(or merge)", which GitHub refuses.

The lanes' fresh PR fetch (noteStagePR) now records mergeable_state for the
head it read; the stage pass carries it to the human-route evidence for that
exact head only. A behind head stays at 090, but its digest says "behind
`main`", the trust clause reads "Blocked by", and the comment says GitHub
will not merge it until `main` is merged in. Up-to-date heads read as before.

The missing-required-check half of projectbluefin/common#1619 was already
fixed by #16822; a new test pins that a skipped required check counts as
reported, as GitHub treats it.


Claude-Session: https://claude.ai/code/session_01BQYnPGFJx81c8JXR3o1sg1

Signed-off-by: Danathar <Danathar@users.noreply.github.com>
Co-authored-by: Danathar <Danathar@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: hivecommons-hive[bot] <280983584+hivecommons-hive[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dco-signoff: yes Indicates the PR's author has signed the DCO. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant