From 0568cf094a576dc7abd957cc80bf95ce7cb79c3e Mon Sep 17 00:00:00 2001 From: KK-MCP Date: Fri, 28 Aug 2026 17:35:27 -0700 Subject: [PATCH] address post-merge check failures MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Suppress TQ008 on the endpoint test's `patch(litellm.*)` calls with test-quality-ok reasons. The reconciliation touches the registry global, prisma client, and RBAC helpers that can't be dependency- injected; a full proxy + DB harness would be disproportionate for a targeted regression assertion. - Sync type-discipline-budget.json from upstream/litellm_internal_staging. My merge picked up main's older (higher) LIT002 limit; staging has already ratcheted it down to 26860, so the budget-ratchet check (non-gating but noisy) was failing on the loosening. Not addressed (not caused by this PR): - osv-scan: restrictedpython GHSA-ffg3-p8fm-mjx2 — same vulnerability on base litellm_internal_staging, unrelated to vector stores. - proxy-endpoints: test_start_shadow_eval_seeds_a_zero_funnel_row_per_leg requires ANTHROPIC_API_KEY — pre-existing CI env issue, unrelated. --- .../test_vector_store_endpoints.py | 22 ++++++++++++------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/tests/test_litellm/proxy/vector_store_endpoints/test_vector_store_endpoints.py b/tests/test_litellm/proxy/vector_store_endpoints/test_vector_store_endpoints.py index cfc7bf0802b..ea5f79421b5 100644 --- a/tests/test_litellm/proxy/vector_store_endpoints/test_vector_store_endpoints.py +++ b/tests/test_litellm/proxy/vector_store_endpoints/test_vector_store_endpoints.py @@ -3185,21 +3185,27 @@ async def test_list_vector_stores_returns_config_sourced_and_leaves_registry_int ] ) + # Endpoint-level regression: list_vector_stores reads several SDK + # internals (registry global, prisma client, RBAC/feature-flag helpers) + # that the caller can't inject. Each patch below targets one such + # internal — sanctioned via test-quality-ok because the alternative + # (spinning a real proxy + DB) is disproportionate for a targeted + # regression assertion. with ( - # patch() auto-restores litellm.vector_store_registry on exit, avoiding - # the module-global save/restore pattern the test-quality gate flags. - patch("litellm.vector_store_registry", registry), - # Empty DB — the store exists only in config/memory. - patch( + patch("litellm.vector_store_registry", registry), # test-quality-ok: injects the registry the endpoint reads + patch( # test-quality-ok: stubs the DB fetch used inside list_vector_stores "litellm.vector_stores.vector_store_registry.VectorStoreRegistry._get_vector_stores_from_db", new=AsyncMock(return_value=[]), ), - patch("litellm.proxy.proxy_server.prisma_client", MagicMock()), - patch( + patch( # test-quality-ok: prisma_client is a module global read at request time + "litellm.proxy.proxy_server.prisma_client", + MagicMock(), + ), + patch( # test-quality-ok: skip RBAC to isolate the reconciliation branch under test "litellm.proxy.vector_store_endpoints.management_endpoints._check_vector_store_access", new=AsyncMock(return_value=True), ), - patch( + patch( # test-quality-ok: skip feature-flag gate to isolate the reconciliation branch under test "litellm.proxy.vector_store_endpoints.management_endpoints.check_feature_access_for_user", new=AsyncMock(return_value=None), ),