Skip to content

KMS: add google_kms_crypto_key_latest_version data source #11456

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

Merged
merged 21 commits into from
Aug 23, 2024

Conversation

BBBmau
Copy link
Collaborator

@BBBmau BBBmau commented Aug 15, 2024

Continuation of #11455

Second step where we focus on grabbing the latest crypto key version (singular data source)

This PR depends on the referenced PR, plural data source must be merged before this can be properly reviewed.

The only major difference is once the list of cryptoKeyVersions is set we grab the latest one which is done in this line here:
https://github.com/GoogleCloudPlatform/magic-modules/pull/11456/files#diff-7c2dc734dd72075cca3912ca10f4c3a3736ea934186f1392fc7e0764a37eac53R99-R103

filter is added in since it gives the user the ability to grab the latest in either the enabled state or disabled state.

PR also includes some clean up of the plural cryptoKeyVersions data source such as adding in the missing filter argument in the docs.

Test passing:

└─(13:33:59 on main ✹ ✭)──> envchain GCLOUD make testacc TEST=./google/services/kms TESTARGS='-run TestAccDataSourceGoogleKmsCryptoKeyLatestVersion_basic'                    ──(Fri,Aug23)─┘
TF_ACC=1 TF_SCHEMA_PANIC_ON_ERROR=1 go test ./google/services/kms -v -run TestAccDataSourceGoogleKmsCryptoKeyLatestVersion_basic -timeout 240m -ldflags="-X=github.com/hashicorp/terraform-provider-google/version.ProviderVersion=acc"
=== RUN   TestAccDataSourceGoogleKmsCryptoKeyLatestVersion_basic
2024/08/23 13:36:12 [INFO] Authenticating using configured Google JSON 'credentials'...
2024/08/23 13:36:12 [INFO]   -- Scopes: [https://www.googleapis.com/auth/cloud-platform https://www.googleapis.com/auth/userinfo.email]
2024/08/23 13:36:12 [INFO] Authenticating using configured Google JSON 'credentials'...
2024/08/23 13:36:12 [INFO]   -- Scopes: [https://www.googleapis.com/auth/cloud-platform https://www.googleapis.com/auth/userinfo.email]
2024/08/23 13:36:12 [DEBUG] Waiting for state to become: [success]
2024/08/23 13:36:13 [INFO] Terraform is using this identity: mauricio-alvarezleon@hc-terraform-testing.iam.gserviceaccount.com
2024/08/23 13:36:13 [INFO] Instantiating Google Cloud KMS client for path https://cloudkms.googleapis.com/
2024/08/23 13:36:13 [DEBUG] Retry Transport: starting RoundTrip retry loop
2024/08/23 13:36:13 [DEBUG] Retry Transport: request attempt 0
2024/08/23 13:36:13 [DEBUG] Retry Transport: Stopping retries, last request was successful
2024/08/23 13:36:13 [DEBUG] Retry Transport: Returning after 1 attempts
2024/08/23 13:36:13 [DEBUG] Retry Transport: starting RoundTrip retry loop
2024/08/23 13:36:13 [DEBUG] Retry Transport: request attempt 0
2024/08/23 13:36:13 [DEBUG] Retry Transport: Stopping retries, last request was successful
2024/08/23 13:36:13 [DEBUG] Retry Transport: Returning after 1 attempts
--- PASS: TestAccDataSourceGoogleKmsCryptoKeyLatestVersion_basic (14.10s)
PASS
ok      github.com/hashicorp/terraform-provider-google/google/services/kms      15.502s

Release Note Template for Downstream PRs (will be copied)

`google_kms_crypto_key_latest_version`

@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, 577 insertions(+))
google-beta provider: Diff ( 5 files changed, 577 insertions(+))

@modular-magician
Copy link
Collaborator

Tests analytics

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

Click here to see the affected service packages
  • kms
#### Non-exercised tests

Tests were added that are skipped in VCR:

  • TestAccDataSourceGoogleKmsCryptoKeyVersions_basic
    $\textcolor{red}{\textsf{Errors occurred during REPLAYING mode. Please fix them to complete your PR.}}$

View the build log

@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 ( 6 files changed, 627 insertions(+))
google-beta provider: Diff ( 6 files changed, 627 insertions(+))

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 ( 6 files changed, 627 insertions(+))
google-beta provider: Diff ( 6 files changed, 627 insertions(+))

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 40
Passed tests: 35
Skipped tests: 4
Affected tests: 1

Click here to see the affected service packages
  • kms

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
  • TestAccDataSourceGoogleKmsCryptoKeyLatestVersion_basic

Get to know how VCR tests work

@modular-magician
Copy link
Collaborator

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

$\textcolor{red}{\textsf{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: 40
Passed tests: 35
Skipped tests: 4
Affected tests: 1

Click here to see the affected service packages
  • kms

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
  • TestAccDataSourceGoogleKmsCryptoKeyLatestVersion_basic

Get to know how VCR tests work

@modular-magician
Copy link
Collaborator

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

$\textcolor{red}{\textsf{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 ( 6 files changed, 627 insertions(+))
google-beta provider: Diff ( 6 files changed, 627 insertions(+))

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 40
Passed tests: 36
Skipped tests: 4
Affected tests: 0

Click here to see the affected service packages
  • kms

$\textcolor{green}{\textsf{All tests passed!}}$

View the build log

@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 ( 6 files changed, 551 insertions(+))
google-beta provider: Diff ( 6 files changed, 551 insertions(+))

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 40
Passed tests: 36
Skipped tests: 4
Affected tests: 0

Click here to see the affected service packages
  • kms

$\textcolor{green}{\textsf{All tests passed!}}$

View the build log

@BBBmau BBBmau force-pushed the add-latest-key-version branch from 9e874e0 to 5943a64 Compare August 23, 2024 19:59
@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 ( 4 files changed, 218 insertions(+), 2 deletions(-))
google-beta provider: Diff ( 4 files changed, 218 insertions(+), 2 deletions(-))

Errors

google provider:

  • The diff processor failed to build. This is usually due to the downstream provider failing to compile.

google-beta provider:

  • The diff processor failed to build. This is usually due to the downstream provider failing to compile.

@modular-magician
Copy link
Collaborator

Tests analytics

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

Click here to see the affected service packages
  • kms
#### Non-exercised tests

Tests were added that are skipped in VCR:

  • TestAccDataSourceGoogleKmsCryptoKeyLatestVersion_basic
    $\textcolor{red}{\textsf{Errors occurred during REPLAYING mode. Please fix them to complete your PR.}}$

View the build log

@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 ( 4 files changed, 262 insertions(+), 3 deletions(-))
google-beta provider: Diff ( 4 files changed, 261 insertions(+), 3 deletions(-))

@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 ( 4 files changed, 261 insertions(+), 3 deletions(-))
google-beta provider: Diff ( 4 files changed, 261 insertions(+), 3 deletions(-))

@BBBmau
Copy link
Collaborator Author

BBBmau commented Aug 23, 2024

Marking as ready for review after including the docs, I'm requesting specifically @slevenick due to already reviewing the plural data source. There's not much to review from this PR since it depends on the logic of plural cryptoKeyVersions data source to get the latest cryptoKeyVersion

@BBBmau BBBmau marked this pull request as ready for review August 23, 2024 20:54
@BBBmau BBBmau requested a review from slevenick August 23, 2024 20:54
@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 40
Passed tests: 32
Skipped tests: 6
Affected tests: 2

Click here to see the affected service packages
  • kms

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
  • TestAccDataSourceGoogleKmsCryptoKeyLatestVersion_basic
  • TestAccDataSourceGoogleKmsCryptoKeyVersions_basic

Get to know how VCR tests work

1 similar comment
@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 40
Passed tests: 32
Skipped tests: 6
Affected tests: 2

Click here to see the affected service packages
  • kms

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
  • TestAccDataSourceGoogleKmsCryptoKeyLatestVersion_basic
  • TestAccDataSourceGoogleKmsCryptoKeyVersions_basic

Get to know how VCR tests work

@modular-magician
Copy link
Collaborator

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

$\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

@modular-magician
Copy link
Collaborator

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

$\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

@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 ( 6 files changed, 332 insertions(+), 3 deletions(-))
google-beta provider: Diff ( 6 files changed, 332 insertions(+), 3 deletions(-))

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 40
Passed tests: 34
Skipped tests: 6
Affected tests: 0

Click here to see the affected service packages
  • kms

$\textcolor{green}{\textsf{All tests passed!}}$

View the build log

@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 ( 6 files changed, 334 insertions(+), 3 deletions(-))
google-beta provider: Diff ( 6 files changed, 334 insertions(+), 3 deletions(-))

Errors

google provider:

  • The diff processor failed to build. This is usually due to the downstream provider failing to compile.

google-beta provider:

  • The diff processor failed to build. This is usually due to the downstream provider failing to compile.

@modular-magician
Copy link
Collaborator

Tests analytics

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

Click here to see the affected service packages
  • kms
#### Non-exercised tests

Tests were added that are skipped in VCR:

  • TestAccDataSourceGoogleKmsCryptoKeyLatestVersion_basic
    $\textcolor{red}{\textsf{Errors occurred during REPLAYING mode. Please fix them to complete your PR.}}$

View the build log

@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 ( 6 files changed, 334 insertions(+), 3 deletions(-))
google-beta provider: Diff ( 6 files changed, 334 insertions(+), 3 deletions(-))

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 40
Passed tests: 34
Skipped tests: 6
Affected tests: 0

Click here to see the affected service packages
  • kms

$\textcolor{green}{\textsf{All tests passed!}}$

View the build log

@BBBmau
Copy link
Collaborator Author

BBBmau commented Aug 23, 2024

@slevenick thanks again for reviewing both PRs! 😄

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