Skip to content

Add post-release smoke tests to release workflow#760

Open
rajatarya wants to merge 7 commits intomainfrom
rajat/add-smoke-test-to-release
Open

Add post-release smoke tests to release workflow#760
rajatarya wants to merge 7 commits intomainfrom
rajat/add-smoke-test-to-release

Conversation

@rajatarya
Copy link
Copy Markdown
Collaborator

@rajatarya rajatarya commented Mar 28, 2026

Summary

  • Adds a smoke-test job to release.yml that runs after PyPI publish
  • Validates the released hf-xet version end-to-end against the real Hub (repos + buckets)
  • Sends Slack notifications on success/failure with links to logs
  • Includes a temporary test-smoke-test.yml for validating the setup before merge (will be deleted)

Secrets required

Secret Purpose
HF_SMOKE_TEST_TOKEN HF write token (bot account) for creating test repos/buckets
SLACK_SMOKE_TEST_WEBHOOK_URL Slack incoming webhook for alerts

Testing plan

  • Create HF bot account + fine-grained write token
  • Add HF_SMOKE_TEST_TOKEN to repo secrets
  • Create Slack incoming webhook, add SLACK_SMOKE_TEST_WEBHOOK_URL to repo secrets
  • Run "Test: Smoke test" workflow from Actions tab on this branch with a known-good version (e.g. 1.4.0)
  • Verify smoke tests pass and Slack success message arrives
  • Force a failure (e.g. bad version) to verify Slack failure message
  • Delete test-smoke-test.yml before merging

🤖 Generated with Claude Code


Note

Medium Risk
Adds new post-release automation that gates on PyPI propagation and exercises real Hub operations using privileged secrets, so failures or misconfiguration could break the manual release workflow and leak/overuse credentials.

Overview
Adds a post-PyPI release validation pipeline to .github/workflows/release.yml: wait for the published hf_xet version to appear on PyPI, then run cross-platform smoke tests (Ubuntu/macOS/Windows) against the released package, followed by Slack notifications on success/failure (including which platforms failed and a link to the run).

Updates scripts/smoke_tests/test_upload_download.py to accept an explicit --namespace so smoke tests can run under an org/user namespace (defaulting to the token owner), aligning with the workflow’s use of a dedicated bot token.

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

rajatarya and others added 5 commits March 27, 2026 18:11
Adds a smoke-test job that runs after PyPI publish to validate the
released hf-xet version end-to-end against the real Hub. Tests both
repo and bucket upload/download paths with SHA-256 integrity checks.
Includes Slack notifications on success/failure.

Also adds a temporary standalone test-smoke-test.yml workflow to
validate the setup before merging (to be deleted before merge).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Allows testing the smoke test job and Slack notifications from the PR
without needing the workflow on the default branch for workflow_dispatch.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The smoke test token doesn't have repo creation rights under the
personal account. Add --namespace flag to the test script and default
to xet-team org in CI workflows.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Smoke tests and Slack notifications validated successfully via PR trigger.
The release.yml smoke-test job is the permanent home for this functionality.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@rajatarya rajatarya marked this pull request as ready for review April 1, 2026 22:18
@rajatarya rajatarya requested review from XciD and seanses April 1, 2026 22:18
- Pin actions to commit SHAs (checkout, setup-uv, slack-github-action)
- Expand OS matrix to ubuntu, macos, windows (run in parallel)
- Replace uv pip compile with PyPI JSON API for availability check
- Add run URL to success Slack notification
- Single Slack notification after all platforms complete, with failed
  platform names on failure (via GitHub API job query)

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

rajatarya commented Apr 2, 2026

Addressed all review feedback:

  1. Run URL in success notification — success Slack message now includes a link to the workflow run
  2. Expanded OS matrix — smoke tests now run on ubuntu-latest, macos-latest, and windows-latest in parallel
  3. Pinned actions to commit SHAsactions/checkout, astral-sh/setup-uv, and slackapi/slack-github-action all pinned (SHAs sourced from 🔒 Pin GitHub Actions to commit SHAs #772)
  4. PyPI JSON API — replaced uv pip compile check with curl -sf "https://pypi.org/pypi/hf_xet/$VERSION/json"

Additional improvements:

  • Single Slack notification — one message after all 3 platform jobs complete instead of per-platform
  • On failure, the message lists which specific platforms failed (queried via GitHub API)
  • Added shell: bash to run steps for Windows compatibility
  • Removed the temporary test-smoke-test.yml workflow (validated successfully)
  • Separate PyPI wait jobwait-for-pypi polls once on a single runner, then all 3 platform smoke tests start simultaneously once the package is available

The wait-for-pypi job polls PyPI once on a single runner, then all 3
platform smoke tests start in parallel once the package is available.

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.

}

- name: Notify Slack on success
if: ${{ needs.smoke-test.result == 'success' }}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

No Slack notification when smoke tests are skipped

Medium Severity

The smoke-test-notify job only handles needs.smoke-test.result values of 'failure' and 'success'. If wait-for-pypi fails (e.g., the package never appears on PyPI within 15 minutes), the smoke-test job is skipped, producing a result of 'skipped'. Neither notification step fires, and the team receives no Slack alert that post-release validation didn't actually run. The same silent gap occurs if the smoke tests are cancelled. This means a release can complete with zero smoke test coverage and zero notification.

Additional Locations (1)
Fix in Cursor Fix in Web

run: |
VERSION="${{ steps.version.outputs.version }}"
./scripts/smoke_tests/run.sh --hf-xet-version "$VERSION" --namespace xet-team
./scripts/smoke_tests/run.sh --hf-xet-version "${{ needs.wait-for-pypi.outputs.version }}" --namespace xet-team
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Running "run.sh" in bash on Windows -- worth triggering a test in this PR

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.

2 participants