Skip to content

πŸ› fix(stage): the 090 comment names a base that requires up-to-date branches instead of "Blocked only by" trust - #17551

Merged
hivecommons-hive[bot] merged 3 commits into
hivecommons:v6from
Danathar:fix/ready-receipt-required-checks
Nov 10, 2026
Merged

hivecommons-hive[bot] merged 3 commits into
hivecommons:v6from
Danathar:fix/ready-receipt-required-checks

Conversation

@Danathar

Copy link
Copy Markdown
Contributor

Summary: The 090 "Ready for a human merge" comment said "Blocked only by role/untrusted" and offered "(or merge)" on PRs that GitHub reported BEHIND a base requiring up-to-date branches, so nobody could merge them as they were. The stage pass now gets GitHub's mergeable_state from the lane's own PR fetch (no extra API call). A behind head stays at 090, but the comment names the out-of-date branch as a second blocker. The other half of projectbluefin/common#1619, required checks that never reported, already landed in #16822. This PR only adds a test that pins how a skipped required check is counted.

What went wrong

What changes

  • noteStagePR, which every lane already calls with a freshly fetched PR, also records mergeable_state together with the head it was read on. StageTracker.drain copies it into an observation only when the head matches.

  • humanEvidence sets Evidence.BehindBase to the base branch when that head reads behind. GitHub only reports behind when the base requires up-to-date branches.

  • RouteHuman does not change the stage. The digest gains "behind `main`", and the trust-blocked 090 comment now reads "Blocked by …":

    Ready for a human merge: verdict approved @c38126c, 20/20 checks green, behind main, soak 30m0s elapsed. Blocked by role/untrusted (no verified hive claim or registry tier). The branch is also behind main, which requires up-to-date branches: GitHub will not merge this head until main is merged into it.

    The footnote drops "(or merge)" and says the branch must be brought up to date first. A head that is up to date reads exactly as before.

  • The merge gate is unchanged. It already blocks on a missing required check (required-check-missing:), and GitHub enforces strict freshness itself.

Files

  • src/pkg/stageengine/prstage/types.go: Detail.MergeableState / MergeableStateHead
  • src/pkg/github/automerge/automerge_stage_labels.go: record in noteStagePR, carry in drain
  • src/pkg/github/automerge/automerge_stage_human.go: humanBehindBase, set in humanEvidence
  • src/pkg/stagelabels/human.go: Evidence.BehindBase, Route.BehindBase, digest and 090 comment wording
  • Docs: stage-labels.md (090 row) and two drifted citations in adr/0025-central-stage-engine.md; changelog fragment

Tests

None of these were run locally (repo policy). CI is the verdict.

  • TestReadyCommentNamesBehindBase (stagelabels): with a behind head the comment has "Blocked by", the base-merge sentence and no "(or merge)". An up-to-date head keeps the old text. On the v6 tip the comment always says "Blocked only by", whatever the base state.
  • TestRouteHumanBehindWithMissingRequiredStillWaits: a behind head with a missing required check still waits at 060.
  • TestReadyCommentNamesBehindBaseFromLaneFetch (automerge, end to end): a lane fetch with mergeable_state: behind produces the new 090 comment. On the tip the state is dropped, so the comment says "Blocked only by".
  • TestHumanBehindBaseOnlyForTheFetchedHead: a state read for an older head, or a clean state, never counts as behind.
  • TestSummarizeCommitChecksRequiredSkippedAndPendingAreReported (github): pins current behaviour. A skipped required job counts as reported and green, as GitHub treats it. A queued one counts as pending, and only a context nothing reported is missing.

Left for follow-ups

  • Same-name check from the wrong producer: the ruleset's integration_id is not compared yet. RequiredStatusCheckPolicy already returns the bindings.
  • Unreadable required-check policy: when every required-check read fails, the digest names no missing checks.
  • A head that falls behind after its 090 comment is posted keeps the old comment until the next visit. On v6, a 090 comment is not rewritten within a visit.

This touches stagelabels/human.go, which #17506 also edits (sentinel/hold gates in ReadyComment). The hunks here are kept away from those lines.

Refs projectbluefin/common#1619, #16822

πŸ€– Generated with Claude Code

https://claude.ai/code/session_01BQYnPGFJx81c8JXR3o1sg1

…ranches instead of "Blocked only by" trust

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 hivecommons#16822; a new test pins that a skipped required check counts as
reported, as GitHub treats it.

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

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 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. labels Nov 10, 2026
@github-actions

github-actions Bot commented Nov 10, 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
#17506 🌱 Top up v6 with v5 (durable hosted hive.yaml, shared-CI deferral naming and 118 more) CONFLICT src/pkg/stagelabels/human.go

@hivecommons-hive

hivecommons-hive Bot commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

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

Reviewed by reviewer-2 β€” no findings.

Reviewer notes

Read the non-test diff against the v6 tree. This looks correct to me; no findings.

What I checked:

  • Source of mergeable_state. noteStagePR is called from automerge_sweep_trusted.go:31/:653, automerge_sweep_queued.go:31 and automerge_contributor_lane.go:1477, each after a single-PR PullRequests.Get (guardedPR / Get at :280, :777, :1470). The single-PR endpoint is the one that populates mergeable_state, so the "no extra API call" claim in the body holds and the value is never read off a list response that would leave it empty.
  • Fail-safe direction. humanBehindBase (automerge_stage_human.go) only fires on the literal "behind" for exactly the current head. GitHub's transient "unknown" (or a stale head after a push) falls back to the existing "Blocked only by" wording, so the new sentence cannot be wrongly asserted β€” it can only be missing for one cycle.
  • drain() merge (automerge_stage_labels.go:424-426) pins the state to o.HeadSHA the same way the HumanApprovalHead / DCOGateHead branches directly above it do.
  • ReadyComment keeps the approved-manual-merge early return untouched; only the trust-blocked tail changes, and RouteHuman never alters the stage (still ReadyForHumanMerge), matching the body's "stays at 090".

Body and diff agree.

Evidence bundle `#1755149d922a` sha256:fe1807ccfd5959aa6f5c6bfde1e18e2c2f38f742eceffb5fb3e016eacc5a8bb9 β€” download from the dashboard or `hivectl review evidence #17551`.

@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 the diff against the v6 tree and the callers. This looks correct to me.

What I checked:

  • mergeable_state is real, not empty: all four noteStagePR callers (automerge_contributor_lane.go:1477, automerge_sweep_queued.go:31, automerge_sweep_trusted.go:31,653) pass a PR from PullRequests.Get / guardedPR, not from a list call, so the field is populated. GitHub's transient "unknown" after a push simply reads as not-behind and falls back to today's wording.
  • Head pinning holds end to end: noteStagePR records the state with pr.Head.SHA, drain (automerge_stage_labels.go:424) copies it only when MergeableStateHead == o.HeadSHA, and humanBehindBase re-checks the same equality β€” a state read on a previous head cannot leak onto the current one. TestHumanBehindBaseOnlyForTheFetchedHead pins that.
  • RouteHuman still returns ReadyForHumanMerge; only Route.BehindBase/the comment text change, as the body says.

One thing for whoever merges, not a defect: the overlap check reports a textual conflict with #17506 (the v5β†’v6 top-up) on src/pkg/stagelabels/human.go. Whichever lands second needs a rebase of that file.

Minor, optional: readyCommentBehindTail is appended even when blockedBy == "", so the sentence starts with "The branch is also behind …" with nothing before it. Harmless; "also" just reads oddly in that branch.

β€” hive: agent=reviewer backend=copilot model=claude-fable-5.1 copilot=1.0.88

@hivecommons-hive
hivecommons-hive Bot merged commit 2a9f97a into hivecommons:v6 Nov 10, 2026
67 of 68 checks passed
@hivecommons-hive

Copy link
Copy Markdown
Contributor

merged by Hive trusted-author auto-merge: author @Danathar holds role owner and GitHub permission maintain on repo; CI green at 49d922a.

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

Labels

conflicts-with-open-pr Open PR has a merge conflict with another open PR 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