From b0f22f11307920d3ee55ebc258982e79af9f808e Mon Sep 17 00:00:00 2001 From: rcourtman Date: Thu, 11 Jun 2026 15:10:33 +0100 Subject: [PATCH] Stop posting retest boilerplate on maintainer issue reopens The retest-comment workflow fired on 'reopened' as well as 'opened', and canPostRetestComment gated on the issue author's association, not the reopen actor's. Since non-collaborator reporters cannot reopen maintainer-closed issues, a reopened event is in practice always a deliberate maintainer decision, and the bot would post version-retest boilerplate that contradicts the maintainer's own comment while planting the needs-retest auto-close marker on an issue they chose to keep open (seen on #1471). Restrict the trigger and the guard to 'opened' and pin the reopened skip with a test. --- .github/scripts/issue-version-triage.cjs | 7 +++++-- .github/scripts/issue-version-triage.test.cjs | 19 +++++++++++++++++++ .../issue-version-retest-comment.yml | 1 - 3 files changed, 24 insertions(+), 3 deletions(-) diff --git a/.github/scripts/issue-version-triage.cjs b/.github/scripts/issue-version-triage.cjs index 6ad4d80b67..81ee6be658 100644 --- a/.github/scripts/issue-version-triage.cjs +++ b/.github/scripts/issue-version-triage.cjs @@ -200,10 +200,13 @@ function buildRetestCommentBody(reportedVersion, latestVersion) { } function canPostRetestComment(issue, action) { + // "opened" only: non-collaborator reporters cannot reopen maintainer-closed + // issues, so a "reopened" event is a deliberate maintainer decision made with + // context. Posting retest boilerplate there contradicts the maintainer and + // plants the auto-close marker on an issue they chose to keep open. const authorAssociation = String(issue.author_association || "").toUpperCase(); return ( - (action === "opened" || action === "reopened") && - !MAINTAINER_AUTHOR_ASSOCIATIONS.has(authorAssociation) + action === "opened" && !MAINTAINER_AUTHOR_ASSOCIATIONS.has(authorAssociation) ); } diff --git a/.github/scripts/issue-version-triage.test.cjs b/.github/scripts/issue-version-triage.test.cjs index b659bcdbc7..ad0e7ea31e 100644 --- a/.github/scripts/issue-version-triage.test.cjs +++ b/.github/scripts/issue-version-triage.test.cjs @@ -145,6 +145,25 @@ test("postRetestComment comments once for older non-maintainer bug reports", asy ); }); +test("postRetestComment skips reopened issues", async () => { + const { github, calls } = createGithub({ latestVersion: "6.0.1" }); + const issue = { + number: 1471, + title: "Disk temperature at 0°C", + body: "## Feedback type\nBug / regression\n\n## Pulse version\n5.1.31\n", + labels: [], + author_association: "NONE", + }; + + await triage.postRetestComment({ + github, + context: createContext({ action: "reopened", issue }), + core: createCore(), + }); + + assert.equal(calls.createComment.length, 0); +}); + test("postRetestComment skips maintainer-authored issues", async () => { const { github, calls } = createGithub({ latestVersion: "6.0.1" }); const issue = { diff --git a/.github/workflows/issue-version-retest-comment.yml b/.github/workflows/issue-version-retest-comment.yml index b867681a2d..3131d5d4eb 100644 --- a/.github/workflows/issue-version-retest-comment.yml +++ b/.github/workflows/issue-version-retest-comment.yml @@ -4,7 +4,6 @@ on: issues: types: - opened - - reopened permissions: contents: read