Skip to content

πŸ› dispatch: never open a second PR for an issue that already has one - #15506

Merged
hivecommons-hive[bot] merged 6 commits into
v5from
fix/dispatch-skip-issue-with-open-pr
Oct 29, 2026
Merged

hivecommons-hive[bot] merged 6 commits into
v5from
fix/dispatch-skip-issue-with-open-pr

Conversation

@clubanderson

Copy link
Copy Markdown
Member

Fixes #15505

Incident (#15469): the owner filed an issue, hive dispatched its own relay fixer 9 s later, the owner's PR #15470 (Fixes #15469) landed 45 s after that, and the fixer β€” never told β€” opened #15473 eight minutes later. Both sat in the contributor-lane merge train as "Approved; waiting its turn". The duplicate-fix sweep saw the pair at 19:28Z and wrote nothing: the relay login has no author/* label, so it was read as a person's PR and the L4 write-back gate suppressed the notice.

Changes

  • Preempt in-flight fixers. PRClaimDelivery.CoveringClaims() + onCovered on the PR-claims webhook hook β†’ ContributeWSHub.PreemptIssueCoveredByPR(repo, issue, pr, author): releases every in-flight contributor task on the covered issue (except a session whose GitHub account is the PR author) and reassigns, like a claim takeover.
  • Relay-aware duplicate-fix sweep. Client.SetRelayKnownFunc (wired from contributorRelayKnown, the contributor registry). A registered relay's later PR is the hive's own for the gate (notice no longer suppressed), gets one <!-- hive:duplicate-fix --> superseded comment, and is left open β€” never closed by the sweep (LaterRelay β†’ comment-only).
  • Park the duplicate with its author. ClassifyStage maps merge-train:duplicate-of#W to 072/071/070 by author kind (rank owned) instead of 080; the 07x pass skips nudge/adoption for a held duplicate (mergeTrainDuplicateOf); sentence now "superseded by #W β€” … close it or let the delegate decide". Tracker already renders the duplicate-of:<W> gate state as "Duplicate of #W Β· needs a pick" at any stage.
  • Docs: hive-merge.md, operator-reference.md (dispatch guard section); changelog fragment.

Tests

  • TestPreemptIssueCoveredByPR_* (hub: other-author PR releases + reassigns; own PR / other issue / nil untouched)
  • TestPRClaimsHookTellsCoverHookOnlyForOpenCoveringDelivery
  • TestSweepDuplicateFixPRs_RelayLaterPRCommentedThroughGateNotClosed (L4 gate, one comment, idempotent) and _UnknownLoginSuppressedByGate (pins the pre-fix suppression)
  • TestClassifyStageMergeTrainDuplicateParksWithAuthor, TestDuplicateHeldClankerPRParkedAt072WithoutNudgeOrAdoption
  • No time.Sleep; TestDirectWriteRatchet passes (only // writeback:gated writes).

go build ./... && go test ./pkg/github/... ./pkg/dashboard/... ./pkg/stageengine/... ./cmd/hive/... ./pkg/writeback/... green.

A person filed an issue, the hive dispatched its own relay fixer nine
seconds later, and the person's PR (Fixes #N) landed 45 s after that.
The webhook stopped the ledger offering the issue but never told the
fixer already at work, so it opened a second PR; the duplicate-fix
sweep then read the relay login (no author/* label) as a person's and
the L4 write-back gate refused its notice; the deployed train admitted
both PRs, and the one-PR-per-issue hold on v5 staged the loser at 080
"Approved; waiting its turn".

- contribute hub: an open PR covering an issue preempts in-flight
  contributor tasks on it (the author's own PR excepted), via the
  PR-claims webhook hook (onCovered).
- duplicate-fix sweep: Client.SetRelayKnownFunc from the contributor
  registry; a registered relay's later PR is the hive's own for the
  gate, gets one superseded notice, and is left open (never closed).
- stage engine: merge-train duplicate-of parks with the author
  (072/071/070, rank owned); the 07x pass neither nudges nor adopts a
  held duplicate; the sentence reads "superseded by #winner".
- docs (hive-merge, operator-reference), changelog fragment, tests.

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 29, 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

@kubestellar-prow kubestellar-prow Bot added the size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. label Oct 29, 2026
@github-actions

github-actions Bot commented Oct 29, 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.

PR Title Relation Files
#15308 ✨ feature: enqueue eligible PRs into GitHub native merge queues same files src/pkg/stageengine/derive_pr_classify.go
#15405 πŸ› fix: require verified signature for email-only hive commit identity match same files src/docs/operator-reference.md
#15497 πŸ“– docs: monitoring a hive with Prometheus and Grafana same files src/docs/operator-reference.md
#15516 πŸ“– docs: split the operator reference same files src/docs/operator-reference.md

@github-actions github-actions Bot added the conflicts-with-open-pr Open PR has a merge conflict with another open PR label Oct 29, 2026
@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 hive's repositories have no revert or sentinel-alert evidence. CI, reviewer verdict, diff fences, soak, holds and branch protection still apply.

@hivecommons-hive

Copy link
Copy Markdown
Contributor

@clubanderson this PR is held at stage/071-needs-author and the hive will not merge it yet.

Failing checks:

  • relative links and anchors resolve

Next: the hive does not push to your branch. Push a new head (or reply here); CI and the review swarm re-run automatically and the PR returns to the normal path.

Generated by changelog-fragment-guard from the PR title (#5675).
Edit the wording freely, or replace this file with the no-changelog
label if the change is not user-visible.

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Signed-off-by: clubanderson <407614+clubanderson@users.noreply.github.com>
@hivecommons-hive

Copy link
Copy Markdown
Contributor

@clubanderson this PR is held at stage/071-needs-author and the hive will not merge it yet.

Failing checks:

  • relative links and anchors resolve

Next: the hive does not push to your branch. Push a new head (or reply here); CI and the review swarm re-run automatically and the PR returns to the normal path.

@hivecommons-hive

Copy link
Copy Markdown
Contributor

stage 080-awaiting-merge-admission β†’ 071-needs-author: optional-check-failing:relative links and anchors resolve

…tion

Signed-off-by: Andrew Anderson <andy@clubanderson.com>
@hivecommons-hive

Copy link
Copy Markdown
Contributor

@clubanderson this PR is held at stage/071-needs-author and the hive will not merge it yet.

Why:

  • the branch conflicts with the base and needs a rebase

Next: the hive does not push to your branch. Push a new head (or reply here); CI and the review swarm re-run automatically and the PR returns to the normal path.

@hivecommons-hive

Copy link
Copy Markdown
Contributor

stage 080-awaiting-merge-admission β†’ 071-needs-author: conflicting

…etry #15307 alongside duplicate hold)

Signed-off-by: Andrew Anderson <andy@clubanderson.com>
@hivecommons-hive
hivecommons-hive Bot merged commit 6c64b18 into v5 Oct 29, 2026
102 of 104 checks passed
@kubestellar-prow
kubestellar-prow Bot deleted the fix/dispatch-skip-issue-with-open-pr branch October 29, 2026 20:40
@hivecommons-hive

Copy link
Copy Markdown
Contributor
Evidence bundle `#155060a0c86f` sha256:2f81a689dcb9412e9252994759895990ac14572bceed77cc62a39df91cbd7f13 β€” download from the dashboard or `hivectl review evidence #15506`.

@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 0a0c86f.

@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

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/XL Denotes a PR that changes 500-999 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Dispatch opened a second PR (#15473) for #15469 while #15470 already covered it; duplicate rode the merge train

1 participant