Skip to content

πŸ› adoption: a red optional check escalates where auto-merge is off - #18847

Merged
hivecommons-hive[bot] merged 1 commit into
hivecommons:v6from
Danathar:fix/adopted-optional-check-auto-merge-off
Nov 17, 2026
Merged

hivecommons-hive[bot] merged 1 commit into
hivecommons:v6from
Danathar:fix/adopted-optional-check-auto-merge-off

Conversation

@Danathar

Copy link
Copy Markdown
Contributor

Summary

On a repo whose auto-merge is off, an adopted PR that is red only on an optional check now moves to stage/085-needs-decision once it sits idle past the 074 dwell. Before this change it stayed at stage/074-adopted-by-hive indefinitely: the hive had nothing to push and nobody was asked.

Where the hive merges, nothing changes. The #13040 rule still holds there: a red optional check alone never escalates.

What happened

projectbluefin/actions#752, a clanker's fork PR in a repo with auto-merge off (knuckle, build 3b50113):

  • 11-16 6:41 AM EST: an earlier escalation released, and the history shows 85 β†’ 74 with reason optional-check-failing:Check consumer validation evidence.
  • 11-16 6:28 PM EST: the review swarm approved on all five perspectives.
  • 11-17 5:19 PM EST: still at 074. The Activity monitor reads "Hive adopted this PR; hive is fixing CI β€” optional check … failing". The one required check passed, finisher is person ("auto-merge is off for this repo … a person merges it"), and the PR is not in waiting_on_human.

The red check needs a maintainer-supplied consumer run, which neither the fixer nor the author can produce. The 074 dwell is 12h. The PR sat 35h past it on an unchanged head.

Cause

  • Adoption counts a red optional check as work the hive takes over (stage-labels.md:1072-1076).
  • The stall escape does not. adoptionStalledReasonWith returns "" when adoptionOptionalCheckOnly(obs) is true (automerge_contributor_adopt.go:2601 on 98f201ddd). Its reason, from πŸ› adopted PR escalated to 085 minutes after a hive push: legacy records lack adopted_head_at, optional-check red counts as stalled, escalation never releasesΒ #13040, is that "the merge gate does not read it, so it is nothing a person must decide".
  • That premise holds wherever the lane merges: it gates on required checks only and merges past a red optional one (derive_pr_classify.go:634-641).
  • It does not hold on a repo whose auto-merge is off. There the lane only observes and records repo-auto-merge-disabled (automerge_observe_only.go:93-108), and a person merges.
  • The stage engine keeps the head in the fixing stage, so it never reaches 090. With the stall escape excluded too, nothing ever moves it.

What changed

  • adoptionOptionalCheckOnly no longer applies when the lane only observed the head (LaneReason == repo-auto-merge-disabled, via a new adoptionLaneObservedOnly helper). In that case the red optional check escalates like any other red check: after the 074 dwell, on an unchanged head with CI idle, the PR moves to 085 with reason adoption-stalled:optional-check-failing:<check>.
  • The existing πŸ› adopted PR escalated to 085 minutes after a hive push: legacy records lack adopted_head_at, optional-check red counts as stalled, escalation never releasesΒ #13040 safeguards still apply:
    • the dwell runs from the head, so a hive push restarts it;
    • a legacy record with no head clock starts its clock at the first sweep;
    • the escalation releases as soon as its reason clears.
  • Stall note: for this case it adds one sentence: the check is not required, auto-merge is off so a person merges, and they can re-run or fix the check, or merge past it. A stall whose reason is a required check never gets that sentence.
  • Docs: stage-labels.md (the 074 row, the transition diagram, and the stall paragraph) and hive-merge.md now describe the exception.

Why this rule rather than not adopting

I kept #13040's owner rule where its premise holds and only exempted the one case where it doesn't, so this doesn't reverse an owner decision. The prompt's other option, never adopting on an optional-only red, would leave #752 at 072 waiting on an author who cannot act. That is the same deadlock one stage earlier.

Not in this PR

Tests

Only gofmt -l was run locally (AGENTS.md bans local go test/go build/go vet). This PR's CI is the test run.

πŸ€– Generated with Claude Code

https://claude.ai/code/session_01BQYnPGFJx81c8JXR3o1sg1

The stall escape never counted a red optional check (hivecommons#13040: the lane
merges past it, so nothing is a person's to decide). On a repo whose
auto-merge is off the lane only observes and a person merges, so an
adopted PR red only on an optional check sat at 074 with nothing for the
hive to push and nobody asked (projectbluefin/actions#752, 35h).

Count it there like any other red check: past the 074 dwell with CI idle
it escalates to 085 adoption-stalled:optional-check-failing:<check>, and
the note says the check is optional and a person may merge past it.
Where the hive merges, the hivecommons#13040 exclusion 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
@kubestellar-prow kubestellar-prow Bot added the dco-signoff: yes Indicates the PR's author has signed the DCO. label Nov 17, 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 kellyaa 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

@github-actions

github-actions Bot commented Nov 17, 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
#18848 πŸ› writeback: let the hive move a stage label it applied on a PR older than the backfill cutoff same files src/pkg/github/automerge/automerge_contributor_adopt.go
#18843 πŸ› 090 and workflow-fence comments: name auto-merge off, and no /lgtm without Prow same files src/docs/labels-and-control-signals/stage-labels.md
#18842 πŸ› base red: remember the base's red checks and read new heads from them same files src/docs/labels-and-control-signals/stage-labels.md
#18838 πŸ› contributor lane: recognise the cncf/prow-github-actions ok-to-test refusal same files src/docs/hive-merge.md
#18667 πŸ› automerge: refuse an unsigned squash only where the repo requires DCO same files src/docs/labels-and-control-signals/stage-labels.md

@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 `#18847d9c0c9e` sha256:83dcef11d06ca5df972c448a72c1596f54aadb10f78e703aba368895fcfba193 β€” download from the dashboard or `hivectl review evidence #18847`.

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/M Denotes a PR that changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant