From ad28e6a36a1a92c2786073076f06f06a1c6bfb07 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rnar=20Snoksrud?= Date: Sat, 12 Sep 2026 04:00:33 +0200 Subject: [PATCH] discord_pr: render a reopened PR, and say so when an action is dropped MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Consumers have been sending `reopened` since novem-code/gaia#4009 landed on 2026-08-28. The composer had no branch for it, so it fell to the else and set send=false — a workflow run per reopen, saying nothing, going green. Measured on gaia, same commit two minutes apart: `closed` sent, `reopened` skipped. Three of its PRs were reopened in one day and the channel still shows all three as closed. Draft-aware like `opened`, because a PR can be reopened while it is still a draft and "please review" about a draft is what that split exists to avoid. The else now emits a ::warning:: rather than a plain log line. The job still succeeds — a missing message must not fail someone else's pipeline — but the run names the action it dropped. That branch is how this stayed broken for a fortnight after consumers started sending the event, and it will hide the next one the same way. This repo also subscribes to `reopened` for its own PRs now, which it could not usefully do until the composer knew the action. Verified by running the decision chain against every action this file subscribes to, plus an unsubscribed one: seven paths, the two new draft variants among them, and the warning on `locked`. --- .github/workflows/discord.yml | 1 + .github/workflows/discord_pr.yml | 17 ++++++++++++++++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/.github/workflows/discord.yml b/.github/workflows/discord.yml index 934803a..4f86f03 100644 --- a/.github/workflows/discord.yml +++ b/.github/workflows/discord.yml @@ -7,6 +7,7 @@ on: types: - opened # - synchronize + - reopened - closed push: branches: diff --git a/.github/workflows/discord_pr.yml b/.github/workflows/discord_pr.yml index 90d2823..6030689 100644 --- a/.github/workflows/discord_pr.yml +++ b/.github/workflows/discord_pr.yml @@ -57,6 +57,17 @@ jobs: ACTION_ICON="<:devpropened:1275356590316322858>" ACTION_TEXT="has been opened. Please review!" fi + elif [[ "$EVENT_ACTION" == "reopened" ]]; then + # Draft-aware like `opened` above: a PR can be reopened while it is + # still a draft, and saying "please review" about a draft is the + # thing the split exists to avoid. + if [[ "$PR_DRAFT" == "true" ]]; then + ACTION_ICON="📝" + ACTION_TEXT="draft has been reopened." + else + ACTION_ICON="<:devpropened:1275356590316322858>" + ACTION_TEXT="has been reopened. Please review!" + fi elif [[ "$EVENT_ACTION" == "ready_for_review" ]]; then ACTION_ICON="<:devpropened:1275356590316322858>" ACTION_TEXT="is ready for review!" @@ -70,7 +81,11 @@ jobs: ACTION_ICON="<:devprclosed:1275356586218356776>" ACTION_TEXT="has been closed!" else - echo "Unhandled event type. Exiting." + # A warning, not just a log line: this branch is how `reopened` + # stayed broken for a fortnight after consumers started sending it. + # The job still succeeds — a missing message must not fail someone + # else's pipeline — but the run now says which action it dropped. + echo "::warning::discord_pr: no message for event action '$EVENT_ACTION'; nothing sent" echo "send=false" >> "$GITHUB_OUTPUT" exit 0 fi