-
Notifications
You must be signed in to change notification settings - Fork 0
feat: add storage batch operations samples #2
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.
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.
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 <[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]>
…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 <[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.