fix: properly handle URL query parameters when adding branch parameter#764
fix: properly handle URL query parameters when adding branch parameter#764
Conversation
- Parse existing query parameters properly using urlparse and parse_qs - Add branch parameter while preserving existing parameters - Add comprehensive tests for URL parameter handling - Apply code formatting and linting fixes 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the 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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
🚀 Build artifacts are ready for testing!Download the wheel file and binaries with gh CLI or from the workflow artifacts. 📦 Install & RunPre-requisites# Install uv if needed
curl -LsSf https://astral.sh/uv/install.sh | sh
# Create and enter artifacts directory
mkdir artifacts && cd artifactsQuick Test with Python Package# Download and run with uv
gh run download 15700428259 -n dist -R pyupio/safety
uv run --with safety-3.5.2+fix.query.parameter-py3-none-any.whl safety --versionBinary Installation# Linux
gh run download 15700428259 -n safety-linux -D linux -R pyupio/safety
cd linux && mv safety safety-pr && chmod +x safety-pr
# macOS
gh run download 15700428259 -n safety-macos -D macos -R pyupio/safety
cd macos && mv safety safety-pr && chmod +x safety-pr
# Windows
gh run download 15700428259 -n safety-windows -D windows -R pyupio/safety
cd windows && mv safety.exe safety-pr.exe
./safety-pr --version
|
Previously, the code used simple string concatenation to add the branch parameter, which could result in malformed URLs like: https://platform.com/project?env=prod?branch=master
Now uses urllib.parse to properly handle existing query parameters, resulting in correctly formatted URLs like:
https://platform.com/project?env=prod&branch=master
Added comprehensive tests to verify the fix handles:
URLs without existing parameters
URLs with single existing parameter
URLs with multiple existing parameters
Related to SFTY-1757