Open
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces a set of new Node.js samples for Google Cloud Storage Batch Operations, covering essential functionalities like creating, retrieving, listing, canceling, and deleting jobs. My review highlights a recurring critical issue across all the new JavaScript files: asynchronous operations are not being properly awaited. This could cause the scripts to terminate prematurely before the operations complete. I have provided suggestions to refactor the code to use async/await correctly and implement a more robust error handling pattern. Additionally, I've noted a minor naming inconsistency in one file and a formatting issue in the package.json file.
mahendra-google
approved these changes
Sep 12, 2025
e7476df to
c1d08bd
Compare
c1d08bd to
b424e2c
Compare
fb51efe to
6f5d870
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 <rkoza@softserveinc.com> Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> Co-authored-by: Sampath Kumar <sampathm@google.com>
* 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 <rkoza@softserveinc.com> Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> Co-authored-by: Eric Dong <itseric@google.com>
…on & Error Handling) Improve the robustness and clarity of the Storage Batch Operations API samples: * **Error Handling:** Wraps all asynchronous Batch Operations API samples (Create, Get, List, Cancel) in `try...catch` blocks for production readiness. * **Specific Diagnostics:** Adds specific gRPC error code checks (`NOT_FOUND`, `FAILED_PRECONDITION`) within the `catch` blocks to provide detailed diagnostic feedback to users regarding job state or non-existence. * **Documentation:** Clarifies JSDoc for all function parameters (e.g., `projectId`, `jobId`, `objectPrefix`), ensuring examples and types are clear for developers.
6f5d870 to
7dceecc
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 <rkoza@softserveinc.com> Co-authored-by: Eric Dong <itseric@google.com>
* 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 <rkoza@softserveinc.com> Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> Co-authored-by: Jennifer Davis <iennae@gmail.com> Co-authored-by: Eric Dong <itseric@google.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 * 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 <rkoza@softserveinc.com> Co-authored-by: Eric Dong <itseric@google.com>
…dPlatform#4192) * Update quickstart samples to Nodejs24 * Delete appengine/building-an-app/build/.gcloudignore --------- Co-authored-by: Jennifer Davis <sigje@google.com>
…tform#4191) Pending deprecation b/452720552 Co-authored-by: Jennifer Davis <sigje@google.com>
* updating package.json * updating SDK version to 1.30.0 --------- Co-authored-by: Guiners <rkoza@softserveinc.com>
* bounding-box sample with test * add bounding-box sample with test * Update genai/bounding-box/boundingbox-with-txt-img.js Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> * fixing failed tests * updating package.json * fixing failed tests * fixing failing test --------- Co-authored-by: Guiners <rkoza@softserveinc.com> Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
GoogleCloudPlatform#4201) * fix(deps): Upgrade 'got' and refactor modules to ES imports * style: Apply lint fixes and code formatting * style: Apply lint fixes and code formatting --------- Co-authored-by: Jennifer Davis <sigje@google.com>
* Added initial changes for customCredentialSuppliers in AWS and Okta with tests and readme * Fixed tests and added some lint corrections. * Changed tests formatting. * Deleted old test files. * Custom Credentials now read from secrets.json as opposed to env variables. * package.json changes. * Added copyright headers. * fix: simplify configuration of secrets rather than a bunch of if statements also remove some extraneous comments Signed-off-by: Jennifer Davis <sigje@google.com> * Crisper load config from file. --------- Signed-off-by: Jennifer Davis <sigje@google.com> Co-authored-by: Jennifer Davis <sigje@google.com>
* adding count token samples * adding count token * adding count token * Update genai/test/counttoken-localtokenizer-compute-with-txt.test.js Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> * adding count token --------- Co-authored-by: Guiners <rkoza@softserveinc.com> Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> Co-authored-by: Jennifer Davis <sigje@google.com>
* adding videogen samples and tests * Update genai/test/videogen-with-img.test.js Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> * adding videogen samples and tests * code review fix * fixing failed tests * fixing samples * Update genai/video-generation/videogen-with-txt.js Co-authored-by: Holt Skinner <13262395+holtskinner@users.noreply.github.com> * Update model ID to use veo 3.1 fast * Move video-generation tests to dedicated directory --------- Co-authored-by: Guiners <rkoza@softserveinc.com> Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> Co-authored-by: Holt Skinner <13262395+holtskinner@users.noreply.github.com>
Co-authored-by: Holt Skinner <13262395+holtskinner@users.noreply.github.com>
…ty (GoogleCloudPlatform#4196) Co-authored-by: Guiners <rkoza@softserveinc.com> Co-authored-by: Holt Skinner <13262395+holtskinner@users.noreply.github.com>
…4200)" (GoogleCloudPlatform#4206) This reverts commit b2c188e.
…tform#4224) Co-authored-by: Jennifer Davis <sigje@google.com>
…m#4205) Co-authored-by: Jennifer Davis <sigje@google.com>
…-flash-native-audio (GoogleCloudPlatform#4223) * chore(genai): Update gimini model to gimini-live-2.5-flash-native-audio * fix: remove global location to comply with model constraints
…native-audio (GoogleCloudPlatform#4222) * chore(genai): Update gimini model to gimini-live-2.5-flash-native-audio * revert changes to test CI test * update to gemini-live-2.5-flash-native-audio * fix: remove global location to comply with model constraints * chore: formatting in live-audio --------- Co-authored-by: Jennifer Davis <sigje@google.com>
* chore: Migrate gsutil usage to gcloud storage * Update README.md * Update README.md * Update README.md --------- Co-authored-by: Katie McLaughlin <katie@glasnt.com>
Co-authored-by: Katie McLaughlin <katie@glasnt.com>
Co-authored-by: Katie McLaughlin <katie@glasnt.com>
Co-authored-by: Katie McLaughlin <katie@glasnt.com>
Co-authored-by: Katie McLaughlin <katie@glasnt.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.