Harden publish workflow recovery, notifications, and dispatch guard - #199
Conversation
|
👋 Hello @glenn-jocher, thank you for submitting a
For more guidance, please refer to our Contributing Guide. Don't hesitate to leave a comment if you have any questions. Thank you for contributing to Ultralytics! 🚀 |
UltralyticsAssistant
left a comment
There was a problem hiding this comment.
🔍 PR Review
Made with ❤️ by Ultralytics Actions
The workflow changes generally improve rerun tolerance and notification accuracy. One issue needs attention: the new manual recovery override ignores the existing pypi dispatch input, so any manual run on main triggers the publish path.
💬 Posted 1 inline comment
| import os | ||
| from actions.utils import check_pypi_version | ||
| local_version, online_version, publish = check_pypi_version() | ||
| publish = publish or os.environ.get("GITHUB_EVENT_NAME") == "workflow_dispatch" # manual recovery re-run |
There was a problem hiding this comment.
💡 MEDIUM: This makes every manual dispatch on main set increment=True, even when the workflow_dispatch pypi input is left false/unchecked. Because that input is the only manual guard exposed by the workflow, an accidental dispatch would still proceed through tag/release creation, PyPI publish with skip-existing, SBOM upload, and failure notifications. Please include the dispatch input in this override so only an explicit recovery/publish request bypasses the PyPI version check.
|
Merged — thank you @glenn-jocher! 🚀 “Success is not final, failure is not fatal: it is the courage to continue that counts.” — Winston Churchill This PR brings that spirit directly into the PyPI release workflow by making releases safer, rerunnable, and easier to recover from after partial failures. The added safeguards around Great work strengthening the release pipeline for the team and community! 🙌 |
🛠️ Summary
Ports three robustness fixes to
publish.ymlthat came out of adversarial review rounds on ultralytics/template#91. The release pipeline previously had no recovery path after a partial failure, and Slack could report success before the pipeline actually finished.1. Failed releases can now be recovered via
workflow_dispatchPreviously, once the tag was pushed, any downstream failure (build, PyPI upload, SBOM) left the release unrecoverable: a re-run hit
git tag -aon the existing tag and thecheckjob died. Now:workflow_dispatchalways setsincrement=True(manual recovery re-run)git ls-remote)gh release view), healing the tag-pushed-but-no-release stateskip-existing: trueso re-runs tolerate already-uploaded dists--clobberso re-runs can overwriteA partially failed release can be re-run from any point and completes only what's missing.
2. Slack success can no longer fire prematurely
notifynow includessbominneedsand in the success/failure conditions, so the ✅ message reflects the entire pipeline rather than racing the SBOM job.3.
workflow_dispatchcan no longer release a non-main commitThe
checkjob now requiresgithub.ref == 'refs/heads/main'; previously a dispatch from a feature branch could tag and release a commit that never landed on main.🧪 Testing
🛠️ PR Summary
Made with ❤️ by Ultralytics Actions
🌟 Summary
Improves the PyPI release workflow to be safer, recoverable, and more reliable on reruns 🚀
📊 Key Changes
mainbranch for theultralytics/mkdocsrepo and authorized actor 🔒PYPI_DISPATCHinput 🛠️skip-existing: trueto tolerate reruns after partial failures 📦--clobber, allowing existing SBOM files to be replaced on reruns 📄🎯 Purpose & Impact
mainbranches 🌿