Skip to content

Add live Slack notifications to release workflow#4046

Open
Wauplin wants to merge 5 commits intomainfrom
release-slack-notifications
Open

Add live Slack notifications to release workflow#4046
Wauplin wants to merge 5 commits intomainfrom
release-slack-notifications

Conversation

@Wauplin
Copy link
Copy Markdown
Contributor

@Wauplin Wauplin commented Apr 3, 2026

Note from myself: follow-up on the on-going work to streamline huggingface_hub releases. This PR adds a Slack Bot that will send messages to #hub-client-library-internal with status of each step. This will make it more straightforward to retrieve URLs and generated messages.

I have added SLACK_BOT_TOKEN as a secret and SLACK_CHANNEL_ID as a variable in this repo settings.

Bot will be this one: https://api.slack.com/apps/A0AQJJYFFBM/general


Summary

  • Posts a Slack message when a release starts (with type emoji: 🏗️ pre-release, 🚢 release, 🐛 patch)
  • Each sub-job posts a threaded reply on completion with ✅/❌ status and relevant links:
    • PyPI → links to huggingface-hub / hf history
    • Release notes → links to GitHub releases page
    • Slack announcement → uploads the generated .md file as a thread attachment
    • Downstream testing → links to compare URL per repo (transformers, datasets, diffusers, sentence-transformers)
    • Post-release → links to the version bump PR
    • CLI skill sync → status
  • A final slack-complete job updates the original message ("started" → "completed"/"failed") and adds a ✅ or ❌ reaction
  • All Slack steps use continue-on-error: true — Slack issues never block the release
  • Skipped during dry runs and when message_ts is empty (Slack init failed)

Setup required

  1. Secret SLACK_BOT_TOKEN — Slack Bot User OAuth Token with scopes: chat:write, reactions:write, files:write
  2. Repository variable SLACK_CHANNEL_ID — target Slack channel ID
  3. Invite the bot to the channel

🤖 Generated with Claude Code


Note

Medium Risk
Modifies the release GitHub Actions workflow to add Slack messaging and a new completion job; while Slack steps are non-blocking, changes touch the release pipeline and could affect execution flow/needs outputs if misconfigured.

Overview
Adds live Slack notifications to the release.yml workflow: the prepare job now posts a “release started” message and exports its message_ts for threading.

Each major job (PyPI publishes, release notes, prerelease Slack announcement generation incl. file upload, downstream RC branches, post-release bump PR, and CLI skill sync) posts a ✅/❌ threaded status update, and a new slack-complete job updates the original message with final success/failure plus a reaction. The post-release step also captures the created PR URL for linking in Slack, and the workflow docs now list required Slack secret/variable.

Written by Cursor Bugbot for commit 91d22cd. This will update automatically on new commits. Configure here.

Post a single message to Slack when a release starts, then update it
with threaded replies as each sub-job completes (PyPI publish, release
notes, downstream testing, post-release PR, CLI skill sync). A final
job updates the original message with overall success/failure status
and adds an emoji reaction.

Each thread reply includes relevant links (PyPI history, GitHub
releases, downstream compare URLs, PR links). The Slack announcement
file is uploaded as a thread attachment.

All Slack steps use continue-on-error so failures never block the
release. Notifications are skipped during dry runs.

Requires: SLACK_BOT_TOKEN secret (chat:write, reactions:write,
files:write scopes) and SLACK_CHANNEL_ID repository variable.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@bot-ci-comment
Copy link
Copy Markdown

bot-ci-comment bot commented Apr 3, 2026

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

@Wauplin Wauplin marked this pull request as ready for review April 3, 2026 12:49
- Include needs.prepare.result in the failure detection loop. If prepare
  fails after posting the Slack message (e.g. during git push), message_ts
  is set but nothing was published — without this check, the final message
  would incorrectly report success.
- Add continue-on-error: true to match every other Slack step, so a Slack
  API failure doesn't cause the workflow to report as failed.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

In bash double quotes, \n is a literal backslash + n, not a newline.
When passed through jq --arg, Slack receives the two-character string
\n instead of a newline, breaking the block quote rendering.

Use $'\n' concatenation to inject a real newline character.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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