Skip to content

feat(cloudkms): add samples for CryptoKey/CryptoKeyVersion deletion and get/lists RetiredResources#2189

Open
yasharel wants to merge 4 commits intoGoogleCloudPlatform:mainfrom
yasharel:kms-deletion-samples
Open

feat(cloudkms): add samples for CryptoKey/CryptoKeyVersion deletion and get/lists RetiredResources#2189
yasharel wants to merge 4 commits intoGoogleCloudPlatform:mainfrom
yasharel:kms-deletion-samples

Conversation

@yasharel
Copy link
Member

@yasharel yasharel commented Feb 24, 2026

Add code samples for CryptoKey/CryptoKeyVersion deletion and get/lists RetiredResources

@yasharel yasharel requested review from a team as code owners February 24, 2026 17:02
@snippet-bot
Copy link

snippet-bot bot commented Feb 24, 2026

Here is the summary of changes.

You are about to add 4 region tags.

This comment is generated by snippet-bot.
If you find problems with this result, please file an issue at:
https://github.com/googleapis/repo-automation-bots/issues.
To update this comment, add snippet-bot:force-run label or use the checkbox below:

  • Refresh this comment

@product-auto-label product-auto-label bot added api: cloudkms Issues related to the Cloud Key Management Service API. samples Issues that are directly related to samples. labels Feb 24, 2026
@gemini-code-assist
Copy link

Summary of Changes

Hello @yasharel, 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 enhances the Google Cloud KMS PHP samples by providing new examples for managing the lifecycle of cryptographic resources. It introduces functionality to programmatically delete CryptoKeys and CryptoKeyVersions, and to query for resources that have been retired. These additions provide developers with practical code demonstrations for key management operations and auditing capabilities within KMS.

Highlights

  • New KMS Samples: Added new PHP samples for deleting CryptoKeys and CryptoKeyVersions within Google Cloud KMS.
  • Retired Resources Management: Introduced new PHP samples to demonstrate how to get and list retired resources in Cloud KMS.
  • Expanded Test Coverage: Included new unit tests to validate the functionality of CryptoKey deletion and retired resource retrieval and listing.
Changelog
  • kms/src/delete_crypto_key.php
    • Added a new sample to demonstrate deleting a CryptoKey.
  • kms/src/delete_crypto_key_version.php
    • Added a new sample to demonstrate deleting a CryptoKeyVersion.
  • kms/src/get_retired_resource.php
    • Added a new sample to demonstrate getting a specific retired resource.
  • kms/src/list_retired_resources.php
    • Added a new sample to demonstrate listing all retired resources.
  • kms/test/kmsTest.php
    • Added new use statements for DeleteCryptoKeyRequest, ListRetiredResourcesRequest, and GetCryptoKeyRequest.
    • Added a new test case testDeleteCryptoKey to verify CryptoKey deletion.
    • Added a new test case testListAndGetRetiredResource to verify listing and retrieving retired resources.
    • Added a skipped test case testDeleteCryptoKeyVersion due to complexity.
Activity
  • New PHP samples were added for Cloud KMS operations.
  • Corresponding unit tests were implemented to ensure the correctness of the new samples.
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

The pull request introduces new samples for deleting CryptoKeys and CryptoKeyVersions, and for listing and getting retired resources in Google Cloud KMS. The changes include new PHP files for each sample and corresponding unit tests to verify their functionality. The code appears to be well-structured and follows the existing patterns in the repository. The tests cover the basic functionality of the new samples, ensuring they integrate correctly with the KMS client library.

@yasharel yasharel force-pushed the kms-deletion-samples branch from a7f7a5f to 37c0c7a Compare February 24, 2026 17:07
@yasharel yasharel force-pushed the kms-deletion-samples branch from 37c0c7a to 1d4764d Compare February 24, 2026 17:14
@yasharel yasharel marked this pull request as draft February 24, 2026 18:24
@yasharel yasharel marked this pull request as ready for review February 25, 2026 19:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api: cloudkms Issues related to the Cloud Key Management Service API. samples Issues that are directly related to samples.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant