Skip to content

feat(storage): add DeleteSourceObjects option to ComposeObjectRequest.#15932

Draft
joshuatants wants to merge 1 commit intogoogleapis:mainfrom
joshuatants:delete_source_objects
Draft

feat(storage): add DeleteSourceObjects option to ComposeObjectRequest.#15932
joshuatants wants to merge 1 commit intogoogleapis:mainfrom
joshuatants:delete_source_objects

Conversation

@joshuatants
Copy link

@joshuatants joshuatants commented Feb 4, 2026

This change is Reviewable

@product-auto-label product-auto-label bot added the api: storage Issues related to the Cloud Storage API. label Feb 4, 2026
@gemini-code-assist
Copy link

Summary of Changes

Hello @joshuatants, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request enhances the Google Cloud Storage client library by adding a new configuration option to the ComposeObjectRequest. This option, DeleteSourceObjects, provides users with direct control over the lifecycle of source objects after they have been successfully combined into a new object, allowing for automatic cleanup if desired. This feature streamlines object management workflows by integrating deletion directly into the composition process.

Highlights

  • New Option for Object Composition: Introduced a new DeleteSourceObjects option that allows users to specify whether the source objects used in a ComposeObject operation should be automatically deleted upon successful composition.
  • Integration with ComposeObjectRequest: The DeleteSourceObjects option has been integrated into the ComposeObjectRequest class, making it available for use when composing objects.
  • Comprehensive Integration Tests: Added two new integration tests, ComposeDeleteSourceObjectsFalse and ComposeDeleteSourceObjectsTrue, to thoroughly verify the correct behavior of the new option under both conditions.
Changelog
  • google/cloud/storage/internal/object_requests.h
    • Modified ComposeObjectRequest to accept the new DeleteSourceObjects parameter, extending its functionality.
  • google/cloud/storage/tests/object_rewrite_integration_test.cc
    • Added ComposeDeleteSourceObjectsFalse test case to verify that source objects are retained when DeleteSourceObjects is set to false.
    • Added ComposeDeleteSourceObjectsTrue test case to confirm that source objects are correctly deleted when DeleteSourceObjects is set to true.
  • google/cloud/storage/well_known_parameters.h
    • Defined the new DeleteSourceObjects struct, inheriting from WellKnownParameter, to encapsulate the boolean option for deleting source objects.
Activity
  • No specific activity (comments, reviews, or progress updates) has been recorded for this pull request yet.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@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 DeleteSourceObjects option for ComposeObjectRequest, allowing users to control whether source objects are deleted upon successful composition. The implementation correctly adds the new well-known parameter and integrates it into the request object. The functionality is well-tested with new integration tests covering both true and false cases for the option. I have one minor suggestion to improve the clarity of the documentation for the new option.

/**
* Controls if the source objects are deleted after a successful composition.
*
* By default requests source objects are not deleted. Set this option to

Choose a reason for hiding this comment

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

medium

The phrasing in this comment is a bit awkward. It can be made clearer for better readability in the public API documentation.

 * By default, source objects are not deleted. Set this option to

@bajajneha27
Copy link
Contributor

/gcbrun

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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants