Skip to content

Add a new resource CmekConfig. #13419

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 31 commits into
base: main
Choose a base branch
from

Conversation

jialei-chen
Copy link
Member

Release Note Template for Downstream PRs (will be copied)

See Write release notes for guidance.

`google_discovery_engine_cmek_config`

@github-actions github-actions bot requested a review from shuyama1 March 20, 2025 21:49
Copy link

Hello! I am a robot. Tests will require approval from a repository maintainer to run. Googlers: see go/terraform-auto-test-runs to set up automatic test runs.

@shuyama1, a repository maintainer, has been assigned to review your changes. If you have not received review feedback within 2 business days, please leave a comment on this PR asking them to take a look.

You can help make sure that review is quick by doing a self-review and by running impacted tests locally.

@modular-magician
Copy link
Collaborator

Hi there, I'm the Modular magician. I've detected the following information about your changes:

Diff report

Your PR generated some diffs in downstreams - here they are.

google provider: Diff ( 5 files changed, 865 insertions(+), 2 deletions(-))
google-beta provider: Diff ( 5 files changed, 865 insertions(+), 2 deletions(-))
terraform-google-conversion: Diff ( 1 file changed, 113 insertions(+))

Missing test report

Your PR includes resource fields which are not covered by any test.

Resource: google_discovery_engine_cmek_config (0 total tests)
Please add an acceptance test which includes these fields. The test should include the following:

resource "google_discovery_engine_cmek_config" "primary" {
  kms_key         = # value needed
  kms_key_version = # value needed
  location        = # value needed
  single_region_keys {
    kms_key = # value needed
  }
}

1 similar comment
@modular-magician
Copy link
Collaborator

Hi there, I'm the Modular magician. I've detected the following information about your changes:

Diff report

Your PR generated some diffs in downstreams - here they are.

google provider: Diff ( 5 files changed, 865 insertions(+), 2 deletions(-))
google-beta provider: Diff ( 5 files changed, 865 insertions(+), 2 deletions(-))
terraform-google-conversion: Diff ( 1 file changed, 113 insertions(+))

Missing test report

Your PR includes resource fields which are not covered by any test.

Resource: google_discovery_engine_cmek_config (0 total tests)
Please add an acceptance test which includes these fields. The test should include the following:

resource "google_discovery_engine_cmek_config" "primary" {
  kms_key         = # value needed
  kms_key_version = # value needed
  location        = # value needed
  single_region_keys {
    kms_key = # value needed
  }
}

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 14
Passed tests: 0
Skipped tests: 0
Affected tests: 14

Click here to see the affected service packages
  • discoveryengine

Action taken

Found 14 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
  • TestAccDiscoveryEngineChatEngine_discoveryengineChatEngineBasicExample
  • TestAccDiscoveryEngineChatEngine_discoveryengineChatEngineExistingDialogflowAgentExample
  • TestAccDiscoveryEngineChatEngine_discoveryengineChatengine_update
  • TestAccDiscoveryEngineDataStore_discoveryengineDatastoreAdvancedSiteSearchConfigExample
  • TestAccDiscoveryEngineDataStore_discoveryengineDatastoreBasicExample
  • TestAccDiscoveryEngineDataStore_discoveryengineDatastoreBasicExample_update
  • TestAccDiscoveryEngineDataStore_discoveryengineDatastoreDocumentProcessingConfigExample
  • TestAccDiscoveryEngineDataStore_discoveryengineDatastoreDocumentProcessingConfigLayoutExample
  • TestAccDiscoveryEngineDataStore_discoveryengineDatastoreDocumentProcessingConfigOcrExample
  • TestAccDiscoveryEngineSchema_discoveryengineSchemaBasicExample
  • TestAccDiscoveryEngineSearchEngine_discoveryengineSearchengineBasicExample
  • TestAccDiscoveryEngineSearchEngine_discoveryengineSearchengineBasicExample_update
  • TestAccDiscoveryEngineTargetSite_discoveryengineTargetsiteAdvancedExample
  • TestAccDiscoveryEngineTargetSite_discoveryengineTargetsiteBasicExample

Get to know how VCR tests work

@modular-magician
Copy link
Collaborator

🔴 Tests failed during RECORDING mode:
TestAccDiscoveryEngineChatEngine_discoveryengineChatEngineBasicExample [Error message] [Debug log]
TestAccDiscoveryEngineChatEngine_discoveryengineChatEngineExistingDialogflowAgentExample [Error message] [Debug log]
TestAccDiscoveryEngineChatEngine_discoveryengineChatengine_update [Error message] [Debug log]
TestAccDiscoveryEngineDataStore_discoveryengineDatastoreAdvancedSiteSearchConfigExample [Error message] [Debug log]
TestAccDiscoveryEngineDataStore_discoveryengineDatastoreBasicExample [Error message] [Debug log]
TestAccDiscoveryEngineDataStore_discoveryengineDatastoreBasicExample_update [Error message] [Debug log]
TestAccDiscoveryEngineDataStore_discoveryengineDatastoreDocumentProcessingConfigExample [Error message] [Debug log]
TestAccDiscoveryEngineDataStore_discoveryengineDatastoreDocumentProcessingConfigLayoutExample [Error message] [Debug log]
TestAccDiscoveryEngineDataStore_discoveryengineDatastoreDocumentProcessingConfigOcrExample [Error message] [Debug log]
TestAccDiscoveryEngineSchema_discoveryengineSchemaBasicExample [Error message] [Debug log]
TestAccDiscoveryEngineSearchEngine_discoveryengineSearchengineBasicExample [Error message] [Debug log]
TestAccDiscoveryEngineSearchEngine_discoveryengineSearchengineBasicExample_update [Error message] [Debug log]
TestAccDiscoveryEngineTargetSite_discoveryengineTargetsiteAdvancedExample [Error message] [Debug log]
TestAccDiscoveryEngineTargetSite_discoveryengineTargetsiteBasicExample [Error message] [Debug log]

🔴 Errors occurred during RECORDING mode. Please fix them to complete your PR.

View the build log or the debug log for each test

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 14
Passed tests: 0
Skipped tests: 0
Affected tests: 14

Click here to see the affected service packages
  • discoveryengine

Action taken

Found 14 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
  • TestAccDiscoveryEngineChatEngine_discoveryengineChatEngineBasicExample
  • TestAccDiscoveryEngineChatEngine_discoveryengineChatEngineExistingDialogflowAgentExample
  • TestAccDiscoveryEngineChatEngine_discoveryengineChatengine_update
  • TestAccDiscoveryEngineDataStore_discoveryengineDatastoreAdvancedSiteSearchConfigExample
  • TestAccDiscoveryEngineDataStore_discoveryengineDatastoreBasicExample
  • TestAccDiscoveryEngineDataStore_discoveryengineDatastoreBasicExample_update
  • TestAccDiscoveryEngineDataStore_discoveryengineDatastoreDocumentProcessingConfigExample
  • TestAccDiscoveryEngineDataStore_discoveryengineDatastoreDocumentProcessingConfigLayoutExample
  • TestAccDiscoveryEngineDataStore_discoveryengineDatastoreDocumentProcessingConfigOcrExample
  • TestAccDiscoveryEngineSchema_discoveryengineSchemaBasicExample
  • TestAccDiscoveryEngineSearchEngine_discoveryengineSearchengineBasicExample
  • TestAccDiscoveryEngineSearchEngine_discoveryengineSearchengineBasicExample_update
  • TestAccDiscoveryEngineTargetSite_discoveryengineTargetsiteAdvancedExample
  • TestAccDiscoveryEngineTargetSite_discoveryengineTargetsiteBasicExample

Get to know how VCR tests work

@modular-magician
Copy link
Collaborator

🔴 Tests failed during RECORDING mode:
TestAccDiscoveryEngineChatEngine_discoveryengineChatEngineBasicExample [Error message] [Debug log]
TestAccDiscoveryEngineChatEngine_discoveryengineChatEngineExistingDialogflowAgentExample [Error message] [Debug log]
TestAccDiscoveryEngineChatEngine_discoveryengineChatengine_update [Error message] [Debug log]
TestAccDiscoveryEngineDataStore_discoveryengineDatastoreAdvancedSiteSearchConfigExample [Error message] [Debug log]
TestAccDiscoveryEngineDataStore_discoveryengineDatastoreBasicExample [Error message] [Debug log]
TestAccDiscoveryEngineDataStore_discoveryengineDatastoreBasicExample_update [Error message] [Debug log]
TestAccDiscoveryEngineDataStore_discoveryengineDatastoreDocumentProcessingConfigExample [Error message] [Debug log]
TestAccDiscoveryEngineDataStore_discoveryengineDatastoreDocumentProcessingConfigLayoutExample [Error message] [Debug log]
TestAccDiscoveryEngineDataStore_discoveryengineDatastoreDocumentProcessingConfigOcrExample [Error message] [Debug log]
TestAccDiscoveryEngineSchema_discoveryengineSchemaBasicExample [Error message] [Debug log]
TestAccDiscoveryEngineSearchEngine_discoveryengineSearchengineBasicExample [Error message] [Debug log]
TestAccDiscoveryEngineSearchEngine_discoveryengineSearchengineBasicExample_update [Error message] [Debug log]
TestAccDiscoveryEngineTargetSite_discoveryengineTargetsiteAdvancedExample [Error message] [Debug log]
TestAccDiscoveryEngineTargetSite_discoveryengineTargetsiteBasicExample [Error message] [Debug log]

🔴 Errors occurred during RECORDING mode. Please fix them to complete your PR.

View the build log or the debug log for each test

@jialei-chen
Copy link
Member Author

Hi reviewer, our resource CmekConfig only has Update/Get/List/Delete methods but doesn't have a Create method. I have 2 questions about the implementation. Could you help take a look? Thanks!

  1. Per https://googlecloudplatform.github.io/magic-modules/develop/add-resource/#add-a-resource-1, can we add a new resource leaving field create_url unset and only support update/get/list/delete operations?
  2. Per https://googlecloudplatform.github.io/magic-modules/test/test/#add-an-update-test, I tried to add an update test, but an update test is create-then-update. How to add an update test without create operation?

@modular-magician
Copy link
Collaborator

Hi there, I'm the Modular magician. I've detected the following information about your changes:

Diff report

Your PR generated some diffs in downstreams - here they are.

google provider: Diff ( 5 files changed, 864 insertions(+), 2 deletions(-))
google-beta provider: Diff ( 5 files changed, 864 insertions(+), 2 deletions(-))
terraform-google-conversion: Diff ( 1 file changed, 113 insertions(+))

Missing test report

Your PR includes resource fields which are not covered by any test.

Resource: google_discovery_engine_cmek_config (0 total tests)
Please add an acceptance test which includes these fields. The test should include the following:

resource "google_discovery_engine_cmek_config" "primary" {
  kms_key         = # value needed
  kms_key_version = # value needed
  location        = # value needed
  single_region_keys {
    kms_key = # value needed
  }
}

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 14
Passed tests: 14
Skipped tests: 0
Affected tests: 0

Click here to see the affected service packages
  • discoveryengine

🟢 All tests passed!

View the build log

Copy link

@shuyama1 This PR has been waiting for review for 3 weekdays. Please take a look! Use the label disable-review-reminders to disable these notifications.

Copy link
Member

@shuyama1 shuyama1 left a comment

Choose a reason for hiding this comment

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

Hi reviewer, our resource CmekConfig only has Update/Get/List/Delete methods but doesn't have a Create method. I have 2 questions about the implementation. Could you help take a look? Thanks!

  1. Per googlecloudplatform.github.io/magic-modules/develop/add-resource#add-a-resource-1, can we add a new resource leaving field create_url unset and only support update/get/list/delete operations?

Is this a pre-created resource that only allows update. I think you can set the create_url and create_verb to be the one used to update this resource. So basically creating the resource in Terraform is actually updating the resource.
Here's an example: https://github.com/GoogleCloudPlatform/magic-modules/blob/main/mmv1/products/kms/AutokeyConfig.yaml

  1. Per googlecloudplatform.github.io/magic-modules/test/test#add-an-update-test, I tried to add an update test, but an update test is create-then-update. How to add an update test without create operation?

I believe after you've done question 1, this should be working fine.

I hope these answer your questions.

@github-actions github-actions bot requested a review from shuyama1 April 1, 2025 00:58
@modular-magician
Copy link
Collaborator

Hi there, I'm the Modular magician. I've detected the following information about your changes:

Diff report

Your PR generated some diffs in downstreams - here they are.

google provider: Diff ( 5 files changed, 915 insertions(+), 2 deletions(-))
google-beta provider: Diff ( 5 files changed, 915 insertions(+), 2 deletions(-))
terraform-google-conversion: Diff ( 1 file changed, 113 insertions(+))

Missing test report

Your PR includes resource fields which are not covered by any test.

Resource: google_discovery_engine_cmek_config (0 total tests)
Please add an acceptance test which includes these fields. The test should include the following:

resource "google_discovery_engine_cmek_config" "primary" {
  kms_key         = # value needed
  kms_key_version = # value needed
  location        = # value needed
  single_region_keys {
    kms_key = # value needed
  }
}

@jialei-chen
Copy link
Member Author

jialei-chen commented Apr 1, 2025

Hi reviewer, our resource CmekConfig only has Update/Get/List/Delete methods but doesn't have a Create method. I have 2 questions about the implementation. Could you help take a look? Thanks!

  1. Per googlecloudplatform.github.io/magic-modules/develop/add-resource#add-a-resource-1, can we add a new resource leaving field create_url unset and only support update/get/list/delete operations?

Is this a pre-created resource that only allows update. I think you can set the create_url and create_verb to be the one used to update this resource. So basically creating the resource in Terraform is actually updating the resource. Here's an example: https://github.com/GoogleCloudPlatform/magic-modules/blob/main/mmv1/products/kms/AutokeyConfig.yaml

  1. Per googlecloudplatform.github.io/magic-modules/test/test#add-an-update-test, I tried to add an update test, but an update test is create-then-update. How to add an update test without create operation?

I believe after you've done question 1, this should be working fine.

I hope these answer your questions.

Thanks for your answers!
Confirmed with resource owner, the update API is also used for create operation. Will set the create_url and create_verb following the given example and add test cases correspondingly.

I'm adding the create test now, but getting blocked by an ESF routing issue b/359238429#comment15. Temporarily waiting until the issue is fixed.

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 15
Passed tests: 15
Skipped tests: 0
Affected tests: 0

Click here to see the affected service packages
  • discoveryengine

🟢 All tests passed!

View the build log

Copy link
Member

@shuyama1 shuyama1 left a comment

Choose a reason for hiding this comment

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

Would you mind adding tests for this resource following https://googlecloudplatform.github.io/magic-modules/test/test/#add-resource-tests?

Sorry if you're still working on this PR. No rush! I'm just sending out this review message to disable the review-reminder for this round. Thanks!

@github-actions github-actions bot requested a review from shuyama1 April 4, 2025 21:25
@modular-magician
Copy link
Collaborator

Hi there, I'm the Modular magician. I've detected the following information about your changes:

Diff report

Your PR generated some diffs in downstreams - here they are.

google provider: Diff ( 5 files changed, 915 insertions(+), 2 deletions(-))
google-beta provider: Diff ( 5 files changed, 915 insertions(+), 2 deletions(-))
terraform-google-conversion: Diff ( 1 file changed, 113 insertions(+))

Missing test report

Your PR includes resource fields which are not covered by any test.

Resource: google_discovery_engine_cmek_config (0 total tests)
Please add an acceptance test which includes these fields. The test should include the following:

resource "google_discovery_engine_cmek_config" "primary" {
  kms_key         = # value needed
  kms_key_version = # value needed
  location        = # value needed
  single_region_keys {
    kms_key = # value needed
  }
}

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 15
Passed tests: 15
Skipped tests: 0
Affected tests: 0

Click here to see the affected service packages
  • discoveryengine

🟢 All tests passed!

View the build log

@shuyama1
Copy link
Member

shuyama1 commented Apr 7, 2025

@jialei-chen I'm moving this PR to draft as it's awaiting test coverage (assuming currently blocked by some internal issues). Setting it to draft disables the review-reminder for now to avoid noise.
Please add the tests once unblocked and mark this PR as Ready for Review. I'll start the review then. Thank you!

@shuyama1 shuyama1 marked this pull request as draft April 7, 2025 18:00
@modular-magician
Copy link
Collaborator

🟢 Tests passed during RECORDING mode:
TestAccDiscoveryEngineCmekConfig_discoveryengineCmekconfigDefaultExample [Debug log]

🟢 No issues found for passed tests after REPLAYING rerun.


🔴 Tests failed during RECORDING mode:
TestAccDiscoveryEngineCmekConfig_discoveryengineCmekconfigDefaultExample_update [Error message] [Debug log]

🔴 Errors occurred during RECORDING mode. Please fix them to complete your PR.

View the build log or the debug log for each test

@jialei-chen
Copy link
Member Author

Error: Test case TestAccDiscoveryEngineCmekConfig_discoveryengineCmekconfigDefaultExample_update failed. Checked its [Error message] and [Debug log], the update operation failed for "Field "kms_key_name" is a required field, but no value is found."

Debugging: Since we don't have CreateCmekConfig API, and use UpdateCmekConfig API for both create and update operation. Field "kms_key_name" is required and immutable. When updating with update_verb: 'PATCH', the immutable "kms_key_name" is ignored and is missing, thus generating error.

Solution: Per our API definition proto, the HTTP verb for update should be PATCH. But due to our API limitation (using UpdateCmekConfig API for both create and update operation), I think I should set update_verb: 'PUT'.

@modular-magician
Copy link
Collaborator

Hi there, I'm the Modular magician. I've detected the following information about your changes:

Diff report

Your PR generated some diffs in downstreams - here they are.

google provider: Diff ( 7 files changed, 1137 insertions(+), 2 deletions(-))
google-beta provider: Diff ( 7 files changed, 1137 insertions(+), 2 deletions(-))
terraform-google-conversion: Diff ( 1 file changed, 103 insertions(+))
Open in Cloud Shell: Diff ( 4 files changed, 106 insertions(+))

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 19
Passed tests: 18
Skipped tests: 0
Affected tests: 1

Click here to see the affected service packages
  • discoveryengine
#### Action taken
Found 1 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
  • TestAccDiscoveryEngineCmekConfig_discoveryengineCmekconfigDefaultExample_update

Get to know how VCR tests work

@modular-magician
Copy link
Collaborator

🔴 Tests failed during RECORDING mode:
TestAccDiscoveryEngineCmekConfig_discoveryengineCmekconfigDefaultExample_update [Error message] [Debug log]

🔴 Errors occurred during RECORDING mode. Please fix them to complete your PR.

View the build log or the debug log for each test

@modular-magician
Copy link
Collaborator

Hi there, I'm the Modular magician. I've detected the following information about your changes:

Diff report

Your PR generated some diffs in downstreams - here they are.

google provider: Diff ( 7 files changed, 1131 insertions(+), 2 deletions(-))
google-beta provider: Diff ( 7 files changed, 1131 insertions(+), 2 deletions(-))
terraform-google-conversion: Diff ( 1 file changed, 103 insertions(+))
Open in Cloud Shell: Diff ( 4 files changed, 106 insertions(+))

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 19
Passed tests: 18
Skipped tests: 0
Affected tests: 1

Click here to see the affected service packages
  • discoveryengine
#### Action taken
Found 1 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
  • TestAccDiscoveryEngineCmekConfig_discoveryengineCmekconfigDefaultExample_update

Get to know how VCR tests work

@modular-magician
Copy link
Collaborator

🔴 Tests failed during RECORDING mode:
TestAccDiscoveryEngineCmekConfig_discoveryengineCmekconfigDefaultExample_update [Error message] [Debug log]

🔴 Errors occurred during RECORDING mode. Please fix them to complete your PR.

View the build log or the debug log for each test

@jialei-chen
Copy link
Member Author

Error: I checked the latest [Error message] and [Debug log], the returned error is "Precondition check failed."

Debugging: It's not informative, but I feel the possible root cause should be "Attempted to create an Astro corpus 'xxxx' that is currently being deleted. This is likely due to a race condition between create and delete pipelines. Code: FAILED_PRECONDITION". CmekConfig related operations are expensive. Deleting a CmekConfig (an operation from previous VCR test) takes long since its dependency has to be deleted first.

Solution: Wait until the previous delete operation is done. Then re-trigger the VCR test again to see if it works.

@shuyama1
Copy link
Member

Error: I checked the latest [Error message] and [Debug log], the returned error is "Precondition check failed."

Debugging: It's not informative, but I feel the possible root cause should be "Attempted to create an Astro corpus 'xxxx' that is currently being deleted. This is likely due to a race condition between create and delete pipelines. Code: FAILED_PRECONDITION". CmekConfig related operations are expensive. Deleting a CmekConfig (an operation from previous VCR test) takes long since its dependency has to be deleted first.

Solution: Wait until the previous delete operation is done. Then re-trigger the VCR test again to see if it works.

Thanks for the explanation. Assume the previous deletion should be done, triggering the VCR tests now and starting a new round of review. Thanks!

@shuyama1
Copy link
Member

/gcbrun

to trigger tests

@modular-magician
Copy link
Collaborator

Hi there, I'm the Modular magician. I've detected the following information about your changes:

Diff report

Your PR generated some diffs in downstreams - here they are.

google provider: Diff ( 7 files changed, 1131 insertions(+), 2 deletions(-))
google-beta provider: Diff ( 7 files changed, 1131 insertions(+), 2 deletions(-))
terraform-google-conversion: Diff ( 1 file changed, 103 insertions(+))
Open in Cloud Shell: Diff ( 4 files changed, 106 insertions(+))

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 19
Passed tests: 18
Skipped tests: 0
Affected tests: 1

Click here to see the affected service packages
  • discoveryengine
#### Action taken
Found 1 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
  • TestAccDiscoveryEngineCmekConfig_discoveryengineCmekconfigDefaultExample_update

Get to know how VCR tests work

@modular-magician
Copy link
Collaborator

🔴 Tests failed during RECORDING mode:
TestAccDiscoveryEngineCmekConfig_discoveryengineCmekconfigDefaultExample_update [Error message] [Debug log]

🔴 Errors occurred during RECORDING mode. Please fix them to complete your PR.

View the build log or the debug log for each test

@modular-magician
Copy link
Collaborator

Hi there, I'm the Modular magician. I've detected the following information about your changes:

Diff report

Your PR generated some diffs in downstreams - here they are.

google provider: Diff ( 7 files changed, 1131 insertions(+), 2 deletions(-))
google-beta provider: Diff ( 7 files changed, 1131 insertions(+), 2 deletions(-))
terraform-google-conversion: Diff ( 1 file changed, 103 insertions(+))
Open in Cloud Shell: Diff ( 4 files changed, 106 insertions(+))

@modular-magician
Copy link
Collaborator

Hi there, I'm the Modular magician. I've detected the following information about your changes:

Diff report

Your PR generated some diffs in downstreams - here they are.

google provider: Diff ( 7 files changed, 1131 insertions(+), 2 deletions(-))
google-beta provider: Diff ( 7 files changed, 1131 insertions(+), 2 deletions(-))
terraform-google-conversion: Diff ( 1 file changed, 103 insertions(+))
Open in Cloud Shell: Diff ( 4 files changed, 106 insertions(+))

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 19
Passed tests: 18
Skipped tests: 0
Affected tests: 1

Click here to see the affected service packages
  • discoveryengine
#### Action taken
Found 1 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
  • TestAccDiscoveryEngineCmekConfig_discoveryengineCmekconfigDefaultExample_update

Get to know how VCR tests work

1 similar comment
@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 19
Passed tests: 18
Skipped tests: 0
Affected tests: 1

Click here to see the affected service packages
  • discoveryengine
#### Action taken
Found 1 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
  • TestAccDiscoveryEngineCmekConfig_discoveryengineCmekconfigDefaultExample_update

Get to know how VCR tests work

@modular-magician
Copy link
Collaborator

🔴 Tests failed during RECORDING mode:
TestAccDiscoveryEngineCmekConfig_discoveryengineCmekconfigDefaultExample_update [Error message] [Debug log]

🔴 Errors occurred during RECORDING mode. Please fix them to complete your PR.

View the build log or the debug log for each test

@modular-magician
Copy link
Collaborator

🔴 Tests failed during RECORDING mode:
TestAccDiscoveryEngineCmekConfig_discoveryengineCmekconfigDefaultExample_update [Error message] [Debug log]

🔴 Errors occurred during RECORDING mode. Please fix them to complete your PR.

View the build log or the debug log for each test

@jialei-chen
Copy link
Member Author

Error: Checked the lasted VCR test [Error message] and [Debug log], the error is "Field \"kms_key_name\" is a required field, but no value is found."

Debugging: I don't know why kmsKey is required.

  • Field kmsKey is not marked with required: true.
  • In the update test, I set kms_key = "%{kms_key_name}".

Hi @shuyama1, do you have any idea of the reported error?

Copy link
Member

@shuyama1 shuyama1 left a comment

Choose a reason for hiding this comment

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

Error: Checked the lasted VCR test [Error message] and [Debug log], the error is "Field \"kms_key_name\" is a required field, but no value is found."

Debugging: I don't know why kmsKey is required.

  • Field kmsKey is not marked with required: true.
  • In the update test, I set kms_key = "%{kms_key_name}".

Hi @shuyama1, do you have any idea of the reported error?

I think I see where the issue is coming from. During the update test step, since kms_key itself is not modified, it does not include in the request body. Therefore, the PATCH call failed with "Field \"kms_key_name\" is a required field, but no value is found." error. (See the second PATCH call in the debug log)

You can add a custom update_encoder to always send this field even if it's not modified. (example)

@github-actions github-actions bot requested a review from shuyama1 July 22, 2025 17:27
@jialei-chen
Copy link
Member Author

jialei-chen commented Jul 22, 2025

Error: Checked the lasted VCR test [Error message] and [Debug log], the error is "Field \"kms_key_name\" is a required field, but no value is found."
Debugging: I don't know why kmsKey is required.

  • Field kmsKey is not marked with required: true.
  • In the update test, I set kms_key = "%{kms_key_name}".

Hi @shuyama1, do you have any idea of the reported error?

I think I see where the issue is coming from. During the update test step, since kms_key itself is not modified, it does not include in the request body. Therefore, the PATCH call failed with "Field \"kms_key_name\" is a required field, but no value is found." error. (See the second PATCH call in the debug log)

You can add a custom update_encoder to always send this field even if it's not modified. (example)

Thank you! kms_key is required and immutable. It seems updating request with PATCH verb somehow ignores the unchanged fields and thus leaving this required field unset.

I added update_encoder as suggested. I tested locally and it worked.


There are 2 checks "contributor-membership-checker" and "downstream-generation-and-test" in pending status for a long time. Except for these 2, others passed successfully, including the unit tests. https://screenshot.googleplex.com/7K27iuNotpTSzwb

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

Successfully merging this pull request may close these issues.

3 participants