discoveryengine: fix TestAccDiscoveryEngineDataStore_discoveryengineDatastoreKmsKeyNameExample - #18829
Conversation
|
/gcbrun |
|
Hi there, I'm the Modular magician. I've detected the following information about your changes for commit a4ee698: Diff reportYour PR generated the following diffs in downstream repositories:
Test reportAnalytics
Affected Service Packages
Step 1: Replaying Mode Action takenFound 1 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
View the replaying VCR build log Step 2: Recording Mode
Caution Issues requiring attention before PR completion 🔴 Initial Recording Failed: Some tests failed during the recording step. See the table above for details. Please address these issues to complete your PR. If you believe these detections are incorrect or unrelated to your change, please raise the concern with your reviewer. View the recording VCR build log or the debug logs folder for detailed results. @SirGitsalot VCR tests complete for a4ee698! |
a4ee698 to
997c897
Compare
|
Hi there, I'm the Modular magician. I've detected the following information about your changes for commit 997c897: Diff reportYour PR generated the following diffs in downstream repositories:
Test reportAnalytics
Affected Service Packages
Step 1: Replaying Mode Action takenFound 1 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
View the replaying VCR build log Step 2: Recording Mode
Caution Issues requiring attention before PR completion 🔴 Initial Recording Failed: Some tests failed during the recording step. See the table above for details. Please address these issues to complete your PR. If you believe these detections are incorrect or unrelated to your change, please raise the concern with your reviewer. View the recording VCR build log or the debug logs folder for detailed results. @SirGitsalot VCR tests complete for 997c897! |
…atastoreKmsKeyNameExample
997c897 to
a6d6697
Compare
|
Hi there, I'm the Modular magician. I've detected the following information about your changes for commit a6d6697: Diff reportYour PR generated the following diffs in downstream repositories:
Test reportAnalytics
Affected Service Packages
Step 1: Replaying Mode Action takenFound 16 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
View the replaying VCR build log Step 2: Recording Mode
Caution Issues requiring attention before PR completion 🔴 Initial Recording Failed: Some tests failed during the recording step. See the table above for details. 🔴 Replaying Rerun Failed: Some tests failed due to non-determinism when VCR replayed the response. See the table above for details. Please address these issues to complete your PR. If you believe these detections are incorrect or unrelated to your change, please raise the concern with your reviewer. View the recording VCR build log or the debug logs folder for detailed results. @SirGitsalot VCR tests complete for a6d6697! |
Fixes nightly acceptance test failure for
TestAccDiscoveryEngineDataStore_discoveryengineDatastoreKmsKeyNameExample.Root Cause & Fix
google_discovery_engine_data_storewithkms_key_namerequires an associatedCmekConfigin theACTIVEstate for that KMS key. Without an activeCmekConfig, the backend failsCreateDataStorewithFAILED_PRECONDITIONor404 KMS key not found.tftest-shared-key-1was previously mapped in the shared test project to a deletedCmekConfig, causing tests using that key to fail with:CmekConfig projects/.../locations/us/cmekConfigs/tftest-shared-cmekconfig-1 is in the DELETED state but should be in the ACTIVE state to create DataStores.There are currently 1 datastore(s) connected to this CmekConfig. Please delete these datastores before trying to delete the CmekConfig.Adding a retry predicate allows Terraform to retry the deletion until the DataStore detachment propagates.
This PR:
mmv1/templates/terraform/samples/services/discoveryengine/discoveryengine_datastore_kms_key_name.tf.tmplto:data "google_project" "project" {}.roles/cloudkms.cryptoKeyEncrypterDecrypteron the KMS key to the Discovery Engine service account (service-${data.google_project.project.number}@gcp-sa-discoveryengine.iam.gserviceaccount.com).google_discovery_engine_cmek_configfor the KMS key before creating the DataStore (depends_on = [google_discovery_engine_cmek_config.default]).mmv1/products/discoveryengine/DataStore.yamlto:cmek_config_id: 'cmek-config-id'toresource_id_vars.kms_key_nameto usekms.BootstrapKMSKeyWithPurposeInLocationAndName(t, "ENCRYPT_DECRYPT", "us", "tftest-shared-key-5").CryptoKey.Name(matching the bootstrap key used by the passing CMEK config tests).IsDiscoveryEngineCmekConfigInUseErrorretry predicate tommv1/third_party/terraform/transport/error_retry_predicates.goand registers it inmmv1/products/discoveryengine/CmekConfig.yamlto handle eventual consistency on deletion.