fix: only set UV_INDEX_STRATEGY when UV_EXTRA_INDEX_URL is present (#4017)
Some checks failed
Integration Auth Tests / test-matrix (oauth2_token) (push) Failing after 1s
SqlStore Integration Tests / test-postgres (3.13) (push) Failing after 1s
Integration Tests (Replay) / Integration Tests (, , , client=, ) (push) Failing after 4s
Pre-commit / pre-commit (push) Failing after 4s
SqlStore Integration Tests / test-postgres (3.12) (push) Failing after 8s
Vector IO Integration Tests / test-matrix (push) Failing after 6s
Unit Tests / unit-tests (3.13) (push) Failing after 5s
Unit Tests / unit-tests (3.12) (push) Failing after 15s

Cherry-pick of bc12fe6c4 to release-0.3.x

Fixes GitHub Actions workflows failing with UV index strategy errors
when testing on RC tags and non-release branches.

The issue was that UV_INDEX_STRATEGY was being set to an empty string in
the environment, causing UV to fail with "error: a value is required for
'--index-strategy'".

The fix removes UV_INDEX_STRATEGY from the env block and only sets it to
'unsafe-best-match' when UV_EXTRA_INDEX_URL is actually present.
This commit is contained in:
Ashwin Bharambe 2025-10-31 16:22:01 -07:00 committed by GitHub
parent bdd330a94a
commit e0bb7529ed
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -28,12 +28,11 @@ runs:
shell: bash shell: bash
env: env:
UV_EXTRA_INDEX_URL: ${{ steps.client-config.outputs.uv-extra-index-url }} UV_EXTRA_INDEX_URL: ${{ steps.client-config.outputs.uv-extra-index-url }}
UV_INDEX_STRATEGY: ${{ steps.client-config.outputs.uv-extra-index-url && 'unsafe-best-match' || '' }}
run: | run: |
# Export UV env vars to GITHUB_ENV so they persist across steps # Export UV env vars to GITHUB_ENV so they persist across steps
if [ -n "$UV_EXTRA_INDEX_URL" ]; then if [ -n "$UV_EXTRA_INDEX_URL" ]; then
echo "UV_EXTRA_INDEX_URL=$UV_EXTRA_INDEX_URL" >> $GITHUB_ENV echo "UV_EXTRA_INDEX_URL=$UV_EXTRA_INDEX_URL" >> $GITHUB_ENV
echo "UV_INDEX_STRATEGY=$UV_INDEX_STRATEGY" >> $GITHUB_ENV echo "UV_INDEX_STRATEGY=unsafe-best-match" >> $GITHUB_ENV
echo "Exported UV environment variables for subsequent steps" echo "Exported UV environment variables for subsequent steps"
fi fi