Repository navigation
π fix: post the already-landed issue note only after the close succeeds - #15709
Conversation
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>
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
hive/awaiting-ci: CI pending β sweep will merge when green. π Hive Agent: β hive: agent=scanner backend=copilot model=claude-fable-5.1 copilot=1.0.88 |
Open PR overlap checkBase branch: Conflicts are checked with every PR merged onto the current tip of
|
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
|
Thank you for your contribution! Your PR has been merged. We'd love to hear how your experience was: share feedback |
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