fix: normalize release title to "vX.Y.Z: description" format#55
Conversation
The previous check only prepended the tag when the title didn't start with it at all. If the LLM returned e.g. "v2.18.0 (Internal CI improvements)" the check passed and the title was left with parentheses instead of the colon separator. Now strips any existing tag prefix with a non-standard separator and rewrites it as "vX.Y.Z: description". Also updates the system prompt and tool description to guide the LLM toward the correct format. Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
Summary of ChangesHello @jdx, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request refines the automated release note generation process by implementing robust normalization for release titles. It ensures that all generated release titles adhere to a consistent "vX.Y.Z: description" format, regardless of the initial output from the language model. This change improves the reliability and uniformity of release titles, while also guiding the LLM to produce more compliant output from the start. Highlights
Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #55 +/- ##
==========================================
- Coverage 94.03% 93.90% -0.14%
==========================================
Files 26 26
Lines 3942 3953 +11
Branches 3942 3953 +11
==========================================
+ Hits 3707 3712 +5
- Misses 148 154 +6
Partials 87 87 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Code Review
The pull request effectively addresses the issue of normalizing release titles to a consistent "vX.Y.Z: description" format. The changes in src/generate.rs correctly handle various non-standard tag prefixes by stripping them and reformatting the title. Additionally, the updates to src/prompt.rs and src/tools/submit_release_notes.rs provide clear guidance to the LLM, which should improve the initial output quality and reduce the need for post-processing. The logic for extracting the description after stripping the tag seems robust. Overall, this is a good improvement for consistency and user experience.
There was a problem hiding this comment.
Pull request overview
This PR fixes the release title normalization logic to ensure all titles follow the "vX.Y.Z: description" format, regardless of what separator the LLM returns. Previously, titles with non-colon separators (like parentheses or dashes) would pass validation and keep their original format.
Changes:
- Updated the normalization logic to strip any existing tag prefix with a non-standard separator and rewrite as "vX.Y.Z: description"
- Modified the LLM prompt and tool description to guide the model toward the correct format from the start
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/generate.rs | Implements new normalization logic to handle various separator formats |
| src/tools/submit_release_notes.rs | Updates tool description to clarify expected title format |
| src/prompt.rs | Updates system prompt to guide LLM toward correct format |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| .release_title | ||
| .strip_prefix(&ctx.tag) | ||
| .and_then(|rest| { | ||
| let trimmed = rest.trim_start_matches(|c: char| !c.is_alphanumeric()); |
There was a problem hiding this comment.
The predicate !c.is_alphanumeric() will strip leading whitespace and punctuation, but it will also strip valid alphanumeric characters if they happen to be non-ASCII (e.g., accented letters or non-Latin scripts). Consider using a more explicit check like |c: char| c.is_whitespace() || matches!(c, '(' | ')' | '-' | ':' | ',' | '.') to only remove known separator characters while preserving all alphanumeric content.
| let trimmed = rest.trim_start_matches(|c: char| !c.is_alphanumeric()); | |
| let trimmed = rest.trim_start_matches(|c: char| { | |
| c.is_whitespace() || matches!(c, '(' | ')' | '-' | ':' | ',' | '.') | |
| }); |
A small patch release that fixes inconsistent release title formatting. Previously, if the LLM returned a title like `v2.18.0 (Internal CI improvements)` or `v2.18.0 - Internal CI improvements`, it would pass validation and be left as-is. Now all titles are normalized to the canonical `vX.Y.Z: description` format. ## Fixed - **Normalize release titles to `vX.Y.Z: description` format** — The previous check only prepended the tag when the title didn't start with it at all. If the LLM returned a title with a non-standard separator (e.g. parentheses or dashes), it passed the check unchanged. The normalization now strips any existing tag prefix with a non-standard separator and rewrites it consistently. The system prompt and tool description were also updated to guide the LLM toward the correct format from the start. ([#55](#55)) (@jdx) | LLM output | Result | |---|---| | `v2.18.0 (Internal CI improvements)` | `v2.18.0: Internal CI improvements` | | `v2.18.0 - Internal CI improvements` | `v2.18.0: Internal CI improvements` | | `v2.18.0: Internal CI improvements` | `v2.18.0: Internal CI improvements` (unchanged) | | `Internal CI improvements` | `v2.18.0: Internal CI improvements` | **Full Changelog**: v0.1.8...010f229 --------- Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Summary
v2.18.0 (Internal CI improvements), the check passed and the title kept its parentheses — seen in jdx/usage v2.18.0vX.Y.Z: descriptionNormalization behavior
v2.18.0 (Internal CI improvements)v2.18.0: Internal CI improvementsv2.18.0 - Internal CI improvementsv2.18.0: Internal CI improvementsv2.18.0: Internal CI improvementsv2.18.0: Internal CI improvements(unchanged)Internal CI improvementsv2.18.0: Internal CI improvements🤖 Generated with Claude Code