Skip to content

Conversation

@thiyaguk09
Copy link
Owner

Description

Fixes #

Note: Before submitting a pull request, please open an issue for discussion if you are not associated with Google.

Checklist

  • I have followed guidelines from CONTRIBUTING.MD and Samples Style Guide
  • Tests pass: npm test (see Testing)
  • Lint pass: npm run lint (see Style)
  • Required CI tests pass (see CI testing)
  • These samples need a new API enabled in testing projects to pass (let us know which ones)
  • These samples need a new/updated env vars in testing projects set to pass (let us know which ones)
  • This pull request is from a branch created directly off of GoogleCloudPlatform/nodejs-docs-samples. Not a fork.
  • This sample adds a new sample directory, and I updated the CODEOWNERS file with the codeowners for this sample
  • This sample adds a new sample directory, and I created GitHub Actions workflow for this sample
  • This sample adds a new Product API, and I updated the Blunderbuss issue/PR auto-assigner with the codeowners for this sample
  • Please merge this PR for me once it is approved

Note: Any check with (dev), (experimental), or (legacy) can be ignored and should not block your PR from merging (see CI testing).

Copy link

@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.

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/storage and @google-cloud/storage-control dependencies in package.json to 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

  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

@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 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.

@thiyaguk09
Copy link
Owner Author

@gurusai-voleti All changes have been addressed. Please review again.

@thiyaguk09 thiyaguk09 force-pushed the anywhere-cache-samples branch from e83ba77 to b5e4d63 Compare September 12, 2025 07:54
@thiyaguk09 thiyaguk09 force-pushed the anywhere-cache-samples branch from b5e4d63 to a15ae91 Compare September 22, 2025 08:14
@thiyaguk09 thiyaguk09 force-pushed the anywhere-cache-samples branch 2 times, most recently from fd4b63b to 572f7f1 Compare October 8, 2025 09:57
Guiners and others added 14 commits October 22, 2025 17:03
* 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.
@thiyaguk09 thiyaguk09 force-pushed the anywhere-cache-samples branch from e90dcdb to 41e2ade Compare October 24, 2025 06:50
Guiners and others added 6 commits October 27, 2025 11:25
* 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]>
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.

6 participants