-
Notifications
You must be signed in to change notification settings - Fork 441
impl(v3): bigtable snippet clang-tidy #15940
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
impl(v3): bigtable snippet clang-tidy #15940
Conversation
Summary of ChangesHello @scotthart, 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 enhances the Bigtable example snippets by adopting C++ best practices for function parameter passing. The change specifically modifies Highlights
Changelog
Activity
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 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 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
|
There was a problem hiding this 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 applies clang-tidy fixes to pass a BigtableTableAdminClient by const& instead of by value. While this avoids a copy, I've pointed out a more significant performance issue where the passed-in client is ignored and a new one is created, leading to unnecessary new connections. I've suggested a refactoring to use the passed-in client, which would be more efficient.
| using ::google::cloud::Status; | ||
| using ::google::cloud::StatusOr; | ||
| [](cbta::BigtableTableAdminClient, std::string const& project_id, | ||
| [](cbta::BigtableTableAdminClient const&, std::string const& project_id, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The passed-in client is ignored here, and a new one is created on line 636. This is inefficient as it requires establishing a new connection. It would be better to use the passed-in client.
To fix this, WaitForConsistencyCheck should take its admin parameter by value (reverting the change on line 625). Then, this lambda could also take admin by value, and use it instead of creating a new client. This would make the code more efficient and consistent with other snippets in this file.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## prepare-for-v3.0.0 #15940 +/- ##
===================================================
Coverage 92.79% 92.80%
===================================================
Files 2332 2332
Lines 214327 214327
===================================================
+ Hits 198895 198909 +14
+ Misses 15432 15418 -14 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
diegomarquezp
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@diegomarquezp reviewed all commit messages.
Reviewable status: 0 of 1 files reviewed, 1 unresolved discussion (waiting on @diegomarquezp and @scotthart).
3cf9e93
into
googleapis:prepare-for-v3.0.0
This change is