Conversation
oschwald
commented
Jan 14, 2026
- Set release date
- Add release script
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Summary of ChangesHello @oschwald, 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 focuses on enhancing the release management workflow by introducing automation and ensuring proper versioning. It sets the stage for a more streamlined and less error-prone release cycle, making it easier to publish new versions and maintain accurate release notes. Highlights
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
|
Modver resultThis report was generated by Modver, This PR does not require a change in your module’s version number. |
There was a problem hiding this comment.
Code Review
This pull request adds a release date to the changelog and introduces a new release script. The release script is a great addition for automating the release process. I've provided a few suggestions to improve its robustness, maintainability, and user experience. These include ensuring the script runs from the repository root, checking for dependencies, avoiding duplicated code, and making the GitHub release creation more robust.
dev-bin/release.sh
Outdated
|
|
||
| git push | ||
|
|
||
| gh release create --target "$(git branch --show-current)" -t "$version" -n "$notes" "$tag" |
There was a problem hiding this comment.
Passing release notes via -n "$notes" can be fragile if the notes contain special characters that the shell might interpret. The gh release create command provides a --notes-file (or -F) option to read notes from a file, which is more robust.
Additionally, git branch --show-current was added in Git 2.22. For better portability with older Git versions, you could use git rev-parse --abbrev-ref HEAD.
| gh release create --target "$(git branch --show-current)" -t "$version" -n "$notes" "$tag" | |
| notes_file=$(mktemp) | |
| trap 'rm -f "$notes_file"' EXIT | |
| echo "$notes" > "$notes_file" | |
| gh release create --target "$(git rev-parse --abbrev-ref HEAD)" -t "$version" -F "$notes_file" "$tag" |
| set -eu -o pipefail | ||
|
|
||
| changelog=$(cat CHANGELOG.md) |
There was a problem hiding this comment.
The script currently assumes it's run from the repository root and that the gh CLI tool is installed. It's good practice to make scripts more robust by explicitly handling these assumptions.
I suggest adding checks at the beginning of the script:
- Change to the repository root directory to ensure file paths like
CHANGELOG.mdresolve correctly regardless of where the script is invoked from. - Check for the presence of the
ghcommand and exit gracefully if it's not found.
| set -eu -o pipefail | |
| changelog=$(cat CHANGELOG.md) | |
| set -eu -o pipefail | |
| cd "$(git rev-parse --show-toplevel)" | |
| if ! command -v gh > /dev/null; then | |
| echo "The 'gh' CLI is not installed. Please install it to continue." >&2 | |
| exit 1 | |
| fi | |
| changelog=$(cat CHANGELOG.md) |
dev-bin/release.sh
Outdated
| regex=' | ||
| ## ([0-9]+\.[0-9]+\.[0-9]+(-[^ ]+)?) \(([0-9]{4}-[0-9]{2}-[0-9]{2})\) | ||
|
|
||
| ((.| | ||
| )*) | ||
| ' | ||
|
|
||
| if [[ ! $changelog =~ $regex ]]; then | ||
| echo "Could not find date line in change log!" | ||
| exit 1 | ||
| fi | ||
|
|
||
| version="${BASH_REMATCH[1]}" | ||
| date="${BASH_REMATCH[3]}" | ||
| notes="$(echo "${BASH_REMATCH[4]}" | sed -n -E '/^## [0-9]+\.[0-9]+\.[0-9]+(-[^ ]+)?/,$!p')" |
There was a problem hiding this comment.
To improve maintainability and avoid duplicating the version matching logic, you can define the version regex in a variable and reuse it for both parsing the changelog and extracting the release notes with sed. This way, if the version format ever changes, you only need to update it in one place.
| regex=' | |
| ## ([0-9]+\.[0-9]+\.[0-9]+(-[^ ]+)?) \(([0-9]{4}-[0-9]{2}-[0-9]{2})\) | |
| ((.| | |
| )*) | |
| ' | |
| if [[ ! $changelog =~ $regex ]]; then | |
| echo "Could not find date line in change log!" | |
| exit 1 | |
| fi | |
| version="${BASH_REMATCH[1]}" | |
| date="${BASH_REMATCH[3]}" | |
| notes="$(echo "${BASH_REMATCH[4]}" | sed -n -E '/^## [0-9]+\.[0-9]+\.[0-9]+(-[^ ]+)?/,$!p')" | |
| version_regex_part='[0-9]+\.[0-9]+\.[0-9]+(-[^ ]+)?' | |
| regex=" | |
| ## ($version_regex_part) \(([0-9]{4}-[0-9]{2}-[0-9]{2})\) | |
| ((.| | |
| )*) | |
| " | |
| if [[ ! $changelog =~ $regex ]]; then | |
| echo "Could not find date line in change log!" | |
| exit 1 | |
| fi | |
| version="${BASH_REMATCH[1]}" | |
| date="${BASH_REMATCH[3]}" | |
| notes="$(echo "${BASH_REMATCH[4]}" | sed -n -E "/^## $version_regex_part/,\$!p")" |
dev-bin/release.sh
Outdated
| read -e -p "Push to origin? " should_push | ||
|
|
||
| if [ "$should_push" != "y" ]; then | ||
| echo "Aborting" | ||
| exit 1 | ||
| fi |
There was a problem hiding this comment.
The confirmation prompt only accepts a lowercase 'y'. This can be made more user-friendly by accepting 'Y' as well and by indicating the expected input in the prompt (e.g., [y/N]). Using a regex match for confirmation would improve the user experience.
| read -e -p "Push to origin? " should_push | |
| if [ "$should_push" != "y" ]; then | |
| echo "Aborting" | |
| exit 1 | |
| fi | |
| read -e -p "Push to origin? [y/N] " should_push | |
| if ! [[ "$should_push" =~ ^[Yy]$ ]]; then | |
| echo "Aborting" | |
| exit 1 | |
| fi |
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Ensures the script works correctly regardless of which directory it's invoked from. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Avoids duplicating the version pattern between the main regex and the sed command. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Avoids shell interpretation issues with special characters in release notes. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
4797a8e to
e029bc4
Compare