Skip to content

Conversation

@Perdiga
Copy link
Collaborator

@Perdiga Perdiga commented Jul 28, 2025

No description provided.

Copilot AI review requested due to automatic review settings July 28, 2025 23:02
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR fixes an issue where the release workflow fails with "nothing to commit" when the local version in pyproject.toml is already at the target release version. The changes prevent unnecessary version bumps and handle cases where the local version is ahead of the published version.

  • Adds logic to check current local version in pyproject.toml and compare it with published versions
  • Modifies version bump logic to skip updates when the version is already at target
  • Updates commit logic to handle cases where no version change is needed

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
.github/workflows/scripts/get_next_release_version.sh Enhanced version detection to read from pyproject.toml and handle cases where local version is ahead
.github/workflows/release-prepare.yml Added conditional version bumping and commit logic to avoid "nothing to commit" errors

echo "Expected format: MAJOR.MINOR.PATCH"
exit 1
# Use version comparison to check if local is ahead
if printf '%s\n%s\n' "$LATEST_RELEASE_VERSION" "$CURRENT_LOCAL_VERSION" | sort -V | tail -n1 | grep -q "^$CURRENT_LOCAL_VERSION$"; then
Copy link

Copilot AI Jul 28, 2025

Choose a reason for hiding this comment

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

This version comparison logic is complex and hard to understand. Consider extracting it into a function with a descriptive name like is_version_greater_or_equal to improve readability and maintainability.

Suggested change
if printf '%s\n%s\n' "$LATEST_RELEASE_VERSION" "$CURRENT_LOCAL_VERSION" | sort -V | tail -n1 | grep -q "^$CURRENT_LOCAL_VERSION$"; then
if is_version_greater_or_equal "$CURRENT_LOCAL_VERSION" "$LATEST_RELEASE_VERSION"; then

Copilot uses AI. Check for mistakes.
fi

# Only calculate new version if we haven't already set it from local version
if [ -z "${NEW_VERSION:-}" ]; then
Copy link

Copilot AI Jul 28, 2025

Choose a reason for hiding this comment

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

[nitpick] The conditional check for NEW_VERSION being unset creates complex nested logic. Consider restructuring the code flow to use early returns or separate functions to reduce nesting and improve readability.

Copilot uses AI. Check for mistakes.
Comment on lines +232 to +233
- Version already at $VERSION
- Prepare for release
Copy link

Copilot AI Jul 28, 2025

Choose a reason for hiding this comment

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

[nitpick] The commit message spans multiple lines but uses different formatting than the previous commit message. Consider using consistent formatting for both commit messages to maintain uniformity.

Suggested change
- Version already at $VERSION
- Prepare for release
- Bump version to $VERSION
- Update package metadata

Copilot uses AI. Check for mistakes.
@Perdiga Perdiga closed this pull request by merging all changes into main in a34952c Jul 28, 2025
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.

2 participants