-
Notifications
You must be signed in to change notification settings - Fork 0
feat: add storage control anywhere cache samples #1
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
base: main
Are you sure you want to change the base?
Conversation
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.
Summary of Changes
Hello @thiyaguk09, 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 significantly expands the Node.js samples for Google Cloud Storage by introducing a complete set of examples for managing Anywhere Cache instances. These additions provide developers with practical code snippets to programmatically interact with and control their cache resources, enhancing the utility and coverage of the existing sample library.
Highlights
- New Anywhere Cache Samples: Added a comprehensive set of Node.js sample files demonstrating various operations for Google Cloud Storage Anywhere Caches, including creation, retrieval, listing, updating, pausing, resuming, and disabling caches.
- New System Tests: Introduced a new system test suite (
anywhereCache.test.js) to ensure the correctness and functionality of all newly added Anywhere Cache samples. - Dependency Updates: Updated the
@google-cloud/storageand@google-cloud/storage-controldependencies inpackage.jsonto their latest versions.
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 in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.
| 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 issue 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
-
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. ↩
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 adds new samples for Storage Control Anywhere Cache features. My review focuses on improving the implementation of the createAnywhereCache sample and fixing a related bug in the system tests. Specifically, I've suggested simplifying the handling of long-running operations by using the client library's built-in features instead of custom polling. I also pointed out an issue in the request object structure for creating a cache and a bug in the system test where incorrect arguments were being passed, which would cause the test to fail.
|
@gurusai-voleti All changes have been addressed. Please review again. |
e83ba77 to
b5e4d63
Compare
b5e4d63 to
a15ae91
Compare
fd4b63b to
572f7f1
Compare
* fixing tools-code-exec-with-txt.js * fixing code from code review and adding linters * fixing code from code review and adding linters * linting * Update genai/test/tools-google-search-with-txt.test.js Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> * adding samples, test, lints * adding samples, test, lints * adding samples, test, lints * adding samples, test, lints * adding samples, test, lints * adding samples, test, lints * adding samples, test, lints * adding samples, test, lints * adding samples, test, lints * adding samples, test, lints * adding samples, test, lints * adding samples, test, lints * fixing functions names * code review fixes * sample update * making timeout longer for ctrlgen-with-nullable-schema --------- Co-authored-by: Guiners <[email protected]> Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> Co-authored-by: Sampath Kumar <[email protected]>
* update package.json * adding new samples * adding new samples * adding new samples * Update genai/tools/tools-urlcontext-with-txt.js Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> * Update genai/test/tools-google-maps-coordinates-with-txt.test.js Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> * Update genai/test/tools-google-search-and-urlcontext-with-txt.test.js Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> * Update genai/test/tools-urlcontext-with-txt.test.js Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> * adding new samples * changed way of printing data * changing response.candidates loop * codereview fixes, url update --------- Co-authored-by: Guiners <[email protected]> Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> Co-authored-by: Eric Dong <[email protected]>
Improve Anywhere Cache API samples (Documentation & Error Handling) * Wraps all asynchronous Anywhere Cache API samples (Create, Get, List, Disable, Pause, Resume) in `try...catch` blocks for production readiness. * Adds specific gRPC error code checks (NOT_FOUND, FAILED_PRECONDITION) to provide better diagnostic feedback to users. * Clarifies documentation regarding the optional nature and default values of `ttl` and `admissionPolicy` for cache creation.
…rage Updates tests for all Anywhere Cache management methods (Create, Get, List, Resume, Disable, Pause) to align with enhanced sample script output. **(Tests were skipped due to reliance on Long-Running Operations (LROs) in the sample code.)** This includes: * **Enhanced Assertions:** Asserting against all newly added detail fields (e.g., Name, State, TTL) to verify full API response parsing in Get and List samples. * **Negative Scenario Coverage:** Adding explicit **negative scenario tests** for state-dependent operations (Disable, Pause, Resume) to assert graceful failure on expected errors like `FAILED_PRECONDITION`.
The function was being called twice due to an oversight during a recent try/catch restructure.
e90dcdb to
41e2ade
Compare
* adding samples, test, lints * adding samples, test, lints * adding samples, test, lints * adding samples, test, lints * adding samples, test, lints * adding samples, test, lints * adding samples, test, lints * adding samples, test, lints * adding samples, test, lints * adding samples, test, lints * adding samples, test, lints * adding samples, test, lints * fixing functions names * linter changes and gemini code review fixes * renamed sc to serverContent * fixing package.json and adding delay to test * adding mock to live-txt-with-audio test * adding mock to live-ground-ragengine-with-txt --------- Co-authored-by: Guiners <[email protected]> Co-authored-by: Eric Dong <[email protected]>
* adding samples * adding samples * adding samples * adding new samples * adding new samples * adding new samples * adding new samples * adding new samples * adding new samples * Update genai/image-generation/imggen-mmflash-locale-aware-with-txt.js Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> * Update genai/image-generation/imggen-mmflash-multiple-imgs-with-txt.js Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> * fixing samples * fixing samples * fixing samples * fix(genai): fix misspelled word based on suggestion from @gemini-code-assist[bot] Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> * sample update * model update * test fix * test fix * test fix * test fix * adding delay and retries for textgen tests * textgen-with-pdf test fix --------- Co-authored-by: Guiners <[email protected]> Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> Co-authored-by: Jennifer Davis <[email protected]> Co-authored-by: Eric Dong <[email protected]>
* adding samples, test, lints * adding samples, test, lints * adding samples, test, lints * adding samples, test, lints * adding samples, test, lints * adding samples, test, lints * adding samples, test, lints * fixing functions names * linter changes and gemini code review fixes * changing response.candidates loop * renaming sc to ServerContent * adding mock to live-conversation-audio-with-audio * adding mock to live-conversation-audio-with-audio * fixing prompt message * Example output * hardcoded values fix * hardcoded values fix --------- Co-authored-by: Guiners <[email protected]> Co-authored-by: Eric Dong <[email protected]>
…dPlatform#4192) * Update quickstart samples to Nodejs24 * Delete appengine/building-an-app/build/.gcloudignore --------- Co-authored-by: Jennifer Davis <[email protected]>
…tform#4191) Pending deprecation b/452720552 Co-authored-by: Jennifer Davis <[email protected]>
* updating package.json * updating SDK version to 1.30.0 --------- Co-authored-by: Guiners <[email protected]>
Description
Fixes #
Note: Before submitting a pull request, please open an issue for discussion if you are not associated with Google.
Checklist
npm test(see Testing)npm run lint(see Style)GoogleCloudPlatform/nodejs-docs-samples. Not a fork.