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
…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
…tform#4278) * feat(spanner): migrate batch 3 core samples and tests * chore(ci): increase access token lifetime to 7200s * Revert "chore(ci): increase access token lifetime to 7200s" This reverts commit abd64c9. * test(spanner): fix failing system tests
…rsion (GoogleCloudPlatform#4287) * fix(sample): Update comment for rendering latest parameter version * fix(sample): Update comment for rendering latest parameter version * fix(samples):Update NodeJs comment for rendering latest parameter version * fix lint issue
…latform#4277) * feat: add deploy to cloud run button for helloworld app * fix: use the explicit path as per gemini 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: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> Co-authored-by: Jennifer Davis <sigje@google.com>
…nstance (GoogleCloudPlatform#4291) Minor spelling fix in the console.log string emitted when a DICOM import operation returns a sample error. User-facing output only; no behavior change. Co-authored-by: Jennifer Davis <sigje@google.com>
…arp (GoogleCloudPlatform#4297) * refactor(run/image-processing): replace deprecated gm library with sharp * refactor: use fs promises API for file operations
…loudPlatform#4293) * refactor: replace deprecated gm library with sharp in v2 sample * chore: update node version in package.json * fix: handle condition where bucket is the same as blurred bucket * fix: remove ImageMagick comments and resolve linting issues * docs: remove gm library references from README * docs: remove gm library references from README --------- Co-authored-by: Jennifer Davis <sigje@google.com>
…stability (GoogleCloudPlatform#4288) * fix(functions): migrate imagemagick sample to sharp and improve test stability - Replaced 'gm' with 'sharp' for image blurring to fix EPIPE errors. - Fixed temporary file deletion to prevent memory leaks in the blurring function. - Refactored the test suite to use try...finally, ensuring the Functions Framework process is always killed to release ports (fixes EADDRINUSE). - Improved test error logging for easier debugging. * fix: address code review comments on imagemagick sample * remove all comments related to the gm library * chore: update node version in package.json * fix: remove ImageMagick comments and resolve linting issues * docs: remove gm library references from README --------- Co-authored-by: Jennifer Davis <sigje@google.com>
…oogleCloudPlatform#4281) * chore(billing): migrate deprecated slack package to @slack/web-api * fix(billing): update node engine to >=18.0.0 for slack web-api compatibility * refactor: rename web variable to slackClient
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.