feat(storage): support delete source objects on compose - #4397
feat(storage): support delete source objects on compose#4397nidhiii-27 wants to merge 9 commits into
Conversation
Updates compose file sample to support deleting source objects optionally. Fixes b/441557254 [Generated-by: AI]
[Generated-by: AI]
Update composeFile sample to pass deleteSourceObjects option to combine method instead of deleting them manually. [Generated-by: AI]
Make main async and await composeFile to prevent premature process exit. Correctly set process.exitCode on error to propagate failures. [Generated-by: AI]
Modified the composeFile.js sample to manually delete source objects when requested. This fixes CI failures where source objects were not being deleted as expected by the tests. [Generated-by: AI]
There was a problem hiding this comment.
Code Review
This pull request introduces a new sample script composeFile.js to demonstrate combining multiple files into a single destination file using the Google Cloud Storage API, along with corresponding system tests in files.test.js. The feedback suggests improving the robustness of the boolean parsing for the deleteSourceObjects parameter by converting the input string to lowercase before comparison.
|
|
||
| await bucket.combine(sources, destinationFileName); | ||
|
|
||
| const deleteSources = String(deleteSourceObjects) === 'true'; |
There was a problem hiding this comment.
To make the boolean parsing more robust against different casing when passed as a command-line argument (e.g., 'True' or 'TRUE'), convert the string to lowercase before comparing.
| const deleteSources = String(deleteSourceObjects) === 'true'; | |
| const deleteSources = String(deleteSourceObjects).toLowerCase() === 'true'; |
|
Here is the summary of changes. You are about to add 1 region tag.
This comment is generated by snippet-bot.
|
Modified the composeFile.js sample to manually delete source objects when requested.
This fixes CI failures where source objects were not being deleted as expected by the tests.
[Generated-by: AI]