Skip to content

Reject a suppression that cites what the same change closes - #725

Merged
nockawa merged 1 commit into
mainfrom
closing-keywords-companion
Aug 9, 2026
Merged

nockawa merged 1 commit into
mainfrom
closing-keywords-companion

Conversation

@nockawa

@nockawa nockawa commented Aug 8, 2026 •

Copy link
Copy Markdown
Collaborator

IGNORE_CLOSED_ISSUE has a blind spot it cannot see out of. It asks whether a suppression's issue is closed right now. On a PR that closes #N and leaves an [Ignore("#N")] in the tree, #N is still open while the PR is open — so the check passes, the merge closes it, and the identical check reddens main minutes later. Green before merge, red after, with no run in between that could have caught it.

Measured, not hypothetical: PR #721 shipped its #718 fix with ViewCreatedBeforeTheSpawns_ConvergesWithOneCreatedAfter still quarantined against it. invariants passed on the PR and failed on main at 22:32.

The fix

closing-keywords already extracts the exact set GitHub will act on, from the two surfaces GitHub itself parses. It now hands that set to the lint via --closing, which rejects any [Ignore] citing one.

Replayed against the real case:

#721's actual tree, closing set "716 648 718"  ->  SystemInputViewLivenessTests.cs:104
                                                   [Ignore] cites #718, which this change CLOSES
today's tree, same closing set                 ->  clean

The job gains a checkout it did not need before. This is the only place in CI holding both facts at once — the closing set, and the tree as it will be after the merge (pull_request checks out the merge ref). invariants has neither: it runs on push too, and has no PR to read a set from.

Why [Ignore] only

The first draft covered Quarantine as well, on the reasoning that the header contract is identical — both require an OPEN issue. It immediately flagged ChaosStressTests.CreateDeleteRecreate_RapidLifecycle:

// QUARANTINE (#696), retargeted from #695. ... (and possibly
// #716's mechanism, a writer inserting into a merge-detached node). Roughly 1 run in 4.

#696 is the target, #695 is history, #716 is a hypothesis. Nothing distinguishes them without a convention that does not exist, and that comment is the best-documented suppression in the suite — a lint that cries wolf on good prose gets switched off. [Ignore]'s reason string is a single field whose #N is the blocker by construction, so the check covers the half it can be precise about.

The gap that leaves is filed as #724: quarantine has no machine-readable target, which is also why nothing today catches a quarantine whose issue has closed.

Tests

Seven cases. The load-bearing ones are not the positive:

  • test_no_closing_set_is_a_no_op — without --closing the check must stay silent, or every ordinary run breaks
  • test_suppression_citing_an_unrelated_issue_passes — a tree full of [Ignore]s is normal
  • test_a_substring_number_is_not_a_match — #71 must not match #718
  • test_quarantine_prose_is_deliberately_out_of_scope — pins the narrowing above, using the real comment

Neutering the check turns three of them red. 39/39 green.

Note

This PR's own title carries no #N, deliberately. project-sync.yml's update-on-merge takes the first #N in the PR title and runs gh issue close on it unconditionally — a third closing path, independent of keywords, that neither closing-keywords nor this new check can see. It is what closed issue #722 an hour after I filed it (an intervening word, because the keyword itself was the mistake here — this PR narrates history, it does not resolve anything) (PR #723 was titled #722 Repoint the quarantined view test…, following the repo's #issue-prefixed convention). #722 has been reopened. Worth deciding separately whether the title should imply completion at all.

🤖 Generated with Claude Code

https://claude.ai/code/session_01FE5GUBSF5D1DhyPAuTBbYk

IGNORE_CLOSED_ISSUE has a blind spot it cannot see out of. It asks whether a suppression's issue is closed RIGHT NOW. On a PR that closes #N and leaves an [Ignore("#N")] in the tree, #N is still open while the PR is open — so the check passes, the merge closes #N, and the identical check reddens main minutes later. Green before merge, red after, with no run in between that could have caught it.

Measured, not hypothetical: PR #721 shipped its #718 fix with ViewCreatedBeforeTheSpawns_ConvergesWithOneCreatedAfter still quarantined against it. invariants passed on the PR and failed on main at 22:32.

The merge gate's closing-keywords job already extracts the exact set GitHub will act on, from the two surfaces GitHub itself parses. It now hands that set to the lint, which rejects any [Ignore] citing one. Replayed against #721's actual tree it flags the real violation and nothing else; against today's tree with the same closing set it is clean.

The job gains a checkout, which it did not need before. This is the only place in CI holding both facts at once — the closing set, and the tree as it will be after the merge, since pull_request checks out the merge ref. invariants has neither: it runs on push too and has no PR to read a set from.

[Ignore] only, and the narrowing is the interesting part. Its #N lives in the reason string, one field whose reference IS the blocker. Quarantine records its issue in free prose that legitimately names several: CreateDeleteRecreate_RapidLifecycle is quarantined against #696 while its comment also names #695 (the livelock it was retargeted from) and #716 (a suspected mechanism). The first draft flagged that comment — which is the best-documented suppression in the suite — so the check covers the half it can be precise about. The gap that leaves is filed as #724: quarantine has no machine-readable target, which is also why nothing today catches a quarantine whose issue has closed.

Seven self-tests, including the two that keep it honest: without --closing the check must stay silent, and a suppression citing an unrelated issue must pass. Neutering the check turns three of them red. 39/39 green.
@nockawa nockawa closed this Aug 8, 2026
@nockawa nockawa reopened this Aug 8, 2026
@nockawa
nockawa merged commit 4bd3734 into main Aug 9, 2026
32 of 36 checks passed
@nockawa
nockawa deleted the closing-keywords-companion branch August 9, 2026 00:03
nockawa added a commit that referenced this pull request Aug 9, 2026
update-on-merge ran `gh issue close` on the first #N in the PR TITLE, unconditionally. That made the title a third way to close an issue, alongside a closing keyword in the squash message and one in the PR description — and it is the one nobody designed. It collides head-on with this repo's own convention of prefixing a title with the issue a change RELATES to. A leading #N means "about", not "completes".

It closed issue #722 minutes after that issue was filed to track REMAINING work, because PR #723 was titled "#722 Repoint the quarantined view test ...". That turned an [Ignore("#722")] into a reference to a closed issue and reddened main. Neither the closing-keywords gate nor the suppression companion from #725 could see it: both read keywords, and this path used none. Three mechanisms, one gate.

Closing is now GitHub's job alone, from an explicit Closes #N. One mechanism, and it is the one already guarded.

The board still moves, which is the half worth keeping — and it is now more correct than before, not merely preserved. It reads the issue's ACTUAL state instead of assuming the merge completed it:

  closed -> Done   (a keyword or a human closed it; update-status-on-close usually does this via the
                    issues.closed event, and doing it here too covers an issue closed BEFORE the merge,
                    where no such event fires at merge time)
  open   -> Todo   (its PR is no longer open, so by the three-state lifecycle it is neither Done nor
                    In Progress — "an issue stays In Progress while its PR is open")

So a title that merely names a related issue now parks it in Todo rather than claiming Done for work that did not happen. That open -> Todo transition is exactly the correction I had to apply by hand to #582 and #688 earlier today.

Verified: no live `gh issue close` remains, the mutation binds $TARGET_STATUS, `bash -n` clean, and the branch simulated both ways — closed gives Done, open gives Todo.
nockawa added a commit that referenced this pull request Aug 9, 2026
update-on-merge ran `gh issue close` on the first #N in the PR TITLE, unconditionally. That made the title a third way to close an issue, alongside a closing keyword in the squash message and one in the PR description — and it is the one nobody designed. It collides head-on with this repo's own convention of prefixing a title with the issue a change RELATES to. A leading #N means "about", not "completes".

It closed issue #722 minutes after that issue was filed to track REMAINING work, because PR #723 was titled "#722 Repoint the quarantined view test ...". That turned an [Ignore("#722")] into a reference to a closed issue and reddened main. Neither the closing-keywords gate nor the suppression companion from #725 could see it: both read keywords, and this path used none. Three mechanisms, one gate.

Closing is now GitHub's job alone, from an explicit Closes #N. One mechanism, and it is the one already guarded.

The board still moves, which is the half worth keeping — and it is now more correct than before, not merely preserved. It reads the issue's ACTUAL state instead of assuming the merge completed it:

  closed -> Done   (a keyword or a human closed it; update-status-on-close usually does this via the
                    issues.closed event, and doing it here too covers an issue closed BEFORE the merge,
                    where no such event fires at merge time)
  open   -> Todo   (its PR is no longer open, so by the three-state lifecycle it is neither Done nor
                    In Progress — "an issue stays In Progress while its PR is open")

So a title that merely names a related issue now parks it in Todo rather than claiming Done for work that did not happen. That open -> Todo transition is exactly the correction I had to apply by hand to #582 and #688 earlier today.

Verified: no live `gh issue close` remains, the mutation binds $TARGET_STATUS, `bash -n` clean, and the branch simulated both ways — closed gives Done, open gives Todo.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant