Skip to content

Conversation

@julieqiu
Copy link
Member

Error messages are updated throughout the internal/ directory (excluding internal/legacylibrarian and internal/sidekick) to be more user-friendly and consistent.

Changes include:

  • Add quotes around variables values with %q
  • Simplify wording and remove technical jargon
  • Adopt "no X found" pattern for missing resources
  • Change "must not be empty" to "must provide X" for validation errors
  • Replace "not implemented" with "does not support" for unsupported operations

For https://github.com/googleapis/librarian/issues/3680c

Error messages are updated throughout the internal/ directory (excluding
internal/legacylibrarian and internal/sidekick) to be more user-friendly
and consistent.

Changes include:

- Add quotes around variables values with %q
- Simplify wording and replacing technical jargon with user-friendly
  terms
- Adopt "no X found" pattern for missing resources
- Change "must not be empty" to "must provide X" for validation errors
- Replace "not implemented" with "does not support" for unsupported
  operations

For https://github.com/googleapis/librarian/issues/3680c
@julieqiu julieqiu requested a review from a team as a code owner January 22, 2026 01:43
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @julieqiu, 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 refactors error handling within the internal/ directory to significantly improve the user experience by making error messages more consistent, clear, and actionable. The changes focus on standardizing the language, adding context through quoting, and adopting specific patterns for common error scenarios like missing resources or validation failures. This effort aims to reduce confusion and provide better guidance to users encountering issues with the librarian tool.

Highlights

  • Standardized Error Messaging: Error messages across the internal/ directory have been updated to be more user-friendly and consistent, adhering to a set of predefined patterns.
  • Improved Error Clarity with Quoting: Variable values within error messages now consistently use %q for quoting, enhancing readability and clarity for user-facing messages.
  • Simplified Wording: Technical jargon has been removed and wording simplified in many error messages to make them more accessible to end-users.
  • Consistent 'No X Found' Pattern: Errors related to missing resources now follow a 'no X found' pattern, providing clearer feedback when an item is not located.
  • Validation Error Messaging: Validation errors have been updated from 'must not be empty' to 'must provide X', offering more direct guidance on required inputs.
  • Unsupported Operation Messaging: Messages for unsupported operations have been changed from 'not implemented' to 'does not support', providing a more accurate description of the limitation.
  • Logging Library Change: The cmd/librarian/main.go file has switched from using log/slog for fatal errors to the standard log package, simplifying the error handling at the application entry point.
Using Gemini Code Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize 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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. 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.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request does an excellent job of refactoring error messages to be more user-friendly and consistent, aligning with the goals outlined in the description. The changes are systematic and improve code quality by making errors more informative and, in some cases, programmatically inspectable.

I found one critical issue that will prevent the code from compiling and one medium-severity suggestion to further improve consistency in error handling. Once the critical issue is addressed, this will be a great contribution.

@codecov
Copy link

codecov bot commented Jan 22, 2026

Codecov Report

❌ Patch coverage is 17.77778% with 37 lines in your changes missing coverage. Please review.
✅ Project coverage is 82.44%. Comparing base (3dbe74f) to head (0ab9826).

Files with missing lines Patch % Lines
internal/librarian/python/generate.go 0.00% 9 Missing ⚠️
internal/librarian/generate.go 12.50% 7 Missing ⚠️
internal/librarian/rust/generate.go 0.00% 7 Missing ⚠️
internal/serviceconfig/serviceconfig.go 0.00% 5 Missing ⚠️
internal/librarian/bump.go 57.14% 1 Missing and 2 partials ⚠️
cmd/librarian/main.go 0.00% 1 Missing ⚠️
internal/librarian/add.go 0.00% 1 Missing ⚠️
internal/librarian/fake.go 0.00% 1 Missing ⚠️
internal/librarian/rust/codec.go 0.00% 1 Missing ⚠️
internal/librarian/rust/update_manifest.go 0.00% 1 Missing ⚠️
... and 1 more
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3690   +/-   ##
=======================================
  Coverage   82.43%   82.44%           
=======================================
  Files         138      138           
  Lines       12657    12656    -1     
=======================================
  Hits        10434    10434           
+ Misses       1733     1732    -1     
  Partials      490      490           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant