Skip to content

feat(storage): add feature flag and models for appendable upload#5631

Draft
vsharonlynn wants to merge 1 commit intogoogleapis:mainfrom
vsharonlynn:feat/storage-appendable-upload
Draft

feat(storage): add feature flag and models for appendable upload#5631
vsharonlynn wants to merge 1 commit intogoogleapis:mainfrom
vsharonlynn:feat/storage-appendable-upload

Conversation

@vsharonlynn
Copy link
Copy Markdown
Contributor

Introduces the google_cloud_unstable_storage_appendable_upload feature flag to gate the upcoming GCS Appendable Upload functionality.

@product-auto-label product-auto-label Bot added the api: storage Issues related to the Cloud Storage API. label May 8, 2026
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 the initial infrastructure for appendable object uploads in the storage crate, gated by a new unstable configuration flag. The changes include updates to build triggers, lint configurations, and the addition of new data structures and modules. Feedback focuses on maintaining SDK consistency by using ergonomic model types instead of raw proto types, applying #[allow(dead_code)] to structs used only in mocks to prevent compiler warnings, and restricting module visibility to pub(crate) to align with existing internal modules.

/// Create a new appendable object.
Create(crate::model::WriteObjectSpec),
/// Take over an existing appendable object.
Takeover(crate::google::storage::v2::AppendObjectSpec),
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

The Takeover variant uses the raw proto type crate::google::storage::v2::AppendObjectSpec, whereas the Create variant uses the ergonomic model type crate::model::WriteObjectSpec. To maintain consistency and follow the SDK's pattern of abstracting internal proto types, AppendObjectSpec should be modeled in crate::model and used here instead of the raw proto type. Note that a feature does not have to be fully implemented in a single pull request if the remaining work is documented in the PR description or as a TODO comment in the code.

References
  1. Maintain patterns consistent with existing crates like auth and gax. In this SDK, types in model_ext.rs should generally use or wrap types from crate::model rather than exposing raw proto types directly.
  2. A feature does not have to be fully implemented in a single pull request if the remaining work is documented in the PR description or as a TODO comment in the code, allowing for continuous improvement.

Comment on lines +331 to +332
#[non_exhaustive]
pub struct AppendObjectRequest {
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

This struct is documented as being "only used in mocks", similar to WriteObjectRequest. It should include #[allow(dead_code)] to avoid compiler warnings in production builds where the mocks are not active.

#[non_exhaustive]
#[allow(dead_code)]
pub struct AppendObjectRequest {

pub(crate) mod client;
pub(crate) mod common_options;
#[cfg(google_cloud_unstable_storage_appendable_upload)]
pub mod append_object;
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

The append_object module is declared as pub, but most other internal modules in this file (e.g., write_object, read_object, bidi) are pub(crate). Unless this module is intended to be part of the public API surface (which is typically exposed through the Storage client or builders), it should be pub(crate) for consistency and better encapsulation.

Suggested change
pub mod append_object;
pub(crate) mod append_object;
References
  1. Follow local standards: Maintain patterns consistent with existing code. Most internal logic modules in this crate use pub(crate) visibility. (link)

@codecov
Copy link
Copy Markdown

codecov Bot commented May 8, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.76%. Comparing base (e199cf6) to head (3deeb71).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5631      +/-   ##
==========================================
- Coverage   97.76%   97.76%   -0.01%     
==========================================
  Files         221      221              
  Lines       51115    51115              
==========================================
- Hits        49973    49972       -1     
- Misses       1142     1143       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Introduces the `google_cloud_unstable_storage_appendable_upload` feature
flag to gate the upcoming GCS Appendable Uploads functionality.
@vsharonlynn vsharonlynn force-pushed the feat/storage-appendable-upload branch from 144a189 to 3deeb71 Compare May 8, 2026 06:12
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.

1 participant