feat(storage): add support for object context by shubhangi-google · Pull Request #32902 · googleapis/google-cloud-ruby

This pull request introduces new functionality to the Google::Cloud::Storage::File class, enabling direct manipulation of an object's context. This enhancement provides greater control over file metadata, facilitating more nuanced data management within Google Cloud Storage.

Highlights

  • Object Contexts Support: Introduced comprehensive support for Google Cloud Storage Object Contexts, allowing users to attach custom key-value pairs to objects for enhanced metadata management.
  • Listing and Filtering: Added the ability to filter object listings based on Object Contexts, supporting queries for presence, absence, existence, and non-existence of specific context keys or key-value pairs.
  • Input Validation: Implemented validation to prevent the use of forbidden characters (double quotes) in Object Context keys and values, ensuring compatibility with GCS filter string syntax.
  • System and Unit Tests: Expanded test coverage with new system and unit tests to verify the functionality of Object Contexts across various scenarios, including creation, updates, copying, combining, and filtering.