Skip to content

Comments

Bucket Encryption Config#52

Open
shubhangi-google wants to merge 5 commits intomainfrom
bucket_encryption_config_1
Open

Bucket Encryption Config#52
shubhangi-google wants to merge 5 commits intomainfrom
bucket_encryption_config_1

Conversation

@shubhangi-google
Copy link
Owner

Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly:

  • Make sure to open an issue as a bug/issue before writing your code! That way we can discuss the change, evaluate designs, and agree on the general idea.
  • Follow the instructions in CONTRIBUTING. Most importantly, ensure the tests and linter pass by running bundle exec rake ci in the gem subdirectory.
  • Update code documentation if necessary.

closes: #<issue_number_goes_here>

@gemini-code-assist
Copy link

Summary of Changes

Hello @shubhangi-google, 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 introduces comprehensive support for managing bucket encryption enforcement configurations within the google-cloud-storage Ruby client library. It provides new API methods to configure and enforce encryption policies for customer-managed, customer-supplied, and Google-managed keys directly on storage buckets. The changes also include new code samples and acceptance tests to ensure proper usage and functionality of these new encryption features.

Highlights

  • New Encryption Configuration APIs: Added new methods to the Bucket class in google-cloud-storage to manage customer-managed, customer-supplied, and Google-managed encryption enforcement configurations.
  • New Samples for Encryption Configuration: Introduced new sample files demonstrating how to set, retrieve, and remove various bucket encryption enforcement configurations.
  • Acceptance Tests: Included new acceptance tests to validate the functionality of setting, getting, and removing bucket encryption enforcement configurations.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • google-cloud-storage/lib/google/cloud/storage/bucket.rb
    • Added customer_managed_encryption_enforcement_config getter and setter methods.
    • Added customer_supplied_encryption_enforcement_config getter and setter methods.
    • Added google_managed_encryption_enforcement_config getter and setter methods.
  • google-cloud-storage/samples/acceptance/buckets_test.rb
    • Added require_relative statements for new encryption enforcement config samples.
    • Included a new acceptance test suite for setting, getting, and removing encryption enforcement configurations.
  • google-cloud-storage/samples/storage_get_encryption_enforcement_config.rb
    • Added a new sample file to demonstrate retrieving bucket encryption enforcement configurations.
  • google-cloud-storage/samples/storage_remove_all_encryption_enforcement_config.rb
    • Added a new sample file to demonstrate removing all bucket encryption enforcement configurations.
  • google-cloud-storage/samples/storage_set_encryption_enforcement_config.rb
    • Added a new sample file to demonstrate setting bucket encryption enforcement configurations.
Activity
  • No specific activity (comments, reviews, etc.) 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 new functionality for managing bucket encryption enforcement configurations. I've identified a critical issue in the core logic within bucket.rb where setting one configuration property inadvertently overwrites others. I've provided suggestions to rectify this. Additionally, I found some copy-paste errors in the documentation, a potential crash in one of the new sample files due to not handling nil values, and an opportunity to make another sample more efficient by batching API calls. Addressing these points will improve the robustness and correctness of the new feature.

@shubhangi-google
Copy link
Owner Author

/gemini review

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 adds support for configuring bucket encryption enforcement for customer-managed, customer-supplied, and Google-managed keys. The changes include adding accessor methods on the Bucket class, acceptance tests for the new functionality, and sample scripts demonstrating how to use it. The implementation looks good overall. I've found a few minor issues in the documentation and sample code, including a potential crash in one of the samples if an encryption config is not set. Please see my detailed comments for suggestions.

@shubhangi-google
Copy link
Owner Author

/gemini review

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 support for bucket encryption enforcement configurations. The changes are well-implemented, adding accessors to the Bucket class, along with comprehensive acceptance tests and usage samples. The code is clean and follows existing patterns. I've provided a few suggestions to improve the clarity of the API documentation for the new methods.

@shubhangi-google
Copy link
Owner Author

/gemini review

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

The pull request introduces new functionality for managing bucket encryption enforcement configurations (customer-managed, customer-supplied, and Google-managed). This includes adding getter and setter methods in the Bucket class, new acceptance tests, and sample code for setting, getting, and clearing these configurations. The changes are well-structured and follow the existing patterns in the codebase. I've identified a few areas for improvement regarding consistency and clarity in the documentation and test setup.

@gemini-code-assist
Copy link

Warning

Gemini encountered an error creating the review. You can try again by commenting /gemini review.

bucket = storage.create_bucket bucket_name do |b|
b.customer_managed_encryption_enforcement_config = customer_managed_config
b.customer_supplied_encryption_enforcement_config = customer_supplied_config
b.google_managed_encryption_enforcement_config = google_managed_config
Copy link
Collaborator

@gurusai-voleti gurusai-voleti Feb 24, 2026

Choose a reason for hiding this comment

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

add kms_key sample also

Copy link
Owner Author

Choose a reason for hiding this comment

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants