fix: normalize python websocket task uri without duplicating path#755
fix: normalize python websocket task uri without duplicating path#755aryaMehta26 wants to merge 1 commit intorocketride-org:developfrom
Conversation
📝 WalkthroughWalkthroughThe PR refactors WebSocket URI construction in the Python client's ChangesWebSocket URI Path Normalization
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related issues
Possibly related PRs
Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 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 |
|
No description provided. |
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)
packages/client-python/tests/RocketRideClient_test.py (1)
2366-2380: 🧹 Nitpick | 🔵 Trivial | ⚡ Quick winThe
elsebranch of_get_websocket_urihas no test coverage.All seven parametrize cases route through either
path.endswith('/task/service')orelif path == ''. Theelsepath — appending/task/serviceto a non-root base (e.g.http://localhost:5565/api) — is never exercised. A regression there would go undetected.✅ Proposed additional parametrize case
('ws://localhost:5565/task/service/', 'ws://localhost:5565/task/service'), + ('http://localhost:5565/api', 'ws://localhost:5565/api/task/service'), ],🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@packages/client-python/tests/RocketRideClient_test.py` around lines 2366 - 2380, Add a test case that exercises the else branch of ConnectionMixin._get_websocket_uri by supplying a base URI whose path is non-empty and does not end with '/task/service' (for example 'http://localhost:5565/api') and assert it returns the websocket URI with '/task/service' appended to that path (e.g. 'ws://localhost:5565/api/task/service'); ensure the new parametrize entry mirrors existing cases so the condition that appends '/task/service' to a non-root path is covered.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Outside diff comments:
In `@packages/client-python/tests/RocketRideClient_test.py`:
- Around line 2366-2380: Add a test case that exercises the else branch of
ConnectionMixin._get_websocket_uri by supplying a base URI whose path is
non-empty and does not end with '/task/service' (for example
'http://localhost:5565/api') and assert it returns the websocket URI with
'/task/service' appended to that path (e.g.
'ws://localhost:5565/api/task/service'); ensure the new parametrize entry
mirrors existing cases so the condition that appends '/task/service' to a
non-root path is covered.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
Run ID: 5c592cfb-bed8-4115-9fa8-88bcf0ea43c4
📒 Files selected for processing (2)
packages/client-python/src/rocketride/mixins/connection.pypackages/client-python/tests/RocketRideClient_test.py
Summary
Type
Testing
./builder testpassesChecklist
Linked Issue
Fixes #
Summary by CodeRabbit
Release Notes