Skip to content

samples(Storage): Update sample and test for compose object with delete source objects#3336

Merged
krishnamd-jkp merged 3 commits into
GoogleCloudPlatform:mainfrom
mahendra-google:compose-delete-source-objects
Jun 11, 2026
Merged

samples(Storage): Update sample and test for compose object with delete source objects#3336
krishnamd-jkp merged 3 commits into
GoogleCloudPlatform:mainfrom
mahendra-google:compose-delete-source-objects

Conversation

@mahendra-google

Copy link
Copy Markdown
Contributor

This PR contains updation of the sample and test for ComposeObject with the introduction of boolean deleteSourceObjects parameter.

…introduction of the new boolean flag delete source objects
@mahendra-google mahendra-google requested review from a team as code owners June 10, 2026 06:46
@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 Jun 10, 2026

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

Copy link
Copy Markdown

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 updates the ComposeObject sample and its tests to support optionally deleting source objects after composition, alongside updating project dependencies. The review feedback highlights three key improvements: clarifying in the XML documentation that source deletion is optional, fixing a formatting and punctuation issue in the console output when source deletion is disabled, and materializing the file list in the test to prevent redundant API calls during assertions.

Comment thread storage/api/Storage.Samples/ComposeObject.cs
Comment thread storage/api/Storage.Samples/ComposeObject.cs Outdated
Comment thread storage/api/Storage.Samples.Tests/ComposeObjectTest.cs Outdated
@mahendra-google

Copy link
Copy Markdown
Contributor Author

/gemini review

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

Copy link
Copy Markdown

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 adds support for deleting source objects after composition in the ComposeObject sample, updating the method signature, XML documentation, and console output. It also updates the Google.Cloud.Storage.V1 package and adds a dependency on Google.Apis.Storage.v1. Corresponding unit tests have been updated to verify this behavior. The review feedback points out that the ListFiles call in the test returns a lazy IEnumerable, which should be materialized into a list to avoid redundant and expensive API calls during multiple assertions.

Comment thread storage/api/Storage.Samples.Tests/ComposeObjectTest.cs Outdated
@mahendra-google

Copy link
Copy Markdown
Contributor Author

/gemini review

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

Copy link
Copy Markdown

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 updates the ComposeObject sample to support deleting source objects after composition. It adds a deleteSourceObjects parameter to the ComposeObject method, updates the underlying ComposeRequest, and updates the corresponding tests to verify this behavior. A critical issue was identified in the test assertions where Assert.Contains and Assert.DoesNotContain are used with a predicate, which is not supported by xUnit and will cause a compilation error. Projecting the file list to names before asserting is recommended.

Comment thread storage/api/Storage.Samples.Tests/ComposeObjectTest.cs
@krishnamd-jkp krishnamd-jkp added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Jun 10, 2026
@kokoro-team kokoro-team removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Jun 10, 2026
@krishnamd-jkp krishnamd-jkp added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Jun 11, 2026
@kokoro-team kokoro-team removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Jun 11, 2026
@krishnamd-jkp krishnamd-jkp merged commit ebd181a into GoogleCloudPlatform:main Jun 11, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api: storage Issues related to the Cloud Storage API. samples Issues that are directly related to samples.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants