Skip to content

feat: add storage batch operations samples#2

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

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

Conversation

@thiyaguk09
Copy link
Copy Markdown
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
Copy Markdown

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

Comment thread storagebatchoperations/listJobs.js
Comment thread storagebatchoperations/cancelJob.js
Comment thread storagebatchoperations/quickstart.js
Comment thread storagebatchoperations/getJob.js
Comment thread storagebatchoperations/createJob.js
Comment thread storagebatchoperations/deleteJob.js
Comment thread storagebatchoperations/listJobs.js
Comment thread storagebatchoperations/package.json Outdated
Comment thread storagebatchoperations/cancelJob.js
Comment thread storagebatchoperations/quickstart.js
@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
…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 16 commits October 24, 2025 07:21
…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>
angelcaamal and others added 2 commits April 22, 2026 15:33
…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
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.

10 participants