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

Allows empty value and sets default value for maxRetries of cloud run job #7425

Merged
merged 5 commits into from
Apr 5, 2023

Conversation

yanweiguo
Copy link
Member

@yanweiguo yanweiguo commented Mar 9, 2023

Fixes hashicorp/terraform-provider-google#13747.

Got compiling error when running tests in downstream repos, which was not caused by this change.

If this PR is for Terraform, I acknowledge that I have:

  • Searched through the issue tracker for an open issue that this either resolves or contributes to, commented on it to claim it, and written "fixes {url}" or "part of {url}" in this PR description. If there were no relevant open issues, I opened one and commented that I would like to work on it (not necessary for very small changes).
  • Ensured that all new fields I added that can be set by a user appear in at least one example (for generated resources) or third_party test (for handwritten resources or update tests).
  • Generated Terraform providers, and ran make test and make lint in the generated providers to ensure it passes unit and linter tests.
  • Ran relevant acceptance tests using my own Google Cloud project and credentials (If the acceptance tests do not yet pass or you are unable to run them, please let your reviewer know).
  • Read the Release Notes Guide before writing my release note below.

Release Note Template for Downstream PRs (will be copied)

cloudrunv2: set a default value of 3 for `max_retries` in `google_cloud_run_v2_job`. This should match the API's existing default, but may show a diff at plan time
cloudrunv2: fixed the bug where setting `max_retries` to 0 in `google_cloud_run_v2_job` was not respected.

@yanweiguo yanweiguo requested a review from a team as a code owner March 9, 2023 00:19
@yanweiguo yanweiguo requested review from slevenick and removed request for a team March 9, 2023 00:19
@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 ( 2 files changed, 2 insertions(+), 2 deletions(-))
Terraform Beta: Diff ( 2 files changed, 2 insertions(+), 2 deletions(-))
TF Validator: Diff ( 3 files changed, 4 insertions(+), 4 deletions(-))

@slevenick
Copy link
Contributor

This will make it so that when maxRetries is not set by the user in their config we will send the value of 0 to the API.

Is that an acceptable behavior?

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 2497
Passed tests 2226
Skipped tests: 262
Affected tests: 9

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
TestAccCloudRunV2Job_cloudrunv2JobBasicExample|TestAccCloudRunV2Job_cloudrunv2JobVpcaccessExample|TestAccCloudRunV2Job_cloudrunv2JobSqlExample|TestAccComposerEnvironment_withEncryptionConfigComposer2|TestAccCloudRunV2Job_cloudrunv2JobSecretExample|TestAccCloudRunV2Job_cloudrunv2JobFullUpdate|TestAccCloudRunV2JobIamPolicyGenerated|TestAccCloudRunV2JobIamMemberGenerated|TestAccCloudRunV2JobIamBindingGenerated

Get to know how VCR tests work

@modular-magician
Copy link
Collaborator

Tests passed during RECORDING mode:
TestAccCloudRunV2Job_cloudrunv2JobBasicExample[Debug log]
TestAccCloudRunV2Job_cloudrunv2JobVpcaccessExample[Debug log]
TestAccCloudRunV2Job_cloudrunv2JobSqlExample[Debug log]
TestAccComposerEnvironment_withEncryptionConfigComposer2[Debug log]
TestAccCloudRunV2Job_cloudrunv2JobFullUpdate[Debug log]
TestAccCloudRunV2JobIamPolicyGenerated[Debug log]
TestAccCloudRunV2JobIamMemberGenerated[Debug log]
TestAccCloudRunV2JobIamBindingGenerated[Debug log]

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

Please fix these to complete your PR
View the build log or the debug log for each test

@yanweiguo
Copy link
Member Author

This will make it so that when maxRetries is not set by the user in their config we will send the value of 0 to the API.

Is that an acceptable behavior?

No. What I want is when users set maxRetries to 0, it will be sent to the API instead of being ignored.

@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 ( 2 files changed, 2 insertions(+), 2 deletions(-))
Terraform Beta: Diff ( 2 files changed, 2 insertions(+), 2 deletions(-))
TF Validator: Diff ( 3 files changed, 4 insertions(+), 4 deletions(-))

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 2568
Passed tests 2288
Skipped tests: 267
Affected tests: 13

Action taken

Found 13 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
TestAccNetworkServicesGateway_update|TestAccFirebaserulesRelease_BasicRelease|TestAccComputeInstanceFromRegionTemplate_basic|TestAccComposerEnvironment_withEncryptionConfigComposer2|TestAccCloudRunV2Job_cloudrunv2JobVpcaccessExample|TestAccCloudRunV2Job_cloudrunv2JobSecretExample|TestAccCloudRunV2Job_cloudrunv2JobFullUpdate|TestAccDataSourceDNSKeys_basic|TestAccDataSourceDNSKeys_noDnsSec|TestAccFrameworkProviderBasePath_setBasePath|TestAccFrameworkProviderMeta_setModuleName|TestAccDataSourceDnsRecordSet_basic|TestAccDataSourceDnsManagedZone_basic

Get to know how VCR tests work

@modular-magician
Copy link
Collaborator

Tests passed during RECORDING mode:
TestAccNetworkServicesGateway_update[Debug log]
TestAccFirebaserulesRelease_BasicRelease[Debug log]
TestAccComputeInstanceFromRegionTemplate_basic[Debug log]
TestAccCloudRunV2Job_cloudrunv2JobVpcaccessExample[Debug log]
TestAccCloudRunV2Job_cloudrunv2JobSecretExample[Debug log]
TestAccDataSourceDNSKeys_basic[Debug log]
TestAccDataSourceDNSKeys_noDnsSec[Debug log]
TestAccFrameworkProviderBasePath_setBasePath[Debug log]
TestAccFrameworkProviderMeta_setModuleName[Debug log]
TestAccDataSourceDnsRecordSet_basic[Debug log]
TestAccDataSourceDnsManagedZone_basic[Debug log]

Tests failed during RECORDING mode:
TestAccComposerEnvironment_withEncryptionConfigComposer2[Error message] [Debug log]
TestAccCloudRunV2Job_cloudrunv2JobFullUpdate[Error message] [Debug log]

Please fix these to complete your PR
View the build log or the debug log for each test

@yanweiguo yanweiguo changed the title Allows empty value for maxRetries of cloud run job Allows empty value and sets default value for maxRetries of cloud run job Mar 29, 2023
@yanweiguo
Copy link
Member Author

Added default_value as well. PTAL.

Copy link
Contributor

@slevenick slevenick left a comment

Choose a reason for hiding this comment

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

One small change, other than that it looks fine

mmv1/products/cloudrunv2/Job.yaml Outdated Show resolved Hide resolved
@slevenick
Copy link
Contributor

/gcbrun

@modular-magician
Copy link
Collaborator

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

Breaking Change(s) Detected

The following breaking change(s) were detected within your pull request.

  • Field template.template.max_retries default value changed from to 3 on google_cloud_run_v2_job - reference
  • Field template.template.max_retries transitioned from optional+computed to optional google_cloud_run_v2_job - reference

If you believe this detection to be incorrect please raise the concern with your reviewer. If you intend to make this change you will need to wait for a major release window. An override-breaking-change label can be added to allow merging.

Diff report

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

Terraform GA: Diff ( 2 files changed, 3 insertions(+), 3 deletions(-))
Terraform Beta: Diff ( 2 files changed, 3 insertions(+), 3 deletions(-))
TF Validator: Diff ( 3 files changed, 4 insertions(+), 4 deletions(-))

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 2549
Passed tests 2262
Skipped tests: 275
Affected tests: 12

Action taken

Found 12 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
TestAccCloudRunV2Job_cloudrunv2JobBasicExample|TestAccCloudRunV2Job_cloudrunv2JobSecretExample|TestAccCloudRunV2Job_cloudrunv2JobFullUpdate|TestAccCloudRunV2Job_cloudrunv2JobVpcaccessExample|TestAccCloudRunV2Job_cloudrunv2JobSqlExample|TestAccComposerEnvironment_withEncryptionConfigComposer2|TestAccApigeeEnvKeystoreAliasPkcs12_apigeeEnvKeystoreAliasPkcs12Example|TestAccApigeeKeystoresAliasesKeyCertFile_apigeeKeystoresAliasesKeyCertFileTestExample|TestAccCloudRunV2JobIamBindingGenerated|TestAccCloudRunV2JobIamPolicyGenerated|TestAccCloudRunV2JobIamMemberGenerated|TestAccDataSourceGoogleFirebaseAndroidAppConfig

Get to know how VCR tests work

@modular-magician
Copy link
Collaborator

Tests passed during RECORDING mode:
TestAccCloudRunV2Job_cloudrunv2JobBasicExample[Debug log]
TestAccCloudRunV2Job_cloudrunv2JobSecretExample[Debug log]
TestAccCloudRunV2Job_cloudrunv2JobFullUpdate[Debug log]
TestAccCloudRunV2Job_cloudrunv2JobVpcaccessExample[Debug log]
TestAccCloudRunV2Job_cloudrunv2JobSqlExample[Debug log]
TestAccApigeeEnvKeystoreAliasPkcs12_apigeeEnvKeystoreAliasPkcs12Example[Debug log]
TestAccApigeeKeystoresAliasesKeyCertFile_apigeeKeystoresAliasesKeyCertFileTestExample[Debug log]
TestAccCloudRunV2JobIamBindingGenerated[Debug log]
TestAccCloudRunV2JobIamPolicyGenerated[Debug log]
TestAccCloudRunV2JobIamMemberGenerated[Debug log]

Tests failed during RECORDING mode:
TestAccComposerEnvironment_withEncryptionConfigComposer2[Error message] [Debug log]
TestAccDataSourceGoogleFirebaseAndroidAppConfig[Error message] [Debug log]

Please fix these to complete your PR
View the build log or the debug log for each test

@slevenick slevenick added the override-breaking-change Allows a potential breaking change to be merged label Apr 5, 2023
@slevenick slevenick requested a review from rileykarson April 5, 2023 16:04
Copy link
Contributor

@slevenick slevenick left a comment

Choose a reason for hiding this comment

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

LGTM. Adding @rileykarson as a secondary reviewer because this is technically a breaking change

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.

LGTM- as discussed offline this may result in a diff in limited circumstances: configurations that have set a non-default value and then been updated to remove the field. Restoring drift detection is generally not considered to be a breaking change, although this is not a kind of change we want to be making regularly.

@slevenick slevenick merged commit e6c5bfa into GoogleCloudPlatform:main Apr 5, 2023
jingcongw pushed a commit to jingcongw/magic-modules-test that referenced this pull request Apr 7, 2023
… job (GoogleCloudPlatform#7425)

* send empty value

* add client side default

* remove defaul_from_api
hao-nan-li pushed a commit to hao-nan-li/magic-modules that referenced this pull request Apr 11, 2023
… job (GoogleCloudPlatform#7425)

* send empty value

* add client side default

* remove defaul_from_api
maphad pushed a commit to maphad/magic-modules that referenced this pull request Apr 12, 2023
… job (GoogleCloudPlatform#7425)

* send empty value

* add client side default

* remove defaul_from_api
ericayyliu pushed a commit to ericayyliu/magic-modules that referenced this pull request Jul 26, 2023
… job (GoogleCloudPlatform#7425)

* send empty value

* add client side default

* remove defaul_from_api
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
override-breaking-change Allows a potential breaking change to be merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Terraform Cloud everytime outputs as planned changes to set Cloud Run Job max_retries from 3 to 0
4 participants