Skip to content

feat: add storage batch operations samples#2

Open
thiyaguk09 wants to merge 43 commits intomainfrom
storagebatchoperations-samples
Open

feat: add storage batch operations samples#2
thiyaguk09 wants to merge 43 commits intomainfrom
storagebatchoperations-samples

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.

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.

@thiyaguk09 thiyaguk09 marked this pull request as ready for review September 12, 2025 07:18
@thiyaguk09 thiyaguk09 force-pushed the storagebatchoperations-samples branch from e7476df to c1d08bd Compare September 12, 2025 07:52
@thiyaguk09 thiyaguk09 force-pushed the storagebatchoperations-samples branch from c1d08bd to b424e2c Compare September 22, 2025 08:15
@thiyaguk09 thiyaguk09 force-pushed the storagebatchoperations-samples branch from fb51efe to 6f5d870 Compare October 17, 2025 13:38
Guiners and others added 7 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 <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.
@thiyaguk09 thiyaguk09 force-pushed the storagebatchoperations-samples branch from 6f5d870 to 7dceecc Compare October 24, 2025 06:51
thiyaguk09 and others added 14 commits October 24, 2025 07:21
* 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>
Guiners and others added 22 commits December 18, 2025 09:25
* 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>
…-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>
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.