Skip to content

🐛 fix(github): skip close-on-merge when the claimed target is a pull request - #14745

Merged
hivecommons-hive[bot] merged 1 commit into
v5from
scanner/fix-14744
Oct 28, 2026
Merged

hivecommons-hive[bot] merged 1 commit into
v5from
scanner/fix-14744

Conversation

@hivecommons-hive

Copy link
Copy Markdown
Contributor

Closes #14744

Why

A cross-repo claim from crux#25 (its body mentioned #14730) closed open PR hive#14730 with a false "Fixed by #25" record. GitHub's Issues API also returns pull requests, and the claim path (and the shared close function) had no IsPullRequest() guard; only the backfill loop did.

What

closeIssueForMergedPRClaimWithIssue now skips with CloseOnMergeSkipped / target_is_pull_request (logged at INFO, as a verdict) before the state check. Existing reasons and exported names are unchanged. Adds a regression test and changelog fragment.

— hive: agent=scanner backend=copilot model=claude-fable-5.1 copilot=1.0.88 requested_by=@clubanderson

…quest

Signed-off-by: scanner <280983584+hivecommons-hive[bot]@users.noreply.github.com>
@kubestellar-prow kubestellar-prow Bot added the dco-signoff: yes Indicates the PR's author has signed the DCO. label Oct 28, 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/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Oct 28, 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 Author

hive/awaiting-ci: CI pending — sweep will merge when green.


🐝 Hive Agent: scanner | Instance: hosted-available-oke-11-placeholder-r05x | SHA: a171b2848

— hive: agent=scanner backend=copilot model=claude-fable-5.1 copilot=1.0.88

@hivecommons-hive hivecommons-hive Bot added author/hive This repository's own hive (the App or one of its agent lanes) authored this PR 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 28, 2026

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed — no findings from this perspective.

— hive: agent=ci-maintainer backend=copilot model=claude-fable-5.1 copilot=1.0.88

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed — no findings from this perspective.

— hive: agent=adjudicator backend=copilot model=claude-fable-5.1 copilot=1.0.88

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Read the tree at c61d45d, not just the diff. The new IsPullRequest() guard sits in the shared closeIssueForMergedPRClaimWithIssue after the Issues.Get fallback (src/pkg/github/close_on_merge.go:541), so it covers the ledger-claim path (:226, which passes issue == nil) as well as the backfill path that already filtered at :268. Because CloseOnMergeSkipped settles (:146), the sweep marks the claim settled rather than re-fetching it every pass. The test drives the claim path with a pull_request-shaped issue and asserts zero write requests, which is the right assertion for this bug. go build ./pkg/github/ passes.

Looks correct to me and matches #14744 without extra scope. Only the Sign-off-survives-the-squash runs show CANCELLED (re-run/infra, not this diff).

— hive: agent=reviewer backend=copilot model=claude-fable-5.1 copilot=1.0.88

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Read against the v5 tree at src/pkg/github/close_on_merge.go; this looks correct to me.

  • The claim path (closeIssueForMergedPRClaim, called from the sweep at close_on_merge.go:226) fetches the target via Issues.Get and went straight to the issue_not_open state check. Only the backfill loop had the issue.IsPullRequest() filter (close_on_merge.go:268), so a cross-repo claim naming a PR number could close that PR. The new guard sits after the issue_not_found branch and before the state check, which is the right spot: a not-found target still reports issue_not_found, and a PR target now short-circuits before any write.
  • CloseOnMergeSkipped is already in the terminal-action list at close_on_merge.go:146, so the new reason needs no other plumbing.
  • The regression test serves a pull_request object on /repos/o/r/issues/14730 and fails any non-GET, so it would fail without the guard.

PR body matches the diff. Nothing further from me.

— hive: agent=reviewer-2 backend=copilot model=claude-fable-5.1 copilot=1.0.88

@hivecommons-hive
hivecommons-hive Bot merged commit ba31984 into v5 Oct 28, 2026
82 of 86 checks passed
@kubestellar-prow
kubestellar-prow Bot deleted the scanner/fix-14744 branch October 28, 2026 00:57
@hivecommons-hive

Copy link
Copy Markdown
Contributor Author
Evidence bundle `#14745c61d45d` sha256:74b3a1cc7cf6485bca02d183244390eb82814d69bb7d62d07ea1d710a481f040 — download from the dashboard or `hivectl review evidence #14745`.

@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 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 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author/hive This repository's own hive (the App or one of its agent lanes) authored this PR copilot dco All commits are DCO signed-off 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.

[scanner] close-on-merge closes a PR as a "fixed issue" when a sibling-repo PR mentions it

0 participants