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

Add support for visible_core_count for google_compute_instance resource #6414

Merged

Conversation

prateek2408
Copy link
Contributor

@prateek2408 prateek2408 commented Aug 16, 2022

Adding support for visible cores under google_compute_instance resource https://cloud.google.com/compute/docs/instances/customize-visible-cores

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).
  • Generated Terraform, and ran make test and make lint to ensure it passes unit and linter tests.
  • 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).
  • Ran relevant acceptance tests (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)

compute: Added support for param `visible_core_count` in `google_compute_instance` and `google_compute_instance_template` under `advanced_machine_features`

@modular-magician
Copy link
Collaborator

Oops! It looks like you're using an unknown release-note type in your changelog entries:

  • REPLACEME

Please only use the types listed in https://github.com/GoogleCloudPlatform/magic-modules/blob/master/.ci/RELEASE_NOTES_GUIDE.md.

@modular-magician
Copy link
Collaborator

Hello! I am a robot who works on Magic Modules PRs.

I've detected that you're a community contributor. @slevenick, a repository maintainer, has been assigned to assist you and help review your changes.

❓ First time contributing? Click here for more details

Your assigned reviewer will help review your code by:

  • Ensuring it's backwards compatible, covers common error cases, etc.
  • Summarizing the change into a user-facing changelog note.
  • Passes tests, either our "VCR" suite, a set of presubmit tests, or with manual test runs.

You can help make sure that review is quick by running local tests and ensuring they're passing in between each push you make to your PR's branch. Also, try to leave a comment with each push you make, as pushes generally don't generate emails.

If your reviewer doesn't get back to you within a week after your most recent change, please feel free to leave a comment on the issue asking them to take a look! In the absence of a dedicated review dashboard most maintainers manage their pending reviews through email, and those will sometimes get lost in their inbox.


@modular-magician
Copy link
Collaborator

Oops! It looks like you're using an unknown release-note type in your changelog entries:

  • REPLACEME

Please only use the types listed in https://github.com/GoogleCloudPlatform/magic-modules/blob/master/.ci/RELEASE_NOTES_GUIDE.md.

@modular-magician
Copy link
Collaborator

Hi! I'm the modular magician. Your PR generated some diffs in downstreams - here they are.

Diff report:

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

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 2130
Passed tests 1894
Skipped tests: 227
Failed tests: 9

Action taken

Triggering VCR tests in RECORDING mode for the tests that failed during VCR. Click here to see the failed tests
TestAccComputeInstance_networkPerformanceConfig|TestAccComputeInstance_soleTenantNodeAffinities|TestAccComputeGlobalForwardingRule_internalLoadBalancing|TestAccCloudfunctions2function_cloudfunctions2BasicAuditlogsExample|TestAccCloudfunctions2function_cloudfunctions2BasicGcsExample|TestAccCloudFunctions2Function_fullUpdate|TestAccCloudRunService_cloudRunServiceStaticOutboundExample|TestAccPrivatecaCertificateAuthority_privatecaCertificateAuthoritySubordinateExample|TestAccSqlUser_mysqlDisabled

@modular-magician
Copy link
Collaborator

Tests passed during RECORDING mode:
TestAccCloudfunctions2function_cloudfunctions2BasicAuditlogsExample[view]
TestAccCloudfunctions2function_cloudfunctions2BasicGcsExample[view]
TestAccCloudFunctions2Function_fullUpdate[view]
TestAccPrivatecaCertificateAuthority_privatecaCertificateAuthoritySubordinateExample[view]
TestAccSqlUser_mysqlDisabled[view]

Tests failed during RECORDING mode:
TestAccComputeInstance_networkPerformanceConfig[view]
TestAccComputeInstance_soleTenantNodeAffinities[view]
TestAccComputeGlobalForwardingRule_internalLoadBalancing[view]
TestAccCloudRunService_cloudRunServiceStaticOutboundExample[view]

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

@modular-magician
Copy link
Collaborator

Oops! It looks like you're using an unknown release-note type in your changelog entries:

  • REPLACEME

Please only use the types listed in https://github.com/GoogleCloudPlatform/magic-modules/blob/master/.ci/RELEASE_NOTES_GUIDE.md.

@modular-magician
Copy link
Collaborator

Hi! I'm the modular magician. Your PR generated some diffs in downstreams - here they are.

Diff report:

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

@modular-magician
Copy link
Collaborator

Oops! It looks like you're using an unknown release-note type in your changelog entries:

  • REPLACEME

Please only use the types listed in https://github.com/GoogleCloudPlatform/magic-modules/blob/master/.ci/RELEASE_NOTES_GUIDE.md.

@prateek2408 prateek2408 marked this pull request as ready for review August 19, 2022 10:36
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.

This looks like it fails to build correctly. Are you able to build & run the tests locally?

@prateek2408
Copy link
Contributor Author

@slevenick - How can I see why the build is failing in case of CI/CD. I am unable to see the project logs in GCP due to permission issues.

Locally I tested and the only reason it can fail when validator is not built with version=ga parameter. Here is a snippet-

make test
# Skip integration tests in ./test/ using -short flag
GO111MODULE=on go test -short ./...
# github.com/GoogleCloudPlatform/terraform-validator/converters/google/resources
converters/google/resources/compute_instance_helpers.go:399:3: unknown field 'VisibleCoreCount' in struct literal of type compute.AdvancedMachineFeatures
converters/google/resources/compute_instance_helpers.go:410:59: AdvancedMachineFeatures.VisibleCoreCount undefined (type *compute.AdvancedMachineFeatures has no field or method VisibleCoreCount)
FAIL    github.com/GoogleCloudPlatform/terraform-validator/ancestrymanager [build failed]
FAIL    github.com/GoogleCloudPlatform/terraform-validator/cmd [build failed]
FAIL    github.com/GoogleCloudPlatform/terraform-validator/converters/google [build failed]
FAIL    github.com/GoogleCloudPlatform/terraform-validator/converters/google/resources [build failed]
FAIL    github.com/GoogleCloudPlatform/terraform-validator/test [build failed]
ok      github.com/GoogleCloudPlatform/terraform-validator/tfdata       (cached)
FAIL    github.com/GoogleCloudPlatform/terraform-validator/tfgcv [build failed]
ok      github.com/GoogleCloudPlatform/terraform-validator/tfplan       (cached)
make: *** [test] Error 2

@prateek2408
Copy link
Contributor Author

prateek2408 commented Aug 23, 2022

@slevenick - Since the config is only present in beta I guarded the changes under the beta flag. I am able to build locally now without any flags as well.

@modular-magician
Copy link
Collaborator

Hi! I'm the modular magician. Your PR generated some diffs in downstreams - here they are.

Diff report:

Terraform GA: Diff ( 6 files changed, 20 insertions(+), 1 deletion(-))
Terraform Beta: Diff ( 7 files changed, 22 insertions(+), 1 deletion(-))
TF Validator: Diff ( 2 files changed, 3 insertions(+), 3 deletions(-))

@modular-magician
Copy link
Collaborator

The provider crashed while running the VCR tests in REPLAYING mode
Please fix it to complete your PR
View the build log

@modular-magician
Copy link
Collaborator

Hi! I'm the modular magician. Your PR generated some diffs in downstreams - here they are.

Diff report:

Terraform GA: Diff ( 6 files changed, 20 insertions(+), 1 deletion(-))
Terraform Beta: Diff ( 7 files changed, 22 insertions(+), 1 deletion(-))
TF Validator: Diff ( 2 files changed, 3 insertions(+), 3 deletions(-))

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 2140
Passed tests 1898
Skipped tests: 228
Failed tests: 14

Action taken

Triggering VCR tests in RECORDING mode for the tests that failed during VCR. Click here to see the failed tests
TestAccComputeInstance_advancedMachineFeatures|TestAccComputeInstance_networkPerformanceConfig|TestAccComputeInstance_soleTenantNodeAffinities|TestAccComputeInstanceTemplate_AdvancedMachineFeatures|TestAccComputeGlobalForwardingRule_internalLoadBalancing|TestAccCloudFunctions2Function_fullUpdate|TestAccCGCSnippet_eventarcWorkflowsExample|TestAccCloudRunService_cloudRunServiceStaticOutboundExample|TestAccCloudfunctions2function_cloudfunctions2BasicGcsExample|TestAccCloudfunctions2function_cloudfunctions2BasicAuditlogsExample|TestAccSqlDatabaseInstance_SqlServerAuditConfig|TestAccSqlDatabaseInstance_withPrivateNetwork_withAllocatedIpRange|TestAccPrivatecaCertificateAuthority_privatecaCertificateAuthoritySubordinateExample|TestAccFirebaserulesRelease_BasicRelease

@modular-magician
Copy link
Collaborator

Tests passed during RECORDING mode:
TestAccComputeInstanceTemplate_AdvancedMachineFeatures[view]
TestAccCloudFunctions2Function_fullUpdate[view]
TestAccCGCSnippet_eventarcWorkflowsExample[view]
TestAccCloudfunctions2function_cloudfunctions2BasicGcsExample[view]
TestAccCloudfunctions2function_cloudfunctions2BasicAuditlogsExample[view]
TestAccFirebaserulesRelease_BasicRelease[view]

Tests failed during RECORDING mode:
TestAccComputeInstance_advancedMachineFeatures[view]
TestAccComputeInstance_networkPerformanceConfig[view]
TestAccComputeInstance_soleTenantNodeAffinities[view]
TestAccComputeGlobalForwardingRule_internalLoadBalancing[view]
TestAccCloudRunService_cloudRunServiceStaticOutboundExample[view]
TestAccSqlDatabaseInstance_SqlServerAuditConfig[view]
TestAccSqlDatabaseInstance_withPrivateNetwork_withAllocatedIpRange[view]
TestAccPrivatecaCertificateAuthority_privatecaCertificateAuthoritySubordinateExample[view]

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

@modular-magician
Copy link
Collaborator

Hi! I'm the modular magician. Your PR generated some diffs in downstreams - here they are.

Diff report:

Terraform GA: Diff ( 6 files changed, 20 insertions(+), 2 deletions(-))
Terraform Beta: Diff ( 7 files changed, 23 insertions(+), 2 deletions(-))
TF Validator: Diff ( 2 files changed, 3 insertions(+), 3 deletions(-))

@modular-magician
Copy link
Collaborator

Hi! I'm the modular magician. Your PR generated some diffs in downstreams - here they are.

Diff report:

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

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 2144
Passed tests 1900
Skipped tests: 230
Failed tests: 14

Action taken

Triggering VCR tests in RECORDING mode for the tests that failed during VCR. Click here to see the failed tests
TestAccComputeInstance_soleTenantNodeAffinities|TestAccComputeGlobalForwardingRule_internalLoadBalancing|TestAccCloudfunctions2function_cloudfunctions2BasicAuditlogsExample|TestAccCloudfunctions2function_cloudfunctions2BasicGcsExample|TestAccCloudRunService_cloudRunServiceScheduledExample|TestAccCloudFunctions2Function_fullUpdate|TestAccCGCSnippet_storageObjectLifecycleSettingExample|TestAccCGCSnippet_eventarcWorkflowsExample|TestAccCloudRunService_cloudRunServiceStaticOutboundExample|TestAccPrivatecaCertificateAuthority_privatecaCertificateAuthoritySubordinateExample|TestAccSqlDatabaseInstance_SqlServerAuditConfig|TestAccSqlDatabaseInstance_withPrivateNetwork_withAllocatedIpRange|TestAccSqlUser_mysqlDisabled|TestAccDataSourceGoogleServiceAccountJwt

@modular-magician
Copy link
Collaborator

Tests passed during RECORDING mode:
TestAccCloudfunctions2function_cloudfunctions2BasicAuditlogsExample[view]
TestAccSqlUser_mysqlDisabled[view]
TestAccDataSourceGoogleServiceAccountJwt[view]

Tests failed during RECORDING mode:
TestAccComputeInstance_soleTenantNodeAffinities[view]
TestAccComputeGlobalForwardingRule_internalLoadBalancing[view]
TestAccCloudfunctions2function_cloudfunctions2BasicGcsExample[view]
TestAccCloudRunService_cloudRunServiceScheduledExample[view]
TestAccCloudFunctions2Function_fullUpdate[view]
TestAccCGCSnippet_storageObjectLifecycleSettingExample[view]
TestAccCGCSnippet_eventarcWorkflowsExample[view]
TestAccCloudRunService_cloudRunServiceStaticOutboundExample[view]
TestAccPrivatecaCertificateAuthority_privatecaCertificateAuthoritySubordinateExample[view]
TestAccSqlDatabaseInstance_SqlServerAuditConfig[view]
TestAccSqlDatabaseInstance_withPrivateNetwork_withAllocatedIpRange[view]

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

@prateek2408
Copy link
Contributor Author

This is still being added to the GA provider, when it should not be: https://github.com/modular-magician/terraform-provider-google/compare/auto-pr-6414-old..auto-pr-6414

Can you add the version guards around all except for the documentation?

Fixed it, seems some files were missed earlier

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.

Couple minor changes needed, but overall looks good

@modular-magician
Copy link
Collaborator

Hi! I'm the modular magician. Your PR generated some diffs in downstreams - here they are.

Diff report:

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

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 2146
Passed tests 1905
Skipped tests: 232
Failed tests: 9

Action taken

Triggering VCR tests in RECORDING mode for the tests that failed during VCR. Click here to see the failed tests
TestAccFirebaserulesRelease_BasicRelease|TestAccComputeGlobalForwardingRule_internalLoadBalancing|TestAccComputeInstance_soleTenantNodeAffinities|TestAccCloudFunctions2Function_fullUpdate|TestAccCloudRunService_cloudRunServiceStaticOutboundExample|TestAccCloudfunctions2function_cloudfunctions2BasicGcsExample|TestAccPrivatecaCertificateAuthority_privatecaCertificateAuthoritySubordinateExample|TestAccSqlDatabaseInstance_SqlServerAuditConfig|TestAccSqlDatabaseInstance_withPrivateNetwork_withAllocatedIpRange

@modular-magician
Copy link
Collaborator

Tests passed during RECORDING mode:
TestAccFirebaserulesRelease_BasicRelease[view]
TestAccCloudFunctions2Function_fullUpdate[view]
TestAccCloudfunctions2function_cloudfunctions2BasicGcsExample[view]

Tests failed during RECORDING mode:
TestAccComputeGlobalForwardingRule_internalLoadBalancing[view]
TestAccComputeInstance_soleTenantNodeAffinities[view]
TestAccCloudRunService_cloudRunServiceStaticOutboundExample[view]
TestAccPrivatecaCertificateAuthority_privatecaCertificateAuthoritySubordinateExample[view]
TestAccSqlDatabaseInstance_SqlServerAuditConfig[view]
TestAccSqlDatabaseInstance_withPrivateNetwork_withAllocatedIpRange[view]

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

@modular-magician
Copy link
Collaborator

Hi! I'm the modular magician. Your PR generated some diffs in downstreams - here they are.

Diff report:

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

@modular-magician
Copy link
Collaborator

Hi! I'm the modular magician. Your PR generated some diffs in downstreams - here they are.

Diff report:

Terraform GA: Diff ( 2 files changed, 5 insertions(+), 1 deletion(-))
Terraform Beta: Diff ( 7 files changed, 21 insertions(+), 1 deletion(-))
TF Validator: Diff ( 2 files changed, 3 insertions(+), 3 deletions(-))

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 2146
Passed tests 1907
Skipped tests: 232
Failed tests: 7

Action taken

Triggering VCR tests in RECORDING mode for the tests that failed during VCR. Click here to see the failed tests
TestAccComputeInstance_soleTenantNodeAffinities|TestAccComputeGlobalForwardingRule_internalLoadBalancing|TestAccCloudRunService_cloudRunServiceStaticOutboundExample|TestAccCGCSnippet_eventarcWorkflowsExample|TestAccSqlDatabaseInstance_SqlServerAuditConfig|TestAccSqlDatabaseInstance_withPrivateNetwork_withAllocatedIpRange|TestAccPrivatecaCertificateAuthority_privatecaCertificateAuthoritySubordinateExample

@modular-magician
Copy link
Collaborator

Tests failed during RECORDING mode:
TestAccComputeInstance_soleTenantNodeAffinities[view]
TestAccComputeGlobalForwardingRule_internalLoadBalancing[view]
TestAccCloudRunService_cloudRunServiceStaticOutboundExample[view]
TestAccCGCSnippet_eventarcWorkflowsExample[view]
TestAccSqlDatabaseInstance_SqlServerAuditConfig[view]
TestAccSqlDatabaseInstance_withPrivateNetwork_withAllocatedIpRange[view]
TestAccPrivatecaCertificateAuthority_privatecaCertificateAuthoritySubordinateExample[view]

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

@prateek2408
Copy link
Contributor Author

@slevenick - I incorporated the comments. I skipped adding visible_core_count in AtLeastOneOf as it is beta field. Adding this might cause the ga provided to get this as well.

Thoughts ?

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.

Looks good, thanks!

@slevenick slevenick merged commit 193287d into GoogleCloudPlatform:main Aug 26, 2022
@prateek2408 prateek2408 deleted the support_for_visible_core_count branch August 29, 2022 05:12
hao-nan-li pushed a commit to hao-nan-li/magic-modules that referenced this pull request Sep 6, 2022
…ce (GoogleCloudPlatform#6414)

* add support for threads per core

* adding missing comma

* add support for threads per core

* guard changes with beta flag

* fixing typo

* fixing value

* guarding changes with flags

* annoting doc attribute with beta tag

* annoting doc attribute with beta tag

* missing comma

* adding guards for beta params

* adding guards for beta params

* incoprated comments

* incoprated comments
renescheepers pushed a commit to renescheepers/magic-modules that referenced this pull request Sep 7, 2022
…ce (GoogleCloudPlatform#6414)

* add support for threads per core

* adding missing comma

* add support for threads per core

* guard changes with beta flag

* fixing typo

* fixing value

* guarding changes with flags

* annoting doc attribute with beta tag

* annoting doc attribute with beta tag

* missing comma

* adding guards for beta params

* adding guards for beta params

* incoprated comments

* incoprated comments
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.

3 participants