Skip to content

πŸ› github: keep closing keywords on Hive/ClankeR fix PRs - #10826

Merged
clubanderson merged 6 commits into
v5from
fix/clanker-pr-closing-keywords
Oct 6, 2026
Merged

clubanderson merged 6 commits into
v5from
fix/clanker-pr-closing-keywords

Conversation

@clubanderson

@clubanderson clubanderson commented Oct 6, 2026 •

Copy link
Copy Markdown
Member

Root cause

There were two related paths that produced non-closing PR bodies:

  1. Hosted/scanner bot path: The scanner policy asks for Closes #N in src/pkg/policies/defaults/scanner-automerge.md:133, but src/pkg/github/pr_request_claims.go called humanFiledBugReason from validatePRRequestClaims and rewrote human-filed bug Closes/Fixes/Resolves #N references to non-closing Refs #N. This is what happened in πŸ› fix(rotation): race-free stale-lock takeover in codex_reset_redeemΒ #10778 (Refs #10774 β€” closing keyword withheld ... human-filed bug ...). After merge, src/scripts/comment-merged-refs.sh posted the hive-post-merge-refs-sweep question on πŸ› codex_reset_redeem: stale-lock takeover race can redeem twice with different idempotency keysΒ #10774, and then the normal reporter-confirmation gate asked the reporter to confirm anyway.
  2. Contributor/ClankeR lane: src/pkg/dashboard/contribute_task_prompt.go (artifact trailer instruction introduced in 8b267ad2f9) carried Hive-Run/plan/spec trailer guidance but did not include the hosted scanner closing-keyword instruction. Contributor PRs intentionally use raw gh pr create under the contributor identity, so they also bypassed the hosted hive-open-pr body checks.

Maintainer decision for this fix: PR bodies should keep Closes #N / Fixes #N; reporter confirmation belongs in Hive's issue close/verify path, not in a pre-merge PR-body rewrite that hides GitHub's closing relationship.

User-visible impact

Refs #N does more than leave the issue open: GitHub's issue list and issue sidebar show no linked pull request. The maintainer screenshot of is:issue state:open label:hive/likely-done showed #10820, #10795, #10774, and #10773 with no PR link icon despite corresponding merged PRs. Closing keywords (Fixes/Closes/Resolves) on PRs targeting the default branch are what populate GitHub's closingIssuesReferences, sidebar link, and issue-list PR icon.

Fix

  • Stop PR request claim validation from downgrading human-filed bug closing keywords to Refs #N; tracker/epic and delegated-work downgrades remain.
  • Keep humanFiledBugReason for CloseIssue, so reporter-confirmation still leaves human-filed bugs open when needed after merge/direct close.
  • Update hive-open-pr, labels/control-signal docs, and CONTRIBUTING to describe reporter confirmation as an issue-close gate instead of a PR-body rewrite.
  • Add a contributor prompt fragment telling ClankeR agents to include Closes #N / Fixes #N when targeting the default branch.
  • Add a contributor-mode gh pr create post-check in bin/gh-wrapper.sh: when the current task file identifies an issue, the PR targets the default branch (or leaves base implicit), and the body lacks an existing closing keyword, append Closes #N without duplicating an existing Fixes/Closes/Resolves line.
  • Together, this restores linked-PR metadata for every issue-backed agent lane: hosted scanner/App-bot PRs keep their closing keywords, and ClankeR/contributor PRs are prompted and post-checked before gh pr create.
  • Add table-driven Go coverage for the body post-check and PR claim validation changes.

Before/after linkage check

Before, affected PRs had empty closingIssuesReferences:

$ gh pr view 10778 --repo hivecommons/hive --json closingIssuesReferences --jq '.closingIssuesReferences'
[]
$ gh pr view 10819 --repo hivecommons/hive --json closingIssuesReferences --jq '.closingIssuesReferences'
[]
$ gh pr view 10823 --repo hivecommons/hive --json closingIssuesReferences --jq '.closingIssuesReferences'
[]

Known-good PRs with closing keywords populate the same field, which is the expected after-fix behavior for future scanner and ClankeR fix PRs:

$ gh pr view 10810 --repo hivecommons/hive --json closingIssuesReferences --jq '[.closingIssuesReferences[].number]'
[10682]
$ gh pr view 10798 --repo hivecommons/hive --json closingIssuesReferences --jq '[.closingIssuesReferences[].number]'
[10753,10754,10755,10756,10757,10758]

Evidence

PR Author Base Body reference closingIssuesReferences
#10823 mendezr v5 Refs #10816 ... empty
#10822 mendezr v5 Refs #10773 ... empty
#10815 mendezr v5 Refs #10771 ... empty
#10705 mendezr v5 Refs #10686 ... empty
#10642 mendezr v5 Fixes #10626 [10626]
#10636 mendezr v5 Fixes #10627. [10627]
#10778 hivecommons-hive[bot] v5 watcher-rewritten Refs #10774 ... human-filed bug ... empty
#10819 hivecommons-hive[bot] v5 Refs #10773 (remaining: #10817, #10818 ...) empty
#10798 hivecommons-hive[bot] v5 Closes #10753 ... Closes #10758 populated
#10779 hivecommons-hive[bot] v5 Closes #10599 [10599]
#10810 hivecommons-hive[bot] v5 Closes #10682 [10682]

Validation

  • gofmt -l src/pkg/github/pr_request_claims.go src/pkg/github/pr_request_claims_test.go src/pkg/dashboard/contribute_task_prompt.go src/pkg/dashboard/contribute_pr_closing_test.go
  • bash -n bin/gh-wrapper.sh
  • git diff --check
  • Go tests were not run locally because this repository's AGENTS.md requires CI as the test verdict for agents.

Fixes #10825

@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 danathar 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 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. labels Oct 6, 2026
@github-actions

github-actions Bot commented Oct 6, 2026

Copy link
Copy Markdown
Contributor

Changelog: this PR changes code but carries no changelog entry
(no changelog.d/ fragment and no CHANGELOG.md edit).

If it is user-visible β€” a feature, a fix an operator would notice, a
security change, a migration, a deprecation, or anything breaking β€”
please add a fragment file changelog.d/<category>-<pr-or-slug>.md
containing exactly your entry (see changelog.d/README.md; the
category is one of added/changed/deprecated/fixed/security). Please
do not append to CHANGELOG.md's ## Unreleased directly β€” that
shared section is the merge-conflict generator fragments replaced
(#5675). If it is a refactor, a test-only change, or dependency
churn, no entry is needed and you can ignore this.

This is a reminder, not a gate; it never blocks a merge.

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>
@github-actions

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

clubanderson and others added 3 commits October 6, 2026 08:03
Signed-off-by: Andrew Anderson <andy@clubanderson.com>
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>
@clubanderson clubanderson changed the title πŸ› contribute: make clanker PRs carry Closes/Fixes for their issue πŸ› github: keep closing keywords on Hive/ClankeR fix PRs Oct 6, 2026
@hivecommons-hive

Copy link
Copy Markdown
Contributor

Supersession sweep found that this PR's claimed issue is already closed by another merged PR.

  • Claimed issue: hive#10816
  • Closing PR: #10823

A different merged PR closed the claimed issue. Leaving this contributor PR open for a human to review.

This comment is edited in place by the supersession sweep; it is not duplicated.

@clubanderson
clubanderson merged commit 6a9714c into v5 Oct 6, 2026
65 of 66 checks passed
@kubestellar-prow
kubestellar-prow Bot deleted the fix/clanker-pr-closing-keywords branch October 6, 2026 13:33
@github-actions

github-actions Bot commented Oct 6, 2026

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/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.

πŸ› Hive/ClankeR PRs omit or suppress Closes/Fixes keywords so issues stay open after merge

1 participant