mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-08 22:21:35 +00:00
1. Fix race condition in update_version_status promote-to-production:
- Wrap demote (update_many) + promote (update) in a Prisma transaction
- Prevents concurrent promote calls from leaving two versions as production
2. Fix stale _policies_by_id cache in delete methods:
- delete_policy_from_db: remove entry from _policies_by_id when deleting
a draft/published version
- delete_all_versions: scan and remove all _policies_by_id entries
matching the deleted policy_name
3. Fix docstring for update_version_status:
- Remove documented-but-unimplemented 'production -> published' transition
- Clarify which transitions are valid vs invalid
4. Add tests for new behavior:
- test_published_to_production_removes_from_policies_by_id
- test_delete_draft_removes_from_policies_by_id_cache
- test_delete_all_versions_cleans_policies_by_id_cache
- Update existing promote-to-production tests to mock transaction
Co-authored-by: Krish Dholakia <krrishdholakia@gmail.com>
|
||
|---|---|---|
| .. | ||
| __init__.py | ||
| test_attachment_registry.py | ||
| test_condition_evaluator.py | ||
| test_pipeline_executor.py | ||
| test_policy_matcher.py | ||
| test_policy_resolver.py | ||
| test_policy_validator.py | ||
| test_policy_versioning.py | ||
| test_policy_versioning_e2e.py | ||