[Release] Make release-notes job fail loudly on bad model/empty output#4138
Conversation
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Wauplin
left a comment
There was a problem hiding this comment.
✔️
(will check in live if it's ok)
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 15de7ff. Configure here.
| check_opencode_model(model) | ||
| except RuntimeError as e: | ||
| print(f"Error: {e}", file=sys.stderr) | ||
| return 1 |
There was a problem hiding this comment.
Uncaught CalledProcessError escapes RuntimeError-only handler
Medium Severity
check_opencode_model uses subprocess.run(..., check=True), which raises subprocess.CalledProcessError if opencode models exits non-zero. The caller in main() only catches RuntimeError, and CalledProcessError is not a subclass of RuntimeError — it inherits from SubprocessError. If the command fails, the exception propagates uncaught, producing a raw traceback instead of the intended clean error message with return 1.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit 15de7ff. Configure here.
|
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. |
|
This PR has been shipped as part of the v1.13.0 release. |


Summary
Follow-up to the v1.12.0.rc0 release run which created no GitHub release and cascaded into
slack-message/social-postsfailures.Root cause:
RELEASE_NOTES_MODELwas set tozai-org/GLM-5.1(missing thehuggingface/provider prefix). OpenCode prints an error but exits 0, sogenerate_release_notes.pyfinished "successfully" with a 0-byte file, the workflow fell back togh release create --generate-notes, and GitHub's auto-notes exceeded the 125k char body limit (HTTP 422). The repo variable has since been updated tohuggingface/zai-org/GLM-5.1.Changes to prevent this class of silent failure:
check_opencode_model()runsopencode modelsand errors with a clear message (listing available models) ifRELEASE_NOTES_MODELisn't present. Called before any expensive work inmain().main(), error out ifRELEASE_NOTES_<version>.mdis missing or 0 bytes.Create draft GitHub release (prerelease)step. If the generated notes file is missing, fail with an explicit error rather than creating a release with a 125k+ char body.slack-messageandsocial-postsnow emit::warning::and skip (rather than::error::+exit 1) when no release is found, so a brokenrelease-notesstep doesn't manufacture two extra red jobs.Note
Medium Risk
Medium risk because it changes the release automation workflow and adds new failure conditions that can block creating prerelease GitHub releases if note generation misbehaves.
Overview
Hardens prerelease release-note generation to fail loudly instead of silently producing empty outputs.
utils/release_notes/generate_release_notes.pynow validatesRELEASE_NOTES_MODELagainstopencode modelsbefore doing any work, and errors out if OpenCode doesn’t produce the expectedRELEASE_NOTES_<version>.mdfile or if the final output is empty.The release workflow (
release.yml) stops falling back togh release create --generate-notesfor minor prereleases, requiring a non-empty generated notes file, and updates theslack-message/social-postsjobs to skip gracefully (via afetchstep output) when no draft/prerelease release is found.Reviewed by Cursor Bugbot for commit 15de7ff. Bugbot is set up for automated code reviews on this repo. Configure here.