Repository navigation
fix: validate uv exports without dropping lock options - #954
vinsymoyya wants to merge 3 commits into
Conversation
There was a problem hiding this comment.
✅ Lambda Tooling PR Reviewer: No high-confidence issues found.
1 lower-confidence observation: these passed verification at a lower score, so check before acting
1. [BUG] aws_lambda_builders/workflows/python_uv/packager.py:324: --frozen builds from a stale uv.lock without any error
When uv.lock exists, _handle_pyproject_build goes straight to _build_from_lock_file. With --frozen, uv export no longer checks the lock against pyproject.toml. If someone adds or changes a dependency and doesn't re-run uv lock, the build succeeds but packages the old dependency set, and the Lambda can then fail at import time. --locked would fail the build on a stale lock and still leave uv.lock unchanged. Check whether --locked accepts a lock created with --exclude-newer before switching to it; if it doesn't, the silent stale-lock behavior should at least be logged.
Issue #, if available: Refs #839, specifically the lock-options report.
Description of changes
Export dependencies with
--lockedand reuse the resolution mode, prerelease mode, fork strategy, andexclude-newercutoff recorded inuv.lock. A valid lock retains its options and bytes; a manifest with newly declared dependencies fails the build until the lock is updated. Export no longer rewrites a valid lock or silently builds with an outdated dependency set.Lock-file failures use the normal action-error path. TOML parsing uses the standard library on Python 3.11+ and a declared
tomlidependency on Python 3.10. The existing path that creates a missing lock still runsuv lockfirst.This addresses lock mutation and freshness only; #839's broader configuration requests remain open.
Description of how you validated changes
LambdaBuilder, and verify unchanged source lock bytes. Adding a local dependency then produces the expected--lockedfailure, with both experimental-flag settings.Checklist
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.