Skip to content

πŸ› fix(automerge): a 072 nudge for a red that turns out to be a shared CI incident is withdrawn - #17007

Merged
hivecommons-hive[bot] merged 1 commit into
hivecommons:v6from
Danathar:fix/shared-ci-072-release
Nov 7, 2026
Merged

hivecommons-hive[bot] merged 1 commit into
hivecommons:v6from
Danathar:fix/shared-ci-072-release

Conversation

@Danathar

@Danathar Danathar commented Nov 7, 2026

Copy link
Copy Markdown
Contributor

Summary

When a contributor PR goes red, the hive posts a 072 nudge at once: "this PR is back in your court … the hive will not merge it until the head changes". If the scanner then defers that red to a [shared-ci] incident, the stage pass already moves the PR out of 072, but the nudge stays as posted and keeps telling the author something false. This PR edits that nudge in place to say it was withdrawn. It also keeps the PR deferred for the short gap between the incident closing and the shared-CI rerun sweep re-running its checks, and makes the nudge name the failing check instead of the CI gate's bare check-failure token.

What went wrong

On 2026-11-07, v5's #16952 made native-queue-policy call a function v6 did not export yet, so every v6 PR failed it.

Reading v6, and running a test that replays that sequence:

  • Release on the marker already works. On the next CI-enriched pass, SharedCIDeferredStage moves the PR to 050 with reason shared-ci-incident:17003, and the relay fix queue drops it. The nudge comment is never touched, though, and the head's nudge count stays at 1.
  • Re-run on close already works, with a gap. SweepSharedCIReruns re-runs the failed jobs every 15 minutes. But openSharedCIIncident releases the PR the moment the incident closes, so during that gap a still-red head goes back to 072. A PR first nudged in that gap is told "until the head changes" about a check that is about to be re-run. If the incident lasted more than 24h, the PR also gets the stall re-nudge and its adoption grace has already run out.
  • check-failure. v6 has no required checks, so the engine evaluates CI with a known-empty required set. EvaluateCommitCI then blocks on "check-" + conclusion (commit_ci.go) without naming the check, and the nudge printed that token.

#17003 closed at 15:46:19Z.

What changes

  • Nudge withdrawn. When the stage pass reads a head's red as shared-ci-incident:<n> or base-branch-red:<checks> and that head was nudged, the hive edits its own nudge comments for that head in place. It keeps the marker line, adds <!-- hive:contributor-nudge-withdrawn -->, and says there is nothing to fix and what happens next. An edit notifies nobody. The record's nudge for that head is then forgotten, so a genuine return to 072 gets a fresh first nudge, and the stall and adoption clocks restart from it. A failed list or edit is retried on the next pass.
  • Deferred until re-run. After an incident closes as completed, a PR whose newest marker names it stays deferred until the rerun sweep stamps <!-- hive-shared-ci-rerun-<n> -->, for at most 30 minutes. A "not planned" close releases the PR at once, as before, because the sweep never re-runs those.
  • Real check names. When the nudge's failing checks hold a bare gate token (check-failure, status-error, …), the nudge reads the head's check digest and lists the red checks by name. It does this only when such a token is present, and keeps the token if the read fails.

The shared-CI detection itself is unchanged: this reuses the scanner's marker, the stage index and the rerun marker.

Files

  • src/pkg/github/automerge/automerge_contributor_nudge.go: the withdrawal and the check naming.
  • src/pkg/github/automerge/automerge_stage_labels.go: one call where the pass already resolves a PR that left 072.
  • src/pkg/stagelabels/store.go: WithdrawNudge.
  • src/pkg/github/shared_ci_incident.go, client.go: the post-close grace.
  • Docs: stage-labels.md (shared-CI and base-red rows, nudge section) and sweeps-and-operations.md (rerun sweep).
  • changelog.d/fixed-shared-ci-withdraws-072-nudge.md.

Tests

New tests. The first three fail on v6 tip e1bad508a and pass with this change:

  • TestApplyStageLabelsSharedCIIncidentWithdrawsEarlierNudge: nudged at 072, then deferred. The nudge is edited once, nothing new is posted, the nudge is forgotten, and a head still red after the incident gets a fresh first nudge. On tip: edits=[].
  • TestContributorNudgeNamesChecksForBareCIToken: on tip the nudge lists check-failure.
  • TestEnrichCIStatus_SharedCIIncidentHeldUntilRerunAfterClose: closed 5 minutes ago with no rerun marker stays deferred. A rerun marker, a close 2 hours ago or a not-planned close releases the PR. On tip: PR 1 and PR 5 report 0.
  • TestWithdrawnNudgeCommentBaseBranchRed, TestBareCIToken: unit tests for the new helpers.

Full runs: ./pkg/github/, ./pkg/github/automerge/, ./pkg/stageengine/..., ./pkg/stagelabels/, ./pkg/writeback/, ./cmd/hive/. Also go vet, and check-docs-links.py and check-docs-citations.py.

Refs #17003, #16952, #12606, #12253

πŸ€– Generated with Claude Code

https://claude.ai/code/session_01BQYnPGFJx81c8JXR3o1sg1

… CI incident is withdrawn

The 072 nudge goes out the moment a contributor PR goes red ("the hive
will not merge it until the head changes"). The scanner's [shared-ci]
incident marker can land minutes later. The stage pass then moved the
PR to 050, but the nudge stayed as posted and the head's nudge count
stayed at 1. Seen on hivecommons/hive hivecommons#16993, hivecommons#16995, hivecommons#17000 and
hivecommons#17001: nudged for native-queue-policy about ten minutes before they
were deferred to incident hivecommons#17003.

- When the pass reads a nudged head's red as shared-ci-incident:<n> or
  base-branch-red:<checks>, edit the hive's own nudge comments for that
  head in place to say it was withdrawn, and forget the nudge
  (Store.WithdrawNudge), so a genuine return to 072 is nudged afresh.
- After an incident closes as completed, keep a PR deferred to it until
  the rerun sweep stamps hive-shared-ci-rerun-<n> (at most 30 minutes),
  so the head is not handed back in the gap before the re-run.
- Name the head's red checks in the nudge when the CI gate's reason is
  a bare token such as check-failure (a base with no required checks).

Refs hivecommons#17003, hivecommons#12606, hivecommons#12253

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 7, 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 nicholasjackson 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 7, 2026
@hivecommons-hive
hivecommons-hive Bot merged commit f7acdbf into hivecommons:v6 Nov 7, 2026
72 of 75 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 `#170075d9b6a1` sha256:1cb3d7ed8532d284fd52a32c75bd0ece5e2d651d9dd558f027b6827ea152f6c7 β€” download from the dashboard or `hivectl review evidence #17007`.

@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 5d9b6a1.

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