Use host check instead of substring search for GitLab URLs - #242
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughGitLab token authentication now uses parsed URL hosts and available tokens. GitLab repository detection now recognizes HTTPS hosts regardless of casing and retains support for GitLab SSH URLs. ChangesGitLab URL handling
Estimated code review effort: 1 (Trivial) | ~5 minutes Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches 💡 1🛠️ Fix failing CI checks 💡
📝 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 |
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
There was a problem hiding this comment.
Pull request overview
This PR hardens GitLab URL detection in the package install/validation flow by switching from substring checks to host-based checks, making token/header injection decisions more robust and less error-prone.
Changes:
- Use
parse_url(..., PHP_URL_HOST)+ case-normalization to detectgitlab.comfor attachingPRIVATE-TOKENheaders when downloading from GitLab URLs. - Ensure GitLab fallback lookups in
get_package_by_shortened_identifier()correctly applyGITLAB_TOKENheaders. - Improve GitLab URL detection in
check_git_package_name()by using host checks (and a stricter SSH prefix check).
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Adding some hardening to make the check more robust.
Summary by CodeRabbit