fix(code-hosting): recognize SSH repository hosts with userinfo#1375
fix(code-hosting): recognize SSH repository hosts with userinfo#1375officialasishkumar wants to merge 1 commit intovolcengine:mainfrom
Conversation
Use parsed hostnames instead of raw netloc values when matching configured code-hosting domains. This keeps ssh://git@host and explicit-port repository URLs on the supported code-hosting path while preserving git clone handling for SSH repository sources. Add focused regression coverage for SSH URL userinfo and explicit-port repository URL helpers.
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Explore these optional code suggestions:
|
Description
Fix code-hosting URL domain matching so repository helpers use parsed hostnames instead of raw
netlocvalues. This allows common clone URLs such asssh://git@github.com/org/repo.gitand explicit-port URLs such ashttps://github.com:443/org/repoto be recognized as configured code-hosting repositories.The repository parser still keeps SSH-style GitHub URLs on the
git clonepath, so users who provide SSH URLs continue using their SSH credentials instead of being silently routed through GitHub ZIP downloads.Related Issue
Fixes #1374
Type of Change
Changes Made
ssh://git@...and explicit-port repository URLs in parse/detection helpers.CodeRepositoryParser.Testing
Validated locally:
/tmp/openviking-url-venv/bin/python -m pytest --noconftest -o addopts='' tests/test_code_hosting_utils.py -q python3 -m py_compile openviking/utils/code_hosting_utils.py openviking/parse/parsers/code/code.py tests/test_code_hosting_utils.py /tmp/openviking-url-venv/bin/ruff format --check openviking/utils/code_hosting_utils.py openviking/parse/parsers/code/code.py tests/test_code_hosting_utils.py /tmp/openviking-url-venv/bin/ruff check openviking/utils/code_hosting_utils.py openviking/parse/parsers/code/code.py tests/test_code_hosting_utils.py git diff --checkChecklist
Screenshots (if applicable)
N/A
Additional Notes
Full repository pytest was not run because the global test bootstrap imports the bundled AGFS client. The change is covered with the focused code-hosting helper test module, compiled touched files, and Ruff checks.