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

feature: ephemeral write-only support #13135

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

Conversation

BBBmau
Copy link
Collaborator

@BBBmau BBBmau commented Feb 20, 2025

This PR adds support for Write-Only attributes with the release of TF 1.11

It includes the following attributes:

Some PRs that were necessary to support Write-Only attributes:

Release Note Template for Downstream PRs (will be copied)

See Write release notes for guidance.

sql: added `password_wo` and `password_wo_version` fields to `google_sql_user` resource
bigquerydatatransfer: added `secret_access_key_wo` write-only field to `google_bigquery_data_transfer_config` resource
`secretmanager`: added `secret_version_wo` write-only field to `google_secret_version` resource
compute: added `raw_key_wo`, `rsa_encrypted_key` and `new_keys_wo` fields in `resource_google_compute_disk` resource
compute: added `raw_key_wo` and `new_keys_wo` fields in `resource_google_region_compute_disk` resource

@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 ( 257 files changed, 2789 insertions(+), 2203 deletions(-))
google-beta provider: Diff ( 257 files changed, 2789 insertions(+), 2203 deletions(-))
terraform-google-conversion: Diff ( 2 files changed, 11 insertions(+), 1 deletion(-))

Missing test report

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

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

resource "google_bigquery_data_transfer_config" "primary" {
  sensitive_params {
    secret_access_key    = # value needed
    secret_access_key_wo = # value needed
  }
  sensitive_params_wo_version = # value needed
}

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 4609
Passed tests: 4169
Skipped tests: 433
Affected tests: 7

Click here to see the affected service packages

All service packages are affected

#### Non-exercised tests

🔴 Tests were added that are skipped in VCR:

  • TestAccSqlUser_password_wo

Action taken

Found 7 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
  • TestAccAccessContextManager
  • TestAccCloudbuildWorkerPool_basic
  • TestAccDataSourceGoogleGkeHubFeature_basic
  • TestAccEphemeralServiceAccountKey_basic
  • TestAccSecretManagerSecretVersion_secretVersionBasicWriteOnlyExample
  • TestAccSecretManagerSecretVersion_secretVersionWithBase64StringSecretDataWriteOnlyExample
  • TestAccSpannerInstance_spannerInstanceWithAutoscaling

Get to know how VCR tests work

@modular-magician
Copy link
Collaborator

🟢 Tests passed during RECORDING mode:
TestAccDataSourceGoogleGkeHubFeature_basic [Debug log]
TestAccSpannerInstance_spannerInstanceWithAutoscaling [Debug log]

🔴 Tests failed when rerunning REPLAYING mode:
TestAccDataSourceGoogleGkeHubFeature_basic [Error message] [Debug log]
TestAccSpannerInstance_spannerInstanceWithAutoscaling [Error message] [Debug log]

Tests failed due to non-determinism or randomness when the VCR replayed the response after the HTTP request was made.

Please fix these to complete your PR. If you believe these test failures to be incorrect or unrelated to your change, or if you have any questions, please raise the concern with your reviewer.


🔴 Tests failed during RECORDING mode:
TestAccAccessContextManager [Error message] [Debug log]
TestAccCloudbuildWorkerPool_basic [Error message] [Debug log]
TestAccEphemeralServiceAccountKey_basic [Error message] [Debug log]
TestAccSecretManagerSecretVersion_secretVersionBasicWriteOnlyExample [Error message] [Debug log]
TestAccSecretManagerSecretVersion_secretVersionWithBase64StringSecretDataWriteOnlyExample [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 ( 257 files changed, 2787 insertions(+), 2203 deletions(-))
google-beta provider: Diff ( 257 files changed, 2787 insertions(+), 2203 deletions(-))
terraform-google-conversion: Diff ( 2 files changed, 11 insertions(+), 1 deletion(-))

Missing test report

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

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

resource "google_bigquery_data_transfer_config" "primary" {
  sensitive_params {
    secret_access_key    = # value needed
    secret_access_key_wo = # value needed
  }
  sensitive_params_wo_version = # value needed
}

@BBBmau
Copy link
Collaborator Author

BBBmau commented Feb 20, 2025

TeamCity Builds testing the resources with Write-Only attributes:

Bigquerydatatransfer
Sql
secretManager

Copy link
Member

@rileykarson rileykarson left a comment

Choose a reason for hiding this comment

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

Going through failing tests for now, I'll make a full run through the code tomorrow. The BQ change and a docs change didn't go through earlier dedicated review, and not sure if a full review was the expectation on the feature branch merge PR.

Breakdown by test:

  • TestAccDataSourceGoogleGkeHubFeature_basic seems unrelated. I'm not entirely sure what's going wrong, but it's VCR mechanics and doesn't seem to have been touched here.
  • TestAccSpannerInstance_spannerInstanceWithAutoscaling has a non-deterministic source of randomisation. I'll fix that. edit: Use controlled random suffix for TestAccSpannerInstance_spannerInstanceWithAutoscaling #13141
  • TestAccAccessContextManager is likely failing due to messiness/conflicts in the environment.
  • TestAccCloudbuildWorkerPool_basic is failing in nightlies
  • TestAccEphemeralServiceAccountKey_basic seems like it may be related
  • TestAccSecretManagerSecretVersion_secretVersionBasicWriteOnlyExample can't pass yet in VCR but did in TC
  • TestAccSecretManagerSecretVersion_secretVersionWithBase64StringSecretDataWriteOnlyExample can't pass yet in VCR but did in TC
  • TestAccSqlUser_password_wo was added but won't pass yet in VCR but did in TC

@BBBmau can you link successful runs for the WO tests, and investigate and provide context on or fix the TestAccEphemeralServiceAccountKey_basic failure? edit ah, you just beat me with most of them. Thanks!

See comment inline on bigquerydatatransfer, also, a test/test(s) should be added.

@rileykarson
Copy link
Member

Bigquerydatatransfer

No tests ran in that one, see comment above!

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 4610
Passed tests: 4171
Skipped tests: 432
Affected tests: 7

Click here to see the affected service packages

All service packages are affected

Action taken

Found 7 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
  • TestAccCloudbuildWorkerPool_basic
  • TestAccDataSourceGoogleGkeHubFeature_basic
  • TestAccEphemeralServiceAccountKey_basic
  • TestAccSecretManagerSecretVersion_secretVersionBasicWriteOnlyExample
  • TestAccSecretManagerSecretVersion_secretVersionWithBase64StringSecretDataWriteOnlyExample
  • TestAccSpannerInstance_spannerInstanceWithAutoscaling
  • TestAccSqlUser_password_wo

Get to know how VCR tests work

@modular-magician
Copy link
Collaborator

🟢 Tests passed during RECORDING mode:
TestAccDataSourceGoogleGkeHubFeature_basic [Debug log]
TestAccSpannerInstance_spannerInstanceWithAutoscaling [Debug log]

🔴 Tests failed when rerunning REPLAYING mode:
TestAccDataSourceGoogleGkeHubFeature_basic [Error message] [Debug log]
TestAccSpannerInstance_spannerInstanceWithAutoscaling [Error message] [Debug log]

Tests failed due to non-determinism or randomness when the VCR replayed the response after the HTTP request was made.

Please fix these to complete your PR. If you believe these test failures to be incorrect or unrelated to your change, or if you have any questions, please raise the concern with your reviewer.


🔴 Tests failed during RECORDING mode:
TestAccCloudbuildWorkerPool_basic [Error message] [Debug log]
TestAccEphemeralServiceAccountKey_basic [Error message] [Debug log]
TestAccSecretManagerSecretVersion_secretVersionBasicWriteOnlyExample [Error message] [Debug log]
TestAccSecretManagerSecretVersion_secretVersionWithBase64StringSecretDataWriteOnlyExample [Error message] [Debug log]
TestAccSqlUser_password_wo [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 ( 258 files changed, 2793 insertions(+), 2213 deletions(-))
google-beta provider: Diff ( 258 files changed, 2793 insertions(+), 2213 deletions(-))
terraform-google-conversion: Diff ( 2 files changed, 11 insertions(+), 1 deletion(-))

Missing test report

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

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

resource "google_bigquery_data_transfer_config" "primary" {
  sensitive_params {
    secret_access_key    = # value needed
    secret_access_key_wo = # value needed
  }
  sensitive_params_wo_version = # value needed
}

@BBBmau BBBmau force-pushed the FEATURE-BRANCH-ephemeral-write-only branch from 13c786b to 0d265d0 Compare February 21, 2025 21:36
@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 ( 258 files changed, 2761 insertions(+), 2213 deletions(-))
google-beta provider: Diff ( 258 files changed, 2761 insertions(+), 2213 deletions(-))
terraform-google-conversion: Diff ( 2 files changed, 11 insertions(+), 1 deletion(-))

Missing test report

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

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

resource "google_bigquery_data_transfer_config" "primary" {
  sensitive_params {
    secret_access_key    = # value needed
    secret_access_key_wo = # value needed
  }
  sensitive_params_wo_version = # value needed
}

@modular-magician
Copy link
Collaborator

🟢 Tests passed during RECORDING mode:
TestAccAccessContextManager [Debug log]
TestAccDataSourceGoogleGkeHubFeature_basic [Debug log]
TestAccSpannerInstance_spannerInstanceWithAutoscaling [Debug log]

🔴 Tests failed when rerunning REPLAYING mode:
TestAccAccessContextManager [Error message] [Debug log]
TestAccDataSourceGoogleGkeHubFeature_basic [Error message] [Debug log]

Tests failed due to non-determinism or randomness when the VCR replayed the response after the HTTP request was made.

Please fix these to complete your PR. If you believe these test failures to be incorrect or unrelated to your change, or if you have any questions, please raise the concern with your reviewer.


🔴 Tests failed during RECORDING mode:
TestAccCloudbuildWorkerPool_basic [Error message] [Debug log]
TestAccEphemeralServiceAccountKey_basic [Error message] [Debug log]
TestAccSecretManagerSecretVersion_secretVersionBasicWriteOnlyExample [Error message] [Debug log]
TestAccSecretManagerSecretVersion_secretVersionWithBase64StringSecretDataWriteOnlyExample [Error message] [Debug log]
TestAccSqlUser_password_wo [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 ( 258 files changed, 2762 insertions(+), 2213 deletions(-))
google-beta provider: Diff ( 258 files changed, 2762 insertions(+), 2213 deletions(-))
terraform-google-conversion: Diff ( 2 files changed, 11 insertions(+), 1 deletion(-))

Missing test report

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

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

resource "google_bigquery_data_transfer_config" "primary" {
  sensitive_params {
    secret_access_key    = # value needed
    secret_access_key_wo = # value needed
  }
  sensitive_params_wo_version = # 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 ( 258 files changed, 2762 insertions(+), 2213 deletions(-))
google-beta provider: Diff ( 258 files changed, 2762 insertions(+), 2213 deletions(-))
terraform-google-conversion: Diff ( 2 files changed, 11 insertions(+), 1 deletion(-))

Missing test report

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

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

resource "google_bigquery_data_transfer_config" "primary" {
  sensitive_params {
    secret_access_key    = # value needed
    secret_access_key_wo = # value needed
  }
  sensitive_params_wo_version = # value needed
}

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 4613
Passed tests: 4174
Skipped tests: 432
Affected tests: 7

Click here to see the affected service packages

All service packages are affected

Action taken

Found 7 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
  • TestAccCloudbuildWorkerPool_basic
  • TestAccDataSourceGoogleGkeHubFeature_basic
  • TestAccEphemeralServiceAccountKey_basic
  • TestAccSecretManagerSecretVersion_secretVersionBasicWriteOnlyExample
  • TestAccSecretManagerSecretVersion_secretVersionWithBase64StringSecretDataWriteOnlyExample
  • TestAccSpannerInstance_spannerInstanceWithAutoscaling
  • TestAccSqlUser_password_wo

Get to know how VCR tests work

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 4613
Passed tests: 4172
Skipped tests: 432
Affected tests: 9

Click here to see the affected service packages

All service packages are affected

Action taken

Found 9 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
  • TestAccAccessContextManager
  • TestAccCloudbuildWorkerPool_basic
  • TestAccDataSourceGoogleGkeHubFeature_basic
  • TestAccEphemeralServiceAccountKey_basic
  • TestAccFolderIamPolicy_basic
  • TestAccSecretManagerSecretVersion_secretVersionBasicWriteOnlyExample
  • TestAccSecretManagerSecretVersion_secretVersionWithBase64StringSecretDataWriteOnlyExample
  • TestAccSpannerInstance_spannerInstanceWithAutoscaling
  • TestAccSqlUser_password_wo

Get to know how VCR tests work

@modular-magician
Copy link
Collaborator

🟢 Tests passed during RECORDING mode:
TestAccDataSourceGoogleGkeHubFeature_basic [Debug log]
TestAccSpannerInstance_spannerInstanceWithAutoscaling [Debug log]

🔴 Tests failed when rerunning REPLAYING mode:
TestAccDataSourceGoogleGkeHubFeature_basic [Error message] [Debug log]

Tests failed due to non-determinism or randomness when the VCR replayed the response after the HTTP request was made.

Please fix these to complete your PR. If you believe these test failures to be incorrect or unrelated to your change, or if you have any questions, please raise the concern with your reviewer.


🔴 Tests failed during RECORDING mode:
TestAccCloudbuildWorkerPool_basic [Error message] [Debug log]
TestAccEphemeralServiceAccountKey_basic [Error message] [Debug log]
TestAccSecretManagerSecretVersion_secretVersionBasicWriteOnlyExample [Error message] [Debug log]
TestAccSecretManagerSecretVersion_secretVersionWithBase64StringSecretDataWriteOnlyExample [Error message] [Debug log]
TestAccSqlUser_password_wo [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 passed during RECORDING mode:
TestAccAccessContextManager [Debug log]
TestAccDataSourceGoogleGkeHubFeature_basic [Debug log]
TestAccFolderIamPolicy_basic [Debug log]
TestAccSpannerInstance_spannerInstanceWithAutoscaling [Debug log]

🔴 Tests failed when rerunning REPLAYING mode:
TestAccAccessContextManager [Error message] [Debug log]
TestAccDataSourceGoogleGkeHubFeature_basic [Error message] [Debug log]

Tests failed due to non-determinism or randomness when the VCR replayed the response after the HTTP request was made.

Please fix these to complete your PR. If you believe these test failures to be incorrect or unrelated to your change, or if you have any questions, please raise the concern with your reviewer.


🔴 Tests failed during RECORDING mode:
TestAccCloudbuildWorkerPool_basic [Error message] [Debug log]
TestAccEphemeralServiceAccountKey_basic [Error message] [Debug log]
TestAccSecretManagerSecretVersion_secretVersionBasicWriteOnlyExample [Error message] [Debug log]
TestAccSecretManagerSecretVersion_secretVersionWithBase64StringSecretDataWriteOnlyExample [Error message] [Debug log]
TestAccSqlUser_password_wo [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: 4614
Passed tests: 4175
Skipped tests: 432
Affected tests: 7

Click here to see the affected service packages

All service packages are affected

Action taken

Found 7 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
  • TestAccAccessContextManager
  • TestAccCloudbuildWorkerPool_basic
  • TestAccDataSourceGoogleGkeHubFeature_basic
  • TestAccEphemeralServiceAccountKey_basic
  • TestAccSecretManagerSecretVersion_secretVersionBasicWriteOnlyExample
  • TestAccSecretManagerSecretVersion_secretVersionWithBase64StringSecretDataWriteOnlyExample
  • TestAccSqlUser_password_wo

Get to know how VCR tests work

2 similar comments
@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 4614
Passed tests: 4175
Skipped tests: 432
Affected tests: 7

Click here to see the affected service packages

All service packages are affected

Action taken

Found 7 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
  • TestAccAccessContextManager
  • TestAccCloudbuildWorkerPool_basic
  • TestAccDataSourceGoogleGkeHubFeature_basic
  • TestAccEphemeralServiceAccountKey_basic
  • TestAccSecretManagerSecretVersion_secretVersionBasicWriteOnlyExample
  • TestAccSecretManagerSecretVersion_secretVersionWithBase64StringSecretDataWriteOnlyExample
  • TestAccSqlUser_password_wo

Get to know how VCR tests work

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 4614
Passed tests: 4175
Skipped tests: 432
Affected tests: 7

Click here to see the affected service packages

All service packages are affected

Action taken

Found 7 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
  • TestAccAccessContextManager
  • TestAccCloudbuildWorkerPool_basic
  • TestAccDataSourceGoogleGkeHubFeature_basic
  • TestAccEphemeralServiceAccountKey_basic
  • TestAccSecretManagerSecretVersion_secretVersionBasicWriteOnlyExample
  • TestAccSecretManagerSecretVersion_secretVersionWithBase64StringSecretDataWriteOnlyExample
  • TestAccSqlUser_password_wo

Get to know how VCR tests work

@modular-magician
Copy link
Collaborator

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

🔴 Tests failed when rerunning REPLAYING mode:
TestAccDataSourceGoogleGkeHubFeature_basic [Error message] [Debug log]

Tests failed due to non-determinism or randomness when the VCR replayed the response after the HTTP request was made.

Please fix these to complete your PR. If you believe these test failures to be incorrect or unrelated to your change, or if you have any questions, please raise the concern with your reviewer.


🔴 Tests failed during RECORDING mode:
TestAccAccessContextManager [Error message] [Debug log]
TestAccCloudbuildWorkerPool_basic [Error message] [Debug log]
TestAccEphemeralServiceAccountKey_basic [Error message] [Debug log]
TestAccSecretManagerSecretVersion_secretVersionBasicWriteOnlyExample [Error message] [Debug log]
TestAccSecretManagerSecretVersion_secretVersionWithBase64StringSecretDataWriteOnlyExample [Error message] [Debug log]
TestAccSqlUser_password_wo [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 passed during RECORDING mode:
TestAccDataSourceGoogleGkeHubFeature_basic [Debug log]

🔴 Tests failed when rerunning REPLAYING mode:
TestAccDataSourceGoogleGkeHubFeature_basic [Error message] [Debug log]

Tests failed due to non-determinism or randomness when the VCR replayed the response after the HTTP request was made.

Please fix these to complete your PR. If you believe these test failures to be incorrect or unrelated to your change, or if you have any questions, please raise the concern with your reviewer.


🔴 Tests failed during RECORDING mode:
TestAccAccessContextManager [Error message] [Debug log]
TestAccCloudbuildWorkerPool_basic [Error message] [Debug log]
TestAccEphemeralServiceAccountKey_basic [Error message] [Debug log]
TestAccSecretManagerSecretVersion_secretVersionBasicWriteOnlyExample [Error message] [Debug log]
TestAccSecretManagerSecretVersion_secretVersionWithBase64StringSecretDataWriteOnlyExample [Error message] [Debug log]
TestAccSqlUser_password_wo [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 passed during RECORDING mode:
TestAccDataSourceGoogleGkeHubFeature_basic [Debug log]

🔴 Tests failed when rerunning REPLAYING mode:
TestAccDataSourceGoogleGkeHubFeature_basic [Error message] [Debug log]

Tests failed due to non-determinism or randomness when the VCR replayed the response after the HTTP request was made.

Please fix these to complete your PR. If you believe these test failures to be incorrect or unrelated to your change, or if you have any questions, please raise the concern with your reviewer.


🔴 Tests failed during RECORDING mode:
TestAccAccessContextManager [Error message] [Debug log]
TestAccCloudbuildWorkerPool_basic [Error message] [Debug log]
TestAccEphemeralServiceAccountKey_basic [Error message] [Debug log]
TestAccSecretManagerSecretVersion_secretVersionBasicWriteOnlyExample [Error message] [Debug log]
TestAccSecretManagerSecretVersion_secretVersionWithBase64StringSecretDataWriteOnlyExample [Error message] [Debug log]
TestAccSqlUser_password_wo [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

@BBBmau BBBmau requested a review from rileykarson February 24, 2025 22:47
@@ -210,6 +211,12 @@ properties:
**NOTE** : If you are attempting to update a parameter that cannot be updated (due to api limitations) [please force recreation of the resource](https://www.terraform.io/cli/state/taint#forcing-re-creation-of-resources).
required: true
custom_flatten: 'templates/terraform/custom_flatten/json_to_string_map.go.tmpl'

- name: 'sensitiveParamsWoVersion'
Copy link
Member

Choose a reason for hiding this comment

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

I'd lean more towards keeping the version field with the WO field. So we'd support sensitive_params.0.secret_access_key_wo_version here. While params is sent directly, sensitive_params isn't and is structured. That'll be easier to adapt later if we do introduce a template, and will keep a single pattern for all WO + WO version field pairs.

if _, exists := d.GetOkExists("sensitive_params.0." + sp); exists {
delete(params, sp)
} else {
params[sp] = d.Get("params." + sp)
Copy link
Member

Choose a reason for hiding this comment

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

Doesn't this change mean we'll remove values from state where we wouldn't before? This seems like a regression.

Previously the logic was:

  • do a presence check
  • if present and in sensitive_params, don't set in state
  • if present and not in sensitive_params, persist old state value
  • else record value in state (will diff from null)

The new logic is:

  • delete from state if present

Copy link
Collaborator Author

@BBBmau BBBmau Feb 25, 2025

Choose a reason for hiding this comment

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

you're correct, the regression comes from if a user decides to explicitly set a secret_access_key into params directly instead of sensitive_params. If a user were to do this with the current change it would delete from state (regression).

Latest commit reverts this and adds a config check of _wo attribute with RawConfigAt d5b47a4

There might be something wrong with how RawConfigAt works. It only works on creation. Was getting null as the result. Enforcing the check with version fixes the diff just fine but feels janky. I'll get back to you on whether this is a bug or if this is meant to be like this, just need to confirm. The new commit: 113b096

@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 ( 258 files changed, 2763 insertions(+), 2208 deletions(-))
google-beta provider: Diff ( 258 files changed, 2763 insertions(+), 2208 deletions(-))
terraform-google-conversion: Diff ( 2 files changed, 11 insertions(+), 1 deletion(-))

Missing test report

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

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

resource "google_bigquery_data_transfer_config" "primary" {
  sensitive_params {
    secret_access_key    = # value needed
    secret_access_key_wo = # value needed
  }
  sensitive_params_wo_version = # value needed
}

@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 ( 258 files changed, 2735 insertions(+), 2208 deletions(-))
google-beta provider: Diff ( 258 files changed, 2735 insertions(+), 2208 deletions(-))
terraform-google-conversion: Diff ( 2 files changed, 1 insertion(+), 1 deletion(-))

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.

@BBBmau BBBmau requested a review from rileykarson February 25, 2025 05:25
@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

All service packages are affected

#### Non-exercised tests

🔴 Tests were added that are skipped in VCR:

  • TestAccSecretManagerSecretVersion_secretVersionBasicWriteOnlyExample
  • TestAccSecretManagerSecretVersion_secretVersionWithBase64StringSecretDataWriteOnlyExample
  • TestAccSqlUser_password_wo
    🔴 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 ( 258 files changed, 2735 insertions(+), 2208 deletions(-))
google-beta provider: Diff ( 258 files changed, 2735 insertions(+), 2208 deletions(-))
terraform-google-conversion: Diff ( 2 files changed, 1 insertion(+), 1 deletion(-))

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

All service packages are affected

#### Non-exercised tests

🔴 Tests were added that are skipped in VCR:

  • TestAccSecretManagerSecretVersion_secretVersionBasicWriteOnlyExample
  • TestAccSecretManagerSecretVersion_secretVersionWithBase64StringSecretDataWriteOnlyExample
  • TestAccSqlUser_password_wo
    🔴 Errors occurred during REPLAYING mode. Please fix them to complete your PR.

View the build log

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 4616
Passed tests: 4177
Skipped tests: 432
Affected tests: 7

Click here to see the affected service packages

All service packages are affected

Action taken

Found 7 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
  • TestAccAccessContextManager
  • TestAccCloudbuildWorkerPool_basic
  • TestAccDataSourceGoogleGkeHubFeature_basic
  • TestAccEphemeralServiceAccountKey_basic
  • TestAccSecretManagerSecretVersion_secretVersionBasicWriteOnlyExample
  • TestAccSecretManagerSecretVersion_secretVersionWithBase64StringSecretDataWriteOnlyExample
  • TestAccSqlUser_password_wo

Get to know how VCR tests work

@modular-magician
Copy link
Collaborator

🟢 Tests passed during RECORDING mode:
TestAccAccessContextManager [Debug log]
TestAccDataSourceGoogleGkeHubFeature_basic [Debug log]

🔴 Tests failed when rerunning REPLAYING mode:
TestAccAccessContextManager [Error message] [Debug log]
TestAccDataSourceGoogleGkeHubFeature_basic [Error message] [Debug log]

Tests failed due to non-determinism or randomness when the VCR replayed the response after the HTTP request was made.

Please fix these to complete your PR. If you believe these test failures to be incorrect or unrelated to your change, or if you have any questions, please raise the concern with your reviewer.


🔴 Tests failed during RECORDING mode:
TestAccCloudbuildWorkerPool_basic [Error message] [Debug log]
TestAccEphemeralServiceAccountKey_basic [Error message] [Debug log]
TestAccSecretManagerSecretVersion_secretVersionBasicWriteOnlyExample [Error message] [Debug log]
TestAccSecretManagerSecretVersion_secretVersionWithBase64StringSecretDataWriteOnlyExample [Error message] [Debug log]
TestAccSqlUser_password_wo [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

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