feat(storage): add feature flag and models for appendable upload#5631
feat(storage): add feature flag and models for appendable upload#5631vsharonlynn wants to merge 1 commit intogoogleapis:mainfrom
Conversation
There was a problem hiding this comment.
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), |
There was a problem hiding this comment.
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
- 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.
- 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.
| #[non_exhaustive] | ||
| pub struct AppendObjectRequest { |
There was a problem hiding this comment.
| pub(crate) mod client; | ||
| pub(crate) mod common_options; | ||
| #[cfg(google_cloud_unstable_storage_appendable_upload)] | ||
| pub mod append_object; |
There was a problem hiding this comment.
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.
| pub mod append_object; | |
| pub(crate) mod append_object; |
References
- Follow local standards: Maintain patterns consistent with existing code. Most internal logic modules in this crate use pub(crate) visibility. (link)
Codecov Report✅ All modified and coverable lines are covered by tests. 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. 🚀 New features to boost your workflow:
|
Introduces the `google_cloud_unstable_storage_appendable_upload` feature flag to gate the upcoming GCS Appendable Uploads functionality.
144a189 to
3deeb71
Compare
Introduces the
google_cloud_unstable_storage_appendable_uploadfeature flag to gate the upcoming GCS Appendable Upload functionality.