fix(auth): remove trailing period from displayed Antigravity URL - #28960
fix(auth): remove trailing period from displayed Antigravity URL#28960jeelsoni01 wants to merge 1 commit into
Conversation
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
|
📊 PR Size: size/M
|
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 improves the readability of error messages by automatically removing trailing periods from specific antigravity.google URLs. By centralizing this logic in a new utility function and integrating it into core error handling and custom error classes, the change ensures consistent URL formatting across the application. 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
|
There was a problem hiding this comment.
Code Review
This pull request introduces a utility function sanitizeAntigravityUrl to remove trailing periods from antigravity.google URLs, integrating it into getErrorMessage and several custom error classes (ForbiddenError, UnauthorizedError, and BadRequestError), along with corresponding unit tests. The reviewer identified an issue where the sanitization regular expression fails to match URLs with query parameters or fragment identifiers directly following the domain without a trailing slash, and provided a code suggestion to resolve this.
|
|
||
| export function sanitizeAntigravityUrl(message: string): string { | ||
| return message.replace( | ||
| /(https:\/\/antigravity\.google(?:\/[^\s]*?)?)\.(?=\s|$)/g, |
There was a problem hiding this comment.
The regular expression /(https:\/\/antigravity\.google(?:\/[^\s]*?)?)\.(?=\s|$)/g fails to match and sanitize URLs that have query parameters (?) or fragment identifiers (#) directly following the domain without a trailing slash (e.g., https://antigravity.google?utm_source=cli.). This is because (?:\/[^\s]*?)? strictly requires a leading slash / to match any path/query/fragment.
To make the URL sanitization more robust and support these common URL formats, we should allow ? and # in addition to / as the starting character for the optional path/query/fragment segment.
| /(https:\/\/antigravity\.google(?:\/[^\s]*?)?)\.(?=\s|$)/g, | |
| /(https:\/\/antigravity\.google(?:[/?#][^\s]*?)?)\.(?=\s|$)/g, |
There was a problem hiding this comment.
Hi! The code has been updated with the robust regex fix to support query/fragment parameters in URLs, the unit tests have been added, and the Google CLA checks are now passing successfully. Could you please add the 'help wanted' label to the linked issue (#28052) or override the bot so this can be reviewed? Thank you!
Co-authored-by: Rachit Ritesh Kothadia <rachitkothadia@users.noreply.github.com> Co-authored-by: Shardul <shardulnarvekar@users.noreply.github.com>
0a95ee5 to
e3b56d8
Compare
|
Hi there! Thank you for your interest in contributing to Gemini CLI. To ensure we maintain high code quality and focus on our prioritized roadmap, we only guarantee review and consideration of pull requests for issues that are explicitly labeled as 'help wanted'. This PR will be closed in 7 days if it remains without that designation. We encourage you to find and contribute to existing 'help wanted' issues in our backlog! Thank you for your understanding. |
Summary
Details
Related Issues
How to Validate
Pre-Merge Checklist