Skip to content

[Release] Make release-notes job fail loudly on bad model/empty output#4138

Merged
Wauplin merged 1 commit into
mainfrom
robustify-release-notes-job
Apr 24, 2026
Merged

[Release] Make release-notes job fail loudly on bad model/empty output#4138
Wauplin merged 1 commit into
mainfrom
robustify-release-notes-job

Conversation

@Wauplin

@Wauplin Wauplin commented Apr 24, 2026

Copy link
Copy Markdown
Collaborator

Summary

Follow-up to the v1.12.0.rc0 release run which created no GitHub release and cascaded into slack-message / social-posts failures.

Root cause: RELEASE_NOTES_MODEL was set to zai-org/GLM-5.1 (missing the huggingface/ provider prefix). OpenCode prints an error but exits 0, so generate_release_notes.py finished "successfully" with a 0-byte file, the workflow fell back to gh release create --generate-notes, and GitHub's auto-notes exceeded the 125k char body limit (HTTP 422). The repo variable has since been updated to huggingface/zai-org/GLM-5.1.

Changes to prevent this class of silent failure:

  • Validate the model up front: new check_opencode_model() runs opencode models and errors with a clear message (listing available models) if RELEASE_NOTES_MODEL isn't present. Called before any expensive work in main().
  • Fail fast on empty output: after the initial OpenCode call and again at the end of main(), error out if RELEASE_NOTES_<version>.md is missing or 0 bytes.
  • Drop the GitHub auto-notes fallback in the 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.
  • Downgrade downstream jobs to warnings: slack-message and social-posts now emit ::warning:: and skip (rather than ::error:: + exit 1) when no release is found, so a broken release-notes step 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.py now validates RELEASE_NOTES_MODEL against opencode models before doing any work, and errors out if OpenCode doesn’t produce the expected RELEASE_NOTES_<version>.md file or if the final output is empty.

The release workflow (release.yml) stops falling back to gh release create --generate-notes for minor prereleases, requiring a non-empty generated notes file, and updates the slack-message/social-posts jobs to skip gracefully (via a fetch step 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.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

@Wauplin Wauplin left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

✔️

(will check in live if it's ok)

@Wauplin Wauplin merged commit cb9e6a0 into main Apr 24, 2026
19 of 21 checks passed
@Wauplin Wauplin deleted the robustify-release-notes-job branch April 24, 2026 13:11

@cursor cursor 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.

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.

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

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 15de7ff. Configure here.

@bot-ci-comment

Copy link
Copy Markdown

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.

@huggingface-hub-bot

Copy link
Copy Markdown
Contributor

This PR has been shipped as part of the v1.13.0 release.

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