From dc8c583977599fbe128d3fe6b4a4b7897ef67d89 Mon Sep 17 00:00:00 2001 From: chalmer lowe Date: Tue, 23 Jun 2026 15:54:18 -0400 Subject: [PATCH 1/3] fix(crc32c): escape version dot and anchor pyenv check regex to prevent matching sub-versions like 3.13.14 --- packages/google-crc32c/scripts/osx/build_python_wheel.sh | 3 ++- packages/google-crc32c/scripts/osx/publish_python_wheel.sh | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/google-crc32c/scripts/osx/build_python_wheel.sh b/packages/google-crc32c/scripts/osx/build_python_wheel.sh index 0b9b2da65181..9d36fec56af3 100755 --- a/packages/google-crc32c/scripts/osx/build_python_wheel.sh +++ b/packages/google-crc32c/scripts/osx/build_python_wheel.sh @@ -39,8 +39,9 @@ eval "$(pyenv init --path)" install_python_pyenv() { version=$1 + escaped_version="${version//./\.}" - if [ -z "$(pyenv versions --bare | grep $version)" ]; then + if [ -z "$(pyenv versions --bare | grep "^${escaped_version}\b")" ]; then echo "Python $version is not installed. Installing..." pyenv install $version echo "Python $version installed." diff --git a/packages/google-crc32c/scripts/osx/publish_python_wheel.sh b/packages/google-crc32c/scripts/osx/publish_python_wheel.sh index e5d6ab115b6f..6e9596a8865f 100755 --- a/packages/google-crc32c/scripts/osx/publish_python_wheel.sh +++ b/packages/google-crc32c/scripts/osx/publish_python_wheel.sh @@ -15,7 +15,7 @@ set -eo pipefail -if [ -z "$(pyenv versions --bare | grep 3.10)" ]; then +if [ -z "$(pyenv versions --bare | grep "^3\.10\b")" ]; then echo "Python 3.10 is not installed. Installing..." pyenv install 3.10 fi From 444a0071c526720a53bdf602008702ee263636ac Mon Sep 17 00:00:00 2001 From: chalmer lowe Date: Tue, 23 Jun 2026 18:40:09 -0400 Subject: [PATCH 2/3] fix(crc32c): refactor pyenv check to avoid subshell and string comparison --- packages/google-crc32c/scripts/osx/build_python_wheel.sh | 3 +-- packages/google-crc32c/scripts/osx/publish_python_wheel.sh | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/packages/google-crc32c/scripts/osx/build_python_wheel.sh b/packages/google-crc32c/scripts/osx/build_python_wheel.sh index 9d36fec56af3..f6ec885b3b13 100755 --- a/packages/google-crc32c/scripts/osx/build_python_wheel.sh +++ b/packages/google-crc32c/scripts/osx/build_python_wheel.sh @@ -40,8 +40,7 @@ eval "$(pyenv init --path)" install_python_pyenv() { version=$1 escaped_version="${version//./\.}" - - if [ -z "$(pyenv versions --bare | grep "^${escaped_version}\b")" ]; then + if ! pyenv versions --bare | grep -q "^${escaped_version}\b"; then echo "Python $version is not installed. Installing..." pyenv install $version echo "Python $version installed." diff --git a/packages/google-crc32c/scripts/osx/publish_python_wheel.sh b/packages/google-crc32c/scripts/osx/publish_python_wheel.sh index 6e9596a8865f..7c156758facd 100755 --- a/packages/google-crc32c/scripts/osx/publish_python_wheel.sh +++ b/packages/google-crc32c/scripts/osx/publish_python_wheel.sh @@ -15,7 +15,7 @@ set -eo pipefail -if [ -z "$(pyenv versions --bare | grep "^3\.10\b")" ]; then +if ! pyenv versions --bare | grep -q "^3\.10\b"; then echo "Python 3.10 is not installed. Installing..." pyenv install 3.10 fi From cea19e667db4f68730ff1fea5c12f2dec6a0aaf4 Mon Sep 17 00:00:00 2001 From: chalmer lowe Date: Tue, 23 Jun 2026 19:01:31 -0400 Subject: [PATCH 3/3] chore(ci): fix step ID typo and handle packages without unit tests in coverage job --- .github/workflows/unittest.yml | 29 +++++++++++++++++++++++------ 1 file changed, 23 insertions(+), 6 deletions(-) diff --git a/.github/workflows/unittest.yml b/.github/workflows/unittest.yml index 7b1809e1c5f0..8429dcc7620f 100644 --- a/.github/workflows/unittest.yml +++ b/.github/workflows/unittest.yml @@ -134,18 +134,35 @@ jobs: id: packages run: echo "::set-output name=num_files_changed::$(git diff HEAD~1 -- packages | wc -l)" - name: Install coverage - if: steps.packages.num_files_changed > 0 + if: steps.packages.outputs.num_files_changed > 0 run: | python -m pip install --upgrade setuptools pip wheel python -m pip install coverage - name: Download coverage results - if: ${{ steps.date.packages.num_files_changed > 0 }} + if: ${{ steps.packages.outputs.num_files_changed > 0 }} uses: actions/download-artifact@v4 with: path: .coverage-results/ - name: Report coverage results - if: ${{ steps.date.packages.num_files_changed > 0 }} + if: ${{ steps.packages.outputs.num_files_changed > 0 }} run: | - find .coverage-results -type f -name '*.zip' -exec unzip {} \; - coverage combine .coverage-results/**/.coverage* - coverage report --show-missing --fail-under=100 + if [ -d .coverage-results ] && find .coverage-results -type f -name '.coverage*' ! -name '.coveragerc*' | grep -q .; then + find .coverage-results -type f -name '*.zip' -exec unzip -o {} \; || true + coverage combine .coverage-results/**/.coverage* + coverage report --show-missing --fail-under=100 + else + echo "No coverage files found to combine. Checking if only packages that skip unit tests were modified." + modified_packages=$(git diff --name-only HEAD~1 -- packages | cut -d/ -f1,2 | sort -u) + only_crc32c=true + for pkg in ${modified_packages}; do + if [ "${pkg}" != "packages/google-crc32c" ]; then + only_crc32c=false + fi + done + if [ "${only_crc32c}" = true ]; then + echo "Only packages/google-crc32c was modified which does not support unit test coverage. Skipping coverage check." + else + echo "Error: No coverage results were downloaded, but modified packages are expected to have unit tests." + exit 1 + fi + fi