Skip to content
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

KMS_config_first_commit #9353

Merged
merged 11 commits into from
Jan 9, 2024
Merged

Conversation

ranandku
Copy link
Contributor

@ranandku ranandku commented Oct 25, 2023

Fixes - hashicorp/terraform-provider-google#16355

This PR is to support provisioning kmsConfigs for Google Cloud NetApp Volumes through GCP terraform provider.

`google_netapp_kmsconfig`

@google-cla
Copy link

google-cla bot commented Oct 25, 2023

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@modular-magician
Copy link
Collaborator

Hello! I am a robot. It looks like you are a: Community Contributor Googler Core Contributor. Tests will require approval to run.

@NickElliot, 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 modular-magician added the awaiting-approval Pull requests that needs reviewer's approval to run presubmit tests label Oct 25, 2023
@ranandku
Copy link
Contributor Author

@NickElliot - Just signed the CLA

@NickElliot
Copy link
Contributor

/gcbrun

@NickElliot
Copy link
Contributor

The CLA check is still failing, which appears to be because the email associated with your commits is not the email associated with your CLA

@ranandku
Copy link
Contributor Author

@NickElliot - Have fixed the CLA issue

@modular-magician modular-magician removed the awaiting-approval Pull requests that needs reviewer's approval to run presubmit tests label Oct 30, 2023
Copy link
Contributor

@NickElliot NickElliot left a comment

Choose a reason for hiding this comment

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

Hi, the build is failing with the following:

Please use type KeyValueLabels for field labels in resource Netapp/kmsconfig (RuntimeError)

@modular-magician modular-magician added awaiting-approval Pull requests that needs reviewer's approval to run presubmit tests and removed awaiting-approval Pull requests that needs reviewer's approval to run presubmit tests labels Nov 7, 2023
@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.

Terraform GA: Diff ( 13 files changed, 1156 insertions(+), 2 deletions(-))
Terraform Beta: Diff ( 13 files changed, 1156 insertions(+), 2 deletions(-))
TF Conversion: Diff ( 1 file changed, 96 insertions(+))
TF OiCS: Diff ( 4 files changed, 107 insertions(+))

Missing test report

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

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

resource "google_netapp_kmsconfig" "primary" {
  labels = # value needed
}

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 3225
Passed tests 2895
Skipped tests: 328
Affected tests: 2

Action taken

Found 2 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
TestAccNetappkmsconfig_kmsConfigCreateExample_Update|TestAccNetappkmsconfig_kmsConfigCreateExample

Get to know how VCR tests work

@modular-magician
Copy link
Collaborator

$\textcolor{red}{\textsf{Tests failed during RECORDING mode:}}$
TestAccNetappkmsconfig_kmsConfigCreateExample_Update[Error message] [Debug log]
TestAccNetappkmsconfig_kmsConfigCreateExample[Error message] [Debug log]

$\textcolor{red}{\textsf{Please fix these to complete your PR.}}$
View the build log or the debug log for each test

@ranandku
Copy link
Contributor Author

ranandku commented Nov 9, 2023

@NickElliot - Can you please the test error logs for us to take a look at it?

Copy link
Contributor

@NickElliot NickElliot left a comment

Choose a reason for hiding this comment

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

Sorry about the delay, one error explanation and one needed change :)

kms_name = "<%= ctx[:vars]['kms_name'] %>"
description="this is a test description"
crypto_key_name="projects/cxo-automation-gcp/locations/us-central1/keyRings/kmsRing2/cryptoKeys/kmsCrypto111"
location="usthis is a test description-central1"
Copy link
Contributor

Choose a reason for hiding this comment

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

   Error: Error creating kmsconfig: googleapi: Error 403: Permission denied on 'locations/usthis is a test description-central1' (or it may not exist).
      with google_netapp_kmsconfig.kmsConfig,
      on terraform_plugin_test.tf line 2, in resource "google_netapp_kmsconfig" "kmsConfig":
       2: resource "google_netapp_kmsconfig" "kmsConfig" {

appears to be a problem here! also could you update this sample to be using a cryptokey terraform resource for the crypto_key_name

resource "google_netapp_kmsconfig" "kmsConfig" {
kms_name = "tf-test-kms-test%{random_suffix}"
description=""
crypto_key_name="projects/cxo-automation-gcp/locations/us-central1/keyRings/kmsRing2/cryptoKeys/kmsCrypto111"
Copy link
Contributor

Choose a reason for hiding this comment

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

same thing here! need a crypto key resource in config

@modular-magician modular-magician added the awaiting-approval Pull requests that needs reviewer's approval to run presubmit tests label Nov 15, 2023
@ranandku
Copy link
Contributor Author

@NickElliot I have updated the crypto_key_name and fixed the above errors.

@modular-magician modular-magician removed the awaiting-approval Pull requests that needs reviewer's approval to run presubmit tests label Nov 15, 2023
@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.

Terraform GA: Diff ( 13 files changed, 1200 insertions(+), 2 deletions(-))
Terraform Beta: Diff ( 13 files changed, 1200 insertions(+), 2 deletions(-))
TF Conversion: Diff ( 1 file changed, 96 insertions(+))
TF OiCS: Diff ( 4 files changed, 118 insertions(+))

Missing test report

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

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

resource "google_netapp_kmsconfig" "primary" {
  labels = # value needed
}

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 3232
Passed tests 2900
Skipped tests: 330
Affected tests: 2

Action taken

Found 2 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
TestAccNetappkmsconfig_kmsConfigCreateExample_Update|TestAccNetappkmsconfig_kmsConfigCreateExample

Get to know how VCR tests work

@modular-magician
Copy link
Collaborator

$\textcolor{red}{\textsf{Tests failed during RECORDING mode:}}$
TestAccNetappkmsconfig_kmsConfigCreateExample_Update[Error message] [Debug log]
TestAccNetappkmsconfig_kmsConfigCreateExample[Error message] [Debug log]

$\textcolor{red}{\textsf{Please fix these to complete your PR.}}$
View the build log or the debug log for each test

@modular-magician modular-magician removed the awaiting-approval Pull requests that needs reviewer's approval to run presubmit tests label Jan 8, 2024
@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.

Terraform GA: Diff ( 6 files changed, 1047 insertions(+), 2 deletions(-))
Terraform Beta: Diff ( 6 files changed, 1047 insertions(+), 2 deletions(-))
TF Conversion: Diff ( 1 file changed, 96 insertions(+))
TF OiCS: Diff ( 4 files changed, 118 insertions(+))

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 6
Passed tests 5
Skipped tests: 0
Affected tests: 1

Click here to see the affected service packages
  • netapp

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
TestAccNetappkmsconfig_kmsConfigCreateExample_Update

Get to know how VCR tests work

@modular-magician
Copy link
Collaborator

$\textcolor{red}{\textsf{Tests failed during RECORDING mode:}}$
TestAccNetappkmsconfig_kmsConfigCreateExample_Update[Error message] [Debug log]

$\textcolor{red}{\textsf{Please fix these to complete your PR.}}$
View the build log or the debug log for each test

Copy link
Contributor

@NickElliot NickElliot left a comment

Choose a reason for hiding this comment

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

Still experiencing the same error - I suggested removing the parallelization of the test so it should not happen until the other test is fully finished, and moving the tests back to us-central1. Sorry for the extremely prolonged review.

)

func TestAccNetappkmsconfig_kmsConfigCreateExample_Update(t *testing.T) {
t.Parallel()
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
t.Parallel()

Copy link
Contributor

Choose a reason for hiding this comment

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

Woot! This is a missing link I was looking for in the last weeks. We have multiple resources (Active Directory, KSMconfig, BackupVault) which are unique per region and tests are failing when ran in parallel. We worked around that so far, but this is the best way to solve that. I learned something important. Thank you!

Copy link
Contributor

Choose a reason for hiding this comment

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

But I am still surprised the tests did fail. We ran them in two different regions, so they shouldn't impact each other. Let us incorporate your suggestions and see how it works. My local test works fine.

return acctest.Nprintf(`
resource "google_kms_key_ring" "keyring" {
name = "tf-test-key-ring%{random_suffix}"
location = "us-west1"
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
location = "us-west1"
location = "us-central1"

return acctest.Nprintf(`
resource "google_kms_key_ring" "keyring" {
name = "tf-test-key-ring%{random_suffix}"
location = "us-west1"
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
location = "us-west1"
location = "us-central1"

name = "tf-test-kms-test%{random_suffix}"
description="this is a test description"
crypto_key_name=google_kms_crypto_key.crypto_key.id
location="us-west1"
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
location="us-west1"
location = "us-central1"

name = "tf-test-kms-test%{random_suffix}"
description="kmsconfig update"
crypto_key_name=google_kms_crypto_key.crypto_key.id
location="us-west1"
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
location="us-west1"
location = "us-central1"

@modular-magician modular-magician added awaiting-approval Pull requests that needs reviewer's approval to run presubmit tests and removed awaiting-approval Pull requests that needs reviewer's approval to run presubmit tests labels Jan 9, 2024
@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.

Terraform GA: Diff ( 6 files changed, 1047 insertions(+), 2 deletions(-))
Terraform Beta: Diff ( 6 files changed, 1047 insertions(+), 2 deletions(-))
TF Conversion: Diff ( 1 file changed, 96 insertions(+))
TF OiCS: Diff ( 4 files changed, 118 insertions(+))

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 6
Passed tests 5
Skipped tests: 0
Affected tests: 1

Click here to see the affected service packages
  • netapp

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
TestAccNetappkmsconfig_kmsConfigCreateExample_Update

Get to know how VCR tests work

@modular-magician
Copy link
Collaborator

$\textcolor{green}{\textsf{Tests passed during RECORDING mode:}}$
TestAccNetappkmsconfig_kmsConfigCreateExample_Update[Debug log]

Rerun these tests in REPLAYING mode to catch issues

$\textcolor{green}{\textsf{No issues found for passed tests after REPLAYING rerun.}}$


$\textcolor{green}{\textsf{All tests passed!}}$
View the build log or the debug log for each test

Copy link
Contributor

@NickElliot NickElliot left a comment

Choose a reason for hiding this comment

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

At last everything is good! Thank you for your contribution.

@okrause
Copy link
Contributor

okrause commented Jan 9, 2024

Thank you for your review. Very appreciated!

bskaplan pushed a commit to bskaplan/magic-modules that referenced this pull request Jan 17, 2024
* KMS_config_first_commit

* kmscommit for author change

* Updated label to KeyValueLabels

* kmsconfig_update_key_ring_crypto_key_name

* Fixed issues in resource_netapp_kmsconfig_test.go

* removed roation_period

* changed location to us-west1

* fixed double quotes

* changes_with_labels

* changed location to us-central1
kylase pushed a commit to yuanchuankee/magic-modules that referenced this pull request Jan 21, 2024
* KMS_config_first_commit

* kmscommit for author change

* Updated label to KeyValueLabels

* kmsconfig_update_key_ring_crypto_key_name

* Fixed issues in resource_netapp_kmsconfig_test.go

* removed roation_period

* changed location to us-west1

* fixed double quotes

* changes_with_labels

* changed location to us-central1
Maarc-D added a commit to Maarc-D/magic-modules that referenced this pull request Mar 5, 2024
LucaPrete pushed a commit to LucaPrete/magic-modules that referenced this pull request May 1, 2024
balanaguharsha pushed a commit to balanaguharsha/magic-modules that referenced this pull request May 2, 2024
* KMS_config_first_commit

* kmscommit for author change

* Updated label to KeyValueLabels

* kmsconfig_update_key_ring_crypto_key_name

* Fixed issues in resource_netapp_kmsconfig_test.go

* removed roation_period

* changed location to us-west1

* fixed double quotes

* changes_with_labels

* changed location to us-central1
pengq-google pushed a commit to pengq-google/magic-modules that referenced this pull request May 21, 2024
* KMS_config_first_commit

* kmscommit for author change

* Updated label to KeyValueLabels

* kmsconfig_update_key_ring_crypto_key_name

* Fixed issues in resource_netapp_kmsconfig_test.go

* removed roation_period

* changed location to us-west1

* fixed double quotes

* changes_with_labels

* changed location to us-central1
SarahFrench added a commit that referenced this pull request May 23, 2024
…g order (#10572)

Co-authored-by: Luca Prete <lucaprete@google.com>
Co-authored-by: Sarah French <15078782+SarahFrench@users.noreply.github.com>
Cheriit pushed a commit to Cheriit/magic-modules that referenced this pull request Jun 4, 2024
…s in state by config order (GoogleCloudPlatform#10572)

Co-authored-by: Luca Prete <lucaprete@google.com>
Co-authored-by: Sarah French <15078782+SarahFrench@users.noreply.github.com>
jessdejong pushed a commit to jessdejong/magic-modules that referenced this pull request Jun 10, 2024
…s in state by config order (GoogleCloudPlatform#10572)

Co-authored-by: Luca Prete <lucaprete@google.com>
Co-authored-by: Sarah French <15078782+SarahFrench@users.noreply.github.com>
pcostell pushed a commit to pcostell/magic-modules that referenced this pull request Jul 16, 2024
…s in state by config order (GoogleCloudPlatform#10572)

Co-authored-by: Luca Prete <lucaprete@google.com>
Co-authored-by: Sarah French <15078782+SarahFrench@users.noreply.github.com>
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.

7 participants