Skip to content

Conversation

Perdiga
Copy link
Collaborator

@Perdiga Perdiga commented Jul 28, 2025

No description provided.

@Copilot Copilot AI review requested due to automatic review settings July 28, 2025 17:56
Copy link

@Copilot 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 introduces automated workflow improvements for building and releasing feature branch versions to TestPyPI. The changes establish a CI/CD pipeline that automatically creates incremental build versions (e.g., "0.1.12-build.1") for feature branches and publishes them to TestPyPI for testing purposes.

Key changes:

  • Added automated build version detection and increment logic
  • Created a GitHub Actions workflow for TestPyPI releases on feature branches
  • Implemented version management with automatic package versioning

Reviewed Changes

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

File Description
.github/workflows/scripts/get_latest_build.sh Bash script that queries TestPyPI API to detect existing build versions and generates the next incremental build number
.github/workflows/release-test-pypi.yml GitHub Actions workflow that runs tests, builds packages, and publishes feature branch builds to TestPyPI
Comments suppressed due to low confidence (1)

.github/workflows/release-test-pypi.yml:15

  • Python 3.13 may not be available yet. As of my knowledge cutoff in January 2025, Python 3.13 was still in development. Consider using a stable version like "3.12" or "3.11" to ensure compatibility.
  PYTHON_VERSION: "3.13"


# Get the latest build version and its filename
LATEST_BUILD_VERSION=$(echo "$BUILD_VERSIONS" | tail -n 1)
LATEST_BUILD_FILES=$(echo "$RESPONSE" | python3 -c "import sys, json; data=json.load(sys.stdin); [print(f['filename']) for f in data.get('releases', {}).get('$LATEST_BUILD_VERSION', [])]" 2>/dev/null || echo "")
Copy link
Preview

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.

The variable $LATEST_BUILD_VERSION inside the Python string is not being expanded by the shell because it's within single quotes in the Python code. This will cause the script to look for a literal key '$LATEST_BUILD_VERSION' instead of the actual version value. Use double quotes or concatenate the variable outside the Python string.

Suggested change
LATEST_BUILD_FILES=$(echo "$RESPONSE" | python3 -c "import sys, json; data=json.load(sys.stdin); [print(f['filename']) for f in data.get('releases', {}).get('$LATEST_BUILD_VERSION', [])]" 2>/dev/null || echo "")
LATEST_BUILD_FILES=$(echo "$RESPONSE" | python3 -c "import sys, json; data=json.load(sys.stdin); [print(f['filename']) for f in data.get('releases', {}).get(\"$LATEST_BUILD_VERSION\", [])]" 2>/dev/null || echo "")

Copilot uses AI. Check for mistakes.

if [ -n "$BUILD_NUMBERS" ]; then
LATEST_BUILD_NUMBER=$(echo "$BUILD_NUMBERS" | tail -n 1)
BUILD_NUMBER=$((LATEST_BUILD_NUMBER + 1))
echo "Found build numbers: $(echo $BUILD_NUMBERS | tr '\n' ' ')"
Copy link
Preview

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.

The variable $BUILD_NUMBERS should be quoted to prevent word splitting. Change to echo "$BUILD_NUMBERS" to avoid potential issues with spaces in the output.

Suggested change
echo "Found build numbers: $(echo $BUILD_NUMBERS | tr '\n' ' ')"
echo "Found build numbers: $(echo "$BUILD_NUMBERS" | tr '\n' ' ')"

Copilot uses AI. Check for mistakes.

Comment on lines 39 to 42
echo "new_version=$NEW_VERSION" >> $GITHUB_OUTPUT
echo "latest_build_number=1" >> $GITHUB_OUTPUT
echo "latest_build_filename=" >> $GITHUB_OUTPUT
echo "build_count=0" >> $GITHUB_OUTPUT
Copy link
Preview

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.

The variable $GITHUB_OUTPUT should be quoted to prevent potential issues with special characters or spaces in the path. Change to "$GITHUB_OUTPUT" for safer file operations.

Suggested change
echo "new_version=$NEW_VERSION" >> $GITHUB_OUTPUT
echo "latest_build_number=1" >> $GITHUB_OUTPUT
echo "latest_build_filename=" >> $GITHUB_OUTPUT
echo "build_count=0" >> $GITHUB_OUTPUT
echo "new_version=$NEW_VERSION" >> "$GITHUB_OUTPUT"
echo "latest_build_number=1" >> "$GITHUB_OUTPUT"
echo "latest_build_filename=" >> "$GITHUB_OUTPUT"
echo "build_count=0" >> "$GITHUB_OUTPUT"

Copilot uses AI. Check for mistakes.

@Perdiga Perdiga merged commit 0cf79cb into main Jul 28, 2025
2 checks passed
@Perdiga Perdiga changed the title Feature/workflow improvements Improve workflow to deploy build versions to Pypi 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.

1 participant