Repository navigation
fix(extensions): only strip a trailing .git suffix - #29652
artemkulyk wants to merge 1 commit into
Conversation
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request resolves an issue where repository names containing the substring '.git' were being incorrectly truncated during URL parsing. By updating the logic to specifically target the trailing suffix, the parser now correctly handles edge cases such as GitHub Pages repository names, ensuring the repository identity remains intact. Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize the Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counterproductive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. Footnotes
|
|
📊 PR Size: size/XS
|
There was a problem hiding this comment.
Code Review
This pull request fixes a bug in the GitHub URL parser where any occurrence of ".git" in the repository name (such as in "blog.github.io") was incorrectly removed. The implementation has been corrected to only strip ".git" when it appears at the end of the repository name using a regular expression. Additionally, new test cases have been added to verify this behavior. No review comments were provided, and the changes look solid.
Summary
tryParseGithubUrlstripped.gitwithString.replace('.git', ''), whichremoves the first occurrence anywhere in the name rather than the suffix. Any
repo whose name merely contains
.gitgets mangled:blog.github.ioparses tohub.io, so install/update then calls/repos/owner/hub.io/releases/latestand 404s.getExtensionId()also derivesits id from that corrupted name, so the extension identity stays wrong even
after a manual fix.
Details
Only strip a trailing
.git, matching the expected fix in the issue. Nothingchanges for normal clone URLs (
owner/repo.gitstill parses toowner/repo).Related Issues
Fixes #29037
How to Validate
npx vitest run src/config/extensions/github.test.tsinpackages/clipasses(36 tests).
I also asked on the issue about
help wanted, since that is what thecontribution policy keys off. Happy to leave this parked until a maintainer
weighs in.
Pre-Merge Checklist