Skip to content

πŸ› Evict a PR the hive merged itself from the tracker and cached snapshot at once - #14421

Merged
hivecommons-hive[bot] merged 1 commit into
v5from
fix/webhook-merged-pr-stale
Oct 26, 2026
Merged

hivecommons-hive[bot] merged 1 commit into
v5from
fix/webhook-merged-pr-stale

Conversation

@clubanderson

Copy link
Copy Markdown
Member

Problem

A PR the hive merges itself stays on the stage tracker ("Needs human" / "Sentinel alert") and in the governor's cached actionable snapshot until GitHub's pull_request closed webhook comes back round through the hub, the closed-row sweep runs on the next status publish, or a full enumeration replaces the snapshot. hivecommons/docs#469 on hosted-available-oke-11-placeholder-r05x: pr_merged (path=sweep) at 18:25:46Z, then intent_evaluated lane=merge-eligible for the same PR at 18:31, 18:42, 18:47, 18:52, 18:59, 19:04 and 19:10Z; still listed at 19:25Z. The hub relay (single-shot, 30s timeout, no retry) was failing 921/2314 relays to this spoke while it thrashed before an OOM kill, so the closed delivery was lost, and the closed sweep did not run again after 18:13Z.

Fix

Every merge path ends in Client.RecordPRMergedAudit, which delivers a pr_merged audit record to the attribution sink in configureGitHubClient. That sink now calls Server.EvictHiveClosedItem, which applies the same closed+merged WebhookItemSnapshot a webhook delivery would through applyWebhookItemSnapshots: the governor snapshot is patched (Dependencies.ApplyWebhookItems), the published status drops the row, the tracker cache is invalidated, and the patch is remembered for replay so an enumeration that began before the merge cannot resurrect it. pr_closed records take the same path with Merged=false. No GitHub call is made.

Tests

  • TestHiveMergeEvictsTrackerRowWithoutWebhook: docs#469 fixture leaves the tracker, repo PR count recounts, governor receives one closed+merged patch with the hive-write audit marker, and a stale publish does not bring the row back.
  • TestHiveMergeEvictIsIdempotentAndIgnoresUnlisted: second call, unknown repo, empty repo, number 0 and nil server are no-ops.
  • TestEvictHiveClosedPRFromAuditRecord: pr_merged and pr_closed evict via /api/status; other actions, missing target or missing repo are ignored.

Refs #14420

…hot at once

Every hive merge path (sweep, queue, relay, forge) ends in
RecordPRMergedAudit, but nothing removed the PR from the dashboard status
or the governor's cached ActionableResult: the row left only when the
pull_request closed webhook came back round through the hub, when the
closed-row sweep ran on the next status publish, or when a full
enumeration replaced the snapshot. hivecommons/docs#469 was merged by the
sweep at 18:25Z and still showed as Sentinel alert - needs human an hour
later while the governor re-evaluated it as merge-eligible seven times.

The attribution audit sink now applies the same closed snapshot a webhook
delivery would for pr_merged and pr_closed records, patching both stores
and remembering the patch for replay.

Refs #14420

Signed-off-by: Andy Anderson <andy@clubanderson.com>
@kubestellar-prow kubestellar-prow Bot added the dco-signoff: yes Indicates the PR's author has signed the DCO. label Oct 26, 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 hanthor 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 Oct 26, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Open PR overlap check

Base branch: v5

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

No conflicting open PRs or same-file overlaps were found.

@hivecommons-hive

Copy link
Copy Markdown
Contributor

@clubanderson is auto-promoted for contributor-lane merging on this PR: the last 5 merged PRs by this author in this repository have no revert or sentinel-alert evidence. CI, reviewer verdict, diff fences, soak, holds and branch protection still apply.

@hivecommons-hive hivecommons-hive Bot added author/human A person pushed this PR themselves dco All commits are DCO signed-off role/trusted Author is trusted for unattended merge (trusted-author role or registry/claim tier in require_tiers) stage/050-review-pending Review swarm requested; awaiting a verdict for the current head labels Oct 26, 2026
@hivecommons-hive
hivecommons-hive Bot merged commit 8f21d56 into v5 Oct 26, 2026
81 of 85 checks passed
@kubestellar-prow
kubestellar-prow Bot deleted the fix/webhook-merged-pr-stale branch October 26, 2026 20:11
@hivecommons-hive

Copy link
Copy Markdown
Contributor
Evidence bundle `#1442187519ac` sha256:af5a988382861bc50e78d56c60a652b2f9f5055db3ab07e2c28bff531b292e8e β€” download from the dashboard or `hivectl review evidence #14421`.

@github-actions

Copy link
Copy Markdown
Contributor

Thank you for your contribution! Your PR has been merged.

We'd love to hear how your experience was: share feedback

@hivecommons-hive

Copy link
Copy Markdown
Contributor

merged by Hive trusted-author auto-merge: author @clubanderson holds role owner and GitHub permission admin on repo; CI green at 87519ac.

@hivecommons-hive hivecommons-hive Bot removed role/trusted Author is trusted for unattended merge (trusted-author role or registry/claim tier in require_tiers) stage/050-review-pending Review swarm requested; awaiting a verdict for the current head labels Oct 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author/human A person pushed this PR themselves dco All commits are DCO signed-off 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