fix(core): strip trailing periods from error URLs#28054
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 improves the usability of error messages by automatically removing trailing periods that are incorrectly appended to URLs. By normalizing these strings, the change ensures that URLs rendered in error outputs are navigable, while maintaining existing punctuation for non-URL text. 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/S
|
|
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. |
There was a problem hiding this comment.
Code Review
This pull request introduces a helper function stripTrailingPeriodsFromUrls to clean up trailing periods from URLs in error messages, applying it to various error message resolution paths in getErrorMessage, and adds corresponding unit tests. The reviewer's feedback correctly points out a potential runtime TypeError if the error message is nullish, and suggests making the helper function robust against null or undefined inputs.
Summary
Removes sentence-ending periods that are attached directly to HTTP(S) URLs in error messages so rendered links remain navigable.
Details
getErrorMessage.https://antigravity.google.case.Related Issues
Fixes #28052
How to Validate
Run:
npm test -w @google/gemini-cli-core -- src/utils/errors.test.ts npm run typecheck -w @google/gemini-cli-core npx eslint packages/core/src/utils/errors.ts packages/core/src/utils/errors.test.ts --max-warnings 0 npx prettier --check packages/core/src/utils/errors.ts packages/core/src/utils/errors.test.tsExpected:
Migrate to https://antigravity.google.becomesMigrate to https://antigravity.google.Authentication failed.remains unchanged.Pre-Merge Checklist