Repository navigation
Refactor: REST API langfuse api-key - #14315
Conversation
📝 WalkthroughWalkthroughThe Langfuse API key management endpoints are being standardized to use a consistent route path structure. The backend route changes from Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Poem
🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. 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 |
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
api/apps/restful_apis/langfuse_api.py (1)
26-85:⚠️ Potential issue | 🟠 MajorUpdate the remaining contract tests to use the new
/langfuse/api-keyendpoint path.The backend now registers
/langfuse/api-key(with hyphen), buttest/testcases/test_web_api/test_connector_app/test_connector_oauth_contract.py:25still definesLANGFUSE_API_KEY_URL = f"{HOST_ADDRESS}/{VERSION}/langfuse/api_key"(with underscore and missing the/api/prefix). This causes the POST/GET/PUT contract tests at lines 133, 138, and 143 to target the wrong endpoint. Update the URL tof"{HOST_ADDRESS}/api/{VERSION}/langfuse/api-key"to match the new route and align with theCONNECTOR_BASE_URLpattern.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@api/apps/restful_apis/langfuse_api.py` around lines 26 - 85, The tests are targeting the wrong Langfuse endpoint path; update the constant LANGFUSE_API_KEY_URL in test/testcases/test_web_api/test_connector_app/test_connector_oauth_contract.py to use the new route and correct prefix by changing its value to f"{HOST_ADDRESS}/api/{VERSION}/langfuse/api-key" so the POST/GET/PUT contract tests reference the registered /langfuse/api-key route (matches the server's manager.route and CONNECTOR_BASE_URL pattern).
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Outside diff comments:
In `@api/apps/restful_apis/langfuse_api.py`:
- Around line 26-85: The tests are targeting the wrong Langfuse endpoint path;
update the constant LANGFUSE_API_KEY_URL in
test/testcases/test_web_api/test_connector_app/test_connector_oauth_contract.py
to use the new route and correct prefix by changing its value to
f"{HOST_ADDRESS}/api/{VERSION}/langfuse/api-key" so the POST/GET/PUT contract
tests reference the registered /langfuse/api-key route (matches the server's
manager.route and CONNECTOR_BASE_URL pattern).
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: c9bb5783-ee51-4dac-b3ce-a2dfb1989063
📒 Files selected for processing (3)
api/apps/restful_apis/langfuse_api.pytest/testcases/test_web_api/test_connector_app/test_langfuse_app_unit.pyweb/src/utils/api.ts
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #14315 +/- ##
==========================================
- Coverage 97.41% 95.97% -1.44%
==========================================
Files 10 10
Lines 695 695
Branches 111 111
==========================================
- Hits 677 667 -10
- Misses 7 11 +4
- Partials 11 17 +6 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
What problem does this PR solve?
As descripotion
Type of change