Repository navigation
Use the frozen uv lock for Cloud Run images - #3859
Merged
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #3859 +/- ##
===========================================
+ Coverage 45.76% 87.65% +41.89%
===========================================
Files 182 197 +15
Lines 10812 11952 +1140
Branches 1837 2092 +255
===========================================
+ Hits 4948 10477 +5529
+ Misses 5456 901 -4555
- Partials 408 574 +166 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #3858
Summary
uv sync --frozen --no-dev --no-editableuv.lockin the image build context and install the runtime environment into/opt/venvuv.lockafter CI increments the project version and before it commits the release changelogWhy
The Cloud Run image previously ran
pip install -e .against dependency ranges and ignoreduv.lock. The latest failed staging image therefore installed FastAPI 0.142.0 while the repository lock selected 0.138.2. FastAPI 0.142.0 attempted automatic OpenTelemetry configuration during startup and the application process exited.Using the same frozen uv installation command as the simulation entry Cloud Run service makes the reviewed lock file determine the production dependency set.
Testing
uv run --frozen pytest tests/unit/test_cloud_run_deploy_scripts.py tests/unit/test_asgi_factory.py -q(150 passed)uv run --frozen pytest tests/unit/test_alembic_workflows.py tests/unit/test_cloud_run_deploy_scripts.py -q(125 passed)uv run --frozen ruff check tests/unit/test_cloud_run_deploy_scripts.pyuv lock --checkdocker build --platform linux/amd64 -f gcp/cloud_run/Dockerfile -t policyengine-api-cloud-run:uv-lock-test ./opt/venv/bin/python, Gunicorn, Uvicorn, policyengine-api 4.2.4, FastAPI 0.138.2, and policyengine-observability 3.0.1 inside the built image