Skip to content

ci(release): make the Discord announcement dispatchable on its own - #289

Open
EtienneLescot wants to merge 1 commit into
mainfrom
ci/announce-release-standalone
Open

ci(release): make the Discord announcement dispatchable on its own#289
EtienneLescot wants to merge 1 commit into
mainfrom
ci/announce-release-standalone

Conversation

@EtienneLescot

@EtienneLescot EtienneLescot commented Aug 5, 2026

Copy link
Copy Markdown
Collaborator

Why

Announcing a release only ever existed as the last step of prerelease.yml and promote.yml. Both promotions so far failed before reaching it:

  • v1.8.0Merge release branch into main failed on merge conflicts
  • v1.9.0 — same step, This branch can't be rebased

Each time the announcement was skipped along with everything downstream of the failure. Recovering it meant re-running a whole promotion over an already-tagged release — which re-attempts tagging and the main merge — so nobody was going to do that for a Discord post. v1.9.0 shipped unannounced.

What this does

Wraps the existing .github/scripts/discord-release-announce.mjs in a workflow_dispatch. No change to the script, and no change to either release workflow.

The message is derived entirely from the tag and the matching milestone, so a late announcement is byte-identical to the one that would have gone out on time. That is what makes this safe to run after the fact rather than a reconstruction.

One non-obvious detail

The destination is chosen by blanking one of the two channel variables, not by the KIND input:

DISCORD_RELEASE_CHANNEL_ID: ${{ inputs.kind == 'stable' && vars.DISCORD_RELEASE_CHANNEL_ID || '' }}
DISCORD_RC_TESTING_CHANNEL_ID: ${{ inputs.kind == 'rc' && vars.DISCORD_RC_TESTING_CHANNEL_ID || '' }}

because that is what the script actually branches on — it prefers DISCORD_RC_TESTING_CHANNEL_ID whenever it is non-empty, and KIND only selects the embed's wording and colour. Setting both would post a "released" embed into the RC testing channel.

After merging

gh workflow run announce-release.yml -f tag=v1.9.0 -f kind=stable

That sends the announcement v1.9.0 never got. It is safe to re-run — the only consequence of a double dispatch is a duplicate post, and allowed_mentions is empty so nothing is pinged either way.

Not addressed here

The reason promotions keep failing at the main-sync step is separate and still open: main and the release branch accumulate the same fixes under different SHAs, so GitHub's rebase-merge replays commits already present. Worth its own change — this PR only stops one recurring casualty of it.

Announcing a release only ever existed as the final step of prerelease.yml and
promote.yml. Both promotions so far failed before reaching it — v1.8.0 on a
merge conflict, v1.9.0 on a non-rebasable sync branch — and each time the
announcement was skipped along with everything downstream of the failure.

Recovering it meant re-running a promotion over an already-tagged release,
which re-attempts tagging and the main merge; nobody was going to do that for a
Discord post, so v1.9.0 simply shipped unannounced.

This wraps the existing discord-release-announce.mjs in a workflow_dispatch and
changes nothing else. The message is derived entirely from the tag and the
matching milestone, so a late announcement is identical to the one that would
have gone out on time.

The destination is selected by blanking one of the two channel variables rather
than by KIND, because that is what the script actually branches on: it prefers
DISCORD_RC_TESTING_CHANNEL_ID whenever it is non-empty.
@coderabbitai

coderabbitai Bot commented Aug 5, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The pull request adds a manually dispatched GitHub Actions workflow. The workflow accepts a release tag, release kind, and optional message, then runs the Discord release announcement script with the required configuration.

Changes

Release announcement workflow

Layer / File(s) Summary
Manual dispatch and Discord announcement
.github/workflows/announce-release.yml
The workflow accepts release inputs, grants read-only repository access, sets up Node.js, and announces stable or RC releases on Discord.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description explains the motivation and implementation, but it omits the required template sections for change type, release impact, platform impact, and testing. Add the missing template sections and document the testing performed, including commands and environment details.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the main change: making the Discord release announcement workflow independently dispatchable.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch ci/announce-release-standalone

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/workflows/announce-release.yml:
- Line 60: Update the announcement script invocation in the workflow and the
corresponding logic in discord-release-announce.mjs to support strict mode for
manual announcements. Enable strict mode from announce-release.yml, and ensure
missing Discord configuration, channel lookup failures, and post failures exit
with a non-zero status while preserving current behavior when strict mode is not
enabled.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 2b72a33b-5ca6-48d5-bf53-2bc95d26de24

📥 Commits

Reviewing files that changed from the base of the PR and between af1ff35 and d206fa2.

📒 Files selected for processing (1)
  • .github/workflows/announce-release.yml

STABLE_TAG: ${{ inputs.tag }}
EXTRA: ${{ inputs.release_notes_extra }}
KIND: ${{ inputs.kind }}
run: node .github/scripts/discord-release-announce.mjs

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🩺 Stability & Availability | 🟠 Major | ⚡ Quick win

Fail the job when the announcement is not sent.

.github/scripts/discord-release-announce.mjs exits with status 0 when Discord configuration is missing, the channel lookup fails, or the post fails. This workflow then reports success although it sent no announcement. That recreates the silent failure that this workflow is intended to recover from.

Add a strict mode for manual announcements. In strict mode, make missing configuration and Discord API failures exit non-zero.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/announce-release.yml at line 60, Update the announcement
script invocation in the workflow and the corresponding logic in
discord-release-announce.mjs to support strict mode for manual announcements.
Enable strict mode from announce-release.yml, and ensure missing Discord
configuration, channel lookup failures, and post failures exit with a non-zero
status while preserving current behavior when strict mode is not enabled.

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