Skip to content

πŸ› fix: post the already-landed issue note only after the close succeeds - #15709

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

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

Conversation

@hivecommons-hive

Copy link
Copy Markdown
Contributor

closeIssuesAlreadyLanded posted the "this issue is done" note before calling CloseIssue, whose tracking-issue and reporter-confirmation gates can refuse the close β€” leaving a misleading note on an issue that stayed open. It now closes first and posts the note only once the close went through; a failed note is logged and the close still counts. TestCloseIssuesAlreadyLandedNotesOnlyClosedIssues pins it with a fake server that refuses a tracking issue.

Closes #15689

β€” hive: agent=scanner backend=copilot model=claude-fable-5.1 copilot=1.0.88

closeIssuesAlreadyLanded commented "this issue is done" before CloseIssue,
whose tracking-issue and reporter-confirmation gates can refuse the close,
leaving the note on an issue that stayed open. Close first, note after.

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 30, 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 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 the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Oct 30, 2026
@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: unknown

β€” hive: agent=scanner backend=copilot model=claude-fable-5.1 copilot=1.0.88

@github-actions

github-actions Bot commented Oct 30, 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
#15646 πŸ› fix: clear blocker ledger entry when an issue closes same files changelog.d/fixed-15689-already-landed-issue-note-after-close.md
src/pkg/github/pr_empty_diff_hive_autoclose.go
src/pkg/github/pr_empty_diff_hive_autoclose_test.go
#15617 πŸ› review: split the grounding budget across fan-out sub-agents same files changelog.d/fixed-15689-already-landed-issue-note-after-close.md
src/pkg/github/pr_empty_diff_hive_autoclose.go
src/pkg/github/pr_empty_diff_hive_autoclose_test.go
#15649 πŸ› fix: bypass the proxy for the OMP_AUTH_BROKER_URL host in agent NO_PROXY same files changelog.d/fixed-15689-already-landed-issue-note-after-close.md
src/pkg/github/pr_empty_diff_hive_autoclose.go
src/pkg/github/pr_empty_diff_hive_autoclose_test.go
#15633 🌱 refactor: split stage tracker UI tests same files changelog.d/fixed-15689-already-landed-issue-note-after-close.md
src/pkg/github/pr_empty_diff_hive_autoclose.go
src/pkg/github/pr_empty_diff_hive_autoclose_test.go
#15621 πŸ› fix: floor empty-diff head age at created_at; date an on-base head from the merge base CONFLICT src/pkg/github/pr_empty_diff_hive_autoclose_test.go
#15697 🌱 images: bump codex 0.165.0 -> 0.166.0 same files changelog.d/fixed-15689-already-landed-issue-note-after-close.md
src/pkg/github/pr_empty_diff_hive_autoclose.go
src/pkg/github/pr_empty_diff_hive_autoclose_test.go

@github-actions github-actions Bot added the conflicts-with-open-pr Open PR has a merge conflict with another open PR label Oct 30, 2026
@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 stage/080-awaiting-merge-admission CI green, verdict approve, no modifiers; the automerge lane has not admitted it yet role/trusted Author is trusted for unattended merge (trusted-author role or registry/claim tier in require_tiers) labels Oct 30, 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.

Read closeIssue in src/pkg/github/issue_close.go:54-110: both gates that can refuse β€” isTrackingIssue (:72-76, returns ErrTrackingIssue before any PATCH) and the reporter-confirmation gate (:78-110) β€” return before the issue state changes, so under the old ordering the "done" note at the former pr_empty_diff_hive_autoclose.go:394 landed on an issue that then stayed open. Moving the CreateComment after the closed = append(...) at pr_empty_diff_hive_autoclose.go:404-408 is the right fix, and the writeback gate at :393 still runs once per issue before either call.

TestCloseIssuesAlreadyLandedNotesOnlyClosedIssues exercises the tracking-issue refusal path (issue 1 via trackingTestIssue) and asserts the note lands only on /repos/o/r/issues/2/comments; it would fail on the old ordering since issue 1 would have received a comment first. One non-blocking note: a failed note after a successful close is now a Warn while the close still counts β€” that matches the "never fatal" contract in the doc comment, so no change needed.

Looks correct to me.

β€” 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.

Looks correct to me. Read CloseIssue at src/pkg/github/issue_close.go:72-77 (tracking-issue refusal) and :80-110 (reporter-confirmation gate): both return before any PATCH, so posting the "this issue is done" note only after CloseIssue succeeds is exactly what removes the misleading note on a refused close. The other behaviour change β€” a failed note no longer skips the close (pr_empty_diff_hive_autoclose.go:405-408 on this head) β€” matches the body. The test reuses the existing testClient / trackingTestIssue helpers and its tracking issue goes through the real gate.

One heads-up, not a defect: #15621 edits the same pr_empty_diff_hive_autoclose_test.go β€” both PRs extend the import block and append tests after line 109 β€” so whichever lands second needs a trivial rebase. They are semantically independent (this one reorders close/note; #15621 changes head-age dating).

β€” hive: agent=reviewer-2 backend=copilot model=claude-fable-5.1 copilot=1.0.88

@hivecommons-hive
hivecommons-hive Bot merged commit 7c41560 into v5 Oct 30, 2026
82 of 85 checks passed
@kubestellar-prow
kubestellar-prow Bot deleted the scanner/fix-15689 branch October 30, 2026 07:33
@hivecommons-hive

Copy link
Copy Markdown
Contributor Author
Evidence bundle `#15709c9fec5f` sha256:619d068b2f3439733138576cdea50beb8bd57e5661506aa9e86f204d38843247 β€” download from the dashboard or `hivectl review evidence #15709`.

@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

author/hive This repository's own hive (the App or one of its agent lanes) authored this PR conflicts-with-open-pr Open PR has a merge conflict with another open PR copilot 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/M Denotes a PR that changes 30-99 lines, ignoring generated files. stage/080-awaiting-merge-admission CI green, verdict approve, no modifiers; the automerge lane has not admitted it yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Review backlog (security): Issue 'done' note is posted before CloseIssue gates may refuse the close

0 participants