feat(secretmanager): Add secret rotation samples#3296
feat(secretmanager): Add secret rotation samples#3296khilan-crest wants to merge 37 commits intoGoogleCloudPlatform:mainfrom
Conversation
…lan-crest/dotnet-docs-samples into cs_filter_cmek_samples
…est/dotnet-docs-samples into cs_expiretime_samples
Summary of ChangesHello @khilan-crest, 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 significantly enhances the C# client library for Google Cloud Secret Manager by introducing a wide array of new code samples. These samples aim to provide developers with clear, practical examples for advanced secret management functionalities, including automated secret rotation, time-based expiration, integration with resource tags for better organization, and the use of Customer-Managed Encryption Keys for enhanced security. The additions also cover improved secret discoverability through filtered listing operations and comprehensive metadata management. Highlights
Using Gemini Code AssistThe 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
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 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
|
There was a problem hiding this comment.
Code Review
This pull request adds a comprehensive set of samples and tests for secret rotation and related features in Secret Manager. The additions are valuable. However, there are several critical issues in the tests that need to be addressed:
- Many of the new tests rely on helper methods in the test fixtures (e.g.,
CreateSecretWithExpireTime,CreateSecretWithRotation) which have not been implemented. This will cause compilation failures. These helper methods need to be added toSecretManagerFixtureandRegionalSecretManagerFixture. - Several tests create resources (secrets, tags) but fail to clean them up, which will lead to resource leaks in the test project.
- There's a bug in
DeleteSecretExpirationTestswhere the wrong secret is deleted. - A few other minor issues like incorrect logging, exception handling, and filename mismatches are also present.
I've added specific comments on the relevant files. Addressing these issues will improve the correctness and reliability of the new samples and tests.
secretmanager/api/SecretManager.Samples.Tests/DeleteSecretAnnotationTests.cs
Show resolved
Hide resolved
secretmanager/api/SecretManager.Samples.Tests/DeleteSecretExpirationTests.cs
Show resolved
Hide resolved
secretmanager/api/SecretManager.Samples.Tests/DeleteSecretExpirationTests.cs
Outdated
Show resolved
Hide resolved
secretmanager/api/SecretManager.Samples.Tests/BindTagToRegionalSecretTests.cs
Show resolved
Hide resolved
secretmanager/api/SecretManager.Samples.Tests/DetachRegionalTagBindingTests.cs
Outdated
Show resolved
Hide resolved
…est/dotnet-docs-samples into cs_expiretime_samples
…et-docs-samples into cs_rotation_samples
…lan-crest/dotnet-docs-samples into cs_filter_cmek_samples
…est/dotnet-docs-samples into cs_expiretime_samples
…lan-crest/dotnet-docs-samples into cs_filter_cmek_samples
…est/dotnet-docs-samples into cs_expiretime_samples
…et-docs-samples into cs_rotation_samples
…et-docs-samples into cs_rotation_samples
…et-docs-samples into cs_rotation_samples
Add secret rotation samples