[FIX] Patch the lookups bridge in the profile-fallback tests (fixes cloud CI) - #2227
[FIX] Patch the lookups bridge in the profile-fallback tests (fixes cloud CI)#2227pk-zipstack wants to merge 1 commit into
Conversation
The profile-resolution tests added in #2203 patch every collaborator of build_fetch_response_payload except get_lookup_config. In OSS that bridge is a no-op, so the suite is green here — but cloud CI runs this same suite against the merged tree, where the bridge resolves to the real lookups implementation and feeds the test's MagicMock prompt into an ORM query. Since 892be32 landed, every cloud run fails four of these tests with: django.core.exceptions.ValidationError: ['"[]" is not a valid UUID.'] Patch the bridge out like every other collaborator (returning None, exactly what the OSS bridge does), so the suite pins profile resolution in both trees. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
Summary by CodeRabbit
WalkthroughThe test setup now mocks ChangesProfile resolution test isolation
Estimated code review effort: 1 (Trivial) | ~3 minutes Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
|
| Filename | Overview |
|---|---|
| backend/prompt_studio/prompt_studio_core_v2/tests/test_profile_resolution_fallback.py | Correctly patches the module-level lookup binding used by the payload builder while preserving the profile-resolution behavior under test. |
Reviews (1): Last reviewed commit: "[FIX] Patch the lookups bridge in the pr..." | Re-trigger Greptile
|
Closing for now — will discuss with the author of #2203 and follow up. The diagnosis stands for reference: since 892be32, cloud CI (which runs this suite against the merged tree) fails 4 of these tests because the real lookups implementation receives the test's MagicMock prompt — first failing cloud-main run: https://github.com/Zipstack/unstract-cloud/actions/runs/31078494222. |
Unstract test resultsPer-group results
Critical paths
|



What
Adds the missing
get_lookup_configpatch to the collaborator list intest_profile_resolution_fallback.py(added in #2203).Why
The suite calls the real
build_fetch_response_payloadand patches every collaborator — except the lookups bridge. In OSS that bridge is a no-op, so the suite is green here. But cloud CI runs this same suite against the merged tree, whereprompt_studio/lookup_utils.get_lookup_configresolves to the realpluggable_apps/lookups/execution.pyimplementation — which feeds the test'sMagicMockprompt into an ORM query. Since 892be32 landed, every cloud CI run fails four of these tests with:First failing cloud-main run: 31078494222 (cloud main was green at 06:01, red at 06:47 — bracketing #2203's merge). The same failures currently block unrelated cloud PRs (e.g. Zipstack/unstract-cloud#1690).
How
One line + comment:
patch.object(psh, "get_lookup_config", autospec=True, return_value=None)— returningNone, exactly what the OSS bridge returns, so the test pins profile resolution identically in both trees.Test
🤖 Generated with Claude Code