Skip to content

πŸ› fix(automerge): close the adopted PR when its superseder merges from any stage - #14474

Merged
hivecommons-hive[bot] merged 2 commits into
v5from
fix/14471-adoption-settle-any-stage
Oct 27, 2026
Merged

hivecommons-hive[bot] merged 2 commits into
v5from
fix/14471-adoption-settle-any-stage

Conversation

@clubanderson

Copy link
Copy Markdown
Member

Fixes #14471

Problem

settleAdoption (which polls the superseding hive PR and closes the original once it merges) only ran while the original sat at stage 074 adopted-by-hive. Both live cases moved off 074 before the superseder merged:

Both had to be closed by a human.

Fix

  • settleSuperseder polls the superseder from any non-terminal stage while a record still has AdoptedBy set, on the existing adoptCheckInterval cadence.
  • Superseder merged: if the superseder carries the original's current head (or the original has no head on record), post the hive:adopted-merged note and close the original. If the heads diverged, post one hive:adopted-merged-diverged note per head and leave it open for the contributor.
  • Close refused (403/404, e.g. a fork PR the App cannot close): leave the note, mark the record superseded_by/superseded_open so the stage tracker drops the row; no retry loop.
  • Superseder closed unmerged: clear adoption so the original flows normally.
  • Stage store: MarkSuperseded (idempotent), MarkSupersederMergedNoted, Superseded, SupersederPollDue; ClearAdoption resets them.
  • Stage tracker: superseded records are not rows.
  • adoptClosesPattern now also carries Refs #N lines to the adopted PR.

Tests

  • automerge: superseder merged while original parked at 085; merged with a later head that the superseder carries; diverged head notes once and does not close; close refused marks superseded-open; Refs carried.
  • stagelabels: MarkSuperseded idempotence, poll gate, ClearAdoption reset.
  • dashboard: superseded PR dropped from the stage tracker.

go test -coverprofile: stagelabels 93.0%, github/automerge 90.0%.

…any stage

The superseder poll only ran while the original sat at 074, so an original
that moved to 085 (needs-human) or 072 (contributor pushed a new head) was
never closed when the hive copy merged. Poll the superseder from any stage,
close the original with a linking note, mark it superseded in the stage
store when the close is refused, and evict superseded records from the
stage tracker. Closes/Fixes/Refs lines are all carried to the adopted PR.

Fixes #14471

Signed-off-by: Andrew 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 27, 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 Oct 27, 2026
@github-actions

github-actions Bot commented Oct 27, 2026 •

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 27, 2026
@hivecommons-hive
hivecommons-hive Bot merged commit b05e7ba into v5 Oct 27, 2026
73 of 74 checks passed
@kubestellar-prow
kubestellar-prow Bot deleted the fix/14471-adoption-settle-any-stage branch October 27, 2026 01:46
@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
Evidence bundle `#144744de6552` sha256:ee6cbe9045768136c3c035b2c617d1199b43cea7c9f9e6cf5c02056e42b22f0a β€” download from the dashboard or `hivectl review evidence #14474`.

@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 4de6552.

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. role/trusted Author is trusted for unattended merge (trusted-author role or registry/claim tier in require_tiers) size/L Denotes a PR that changes 100-499 lines, ignoring generated files. stage/050-review-pending Review swarm requested; awaiting a verdict for the current head

Projects

None yet

Development

Successfully merging this pull request may close these issues.

πŸ› adoption: source PR is never closed when the superseding hive PR merges once it leaves stage 074

1 participant