Skip to content

feat(storage): support delete source objects on compose - #4397

Open
nidhiii-27 wants to merge 10 commits into
mainfrom
pr-4360
Open

feat(storage): support delete source objects on compose#4397
nidhiii-27 wants to merge 10 commits into
mainfrom
pr-4360

Conversation

@nidhiii-27

Copy link
Copy Markdown
Contributor

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]

Updates compose file sample to support deleting source objects optionally. Fixes b/441557254

[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]
@product-auto-label product-auto-label Bot added api: storage Issues related to the Cloud Storage API. samples Issues that are directly related to samples. labels Aug 3, 2026
@nidhiii-27 nidhiii-27 added the ai-generated Generated by AI label Aug 3, 2026

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

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

Comment thread storage/composeFile.js Outdated

await bucket.combine(sources, destinationFileName);

const deleteSources = String(deleteSourceObjects) === 'true';

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

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.

Suggested change
const deleteSources = String(deleteSourceObjects) === 'true';
const deleteSources = String(deleteSourceObjects).toLowerCase() === 'true';

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we add this ?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

Co-authored by AI Agent

@nidhiii-27
nidhiii-27 marked this pull request as ready for review August 3, 2026 08:51
@nidhiii-27
nidhiii-27 requested review from a team as code owners August 3, 2026 08:51
@snippet-bot

snippet-bot Bot commented Aug 3, 2026

Copy link
Copy Markdown

Here is the summary of changes.

You are about to add 1 region tag.

This comment is generated by snippet-bot.
If you find problems with this result, please file an issue at:
https://github.com/googleapis/repo-automation-bots/issues.
To update this comment, add snippet-bot:force-run label or use the checkbox below:

  • Refresh this comment

@nidhiii-27 nidhiii-27 added the storage-sample-architect Generated by storage-sample-architect skill label Aug 3, 2026
Applied the suggested case-insensitive boolean parsing for deleteSourceObjects parameter.

[Generated-by: AI]
Comment thread storage/composeFile.js Outdated

await bucket.combine(sources, destinationFileName);

const deleteSources = String(deleteSourceObjects) === 'true';

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we add this ?

@nidhiii-27
nidhiii-27 requested a review from amcolin August 4, 2026 17:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai-generated Generated by AI api: storage Issues related to the Cloud Storage API. samples Issues that are directly related to samples. storage-sample-architect Generated by storage-sample-architect skill

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants