-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Prioritize disk.DiskSizeGb over disk.InitializeParams.DiskSizeGb #8246
Conversation
Oops! It looks like you're using an unknown release-note type in your changelog entries:
Please only use the types listed in https://github.com/GoogleCloudPlatform/magic-modules/blob/master/.ci/RELEASE_NOTES_GUIDE.md. |
Hello! I am a robot who works on Magic Modules PRs. I've detected that you're a community contributor. @hao-nan-li, a repository maintainer, has been assigned to assist you and help review your changes. ❓ First time contributing? Click here for more detailsYour assigned reviewer will help review your code by:
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. |
Note to self to fix the whitespace alignment of added code. |
"disk_size_gb2" needs a better name, but I left it as a placeholder so we could have that conversation in the review. |
Hi there, I'm the Modular magician. I've detected the following information about your changes: Diff reportYour PR generated some diffs in downstreams - here they are. Terraform GA: Diff ( 1 file changed, 31 insertions(+), 2 deletions(-)) Missing test reportYour PR includes resource fields which are not covered by any test. Resource: Please add acceptance tests which include these fields. |
The provider crashed while running the VCR tests in REPLAYING mode |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FYI tests are crashing due to google_compute_region_instance_template
reusing the flatteners and expanders from google_compute_instance_template
. Any additional fields would also need to be added there.
Oops! It looks like you're using an unknown release-note type in your changelog entries:
Please only use the types listed in https://github.com/GoogleCloudPlatform/magic-modules/blob/master/.ci/RELEASE_NOTES_GUIDE.md. |
Hi there, I'm the Modular magician. I've detected the following information about your changes: Diff reportYour PR generated some diffs in downstreams - here they are. Terraform GA: Diff ( 1 file changed, 31 insertions(+), 2 deletions(-)) Missing test reportYour PR includes resource fields which are not covered by any test. Resource: Please add acceptance tests which include these fields. |
The provider crashed while running the VCR tests in REPLAYING mode |
Oops! It looks like you're using an unknown release-note type in your changelog entries:
Please only use the types listed in https://github.com/GoogleCloudPlatform/magic-modules/blob/master/.ci/RELEASE_NOTES_GUIDE.md. |
Hi there, I'm the Modular magician. I've detected the following information about your changes: Diff reportYour PR generated some diffs in downstreams - here they are. Terraform GA: Diff ( 1 file changed, 12 insertions(+), 5 deletions(-)) |
Oops! It looks like you're using an unknown release-note type in your changelog entries:
Please only use the types listed in https://github.com/GoogleCloudPlatform/magic-modules/blob/master/.ci/RELEASE_NOTES_GUIDE.md. |
// The API does not return a disk size value for scratch disks. They are largely only one size, | ||
// so we can assume that size here. Prefer disk.DiskSizeGb over the deprecated | ||
// disk.InitializeParams.DiskSizeGb. | ||
if disk.DiskSizeGb == 0 && disk.InitializeParams.DiskSizeGb == 0 && disk.Type == "SCRATCH" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Possible logic bug, past and present: If the disk is not of type SCRATCH, we move past the if into the else-if and else blocks. I can put a guard here wrapping this entire section checking for SCRATCH, but it more closely emulates the existing code to not do so.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks correct as-is to me. If the disk type is not SCRATCH
and both DiskSizeGb
fields are 0 we can set disk_size_gb
to 0.
Hi there, I'm the Modular magician. I've detected the following information about your changes: Diff reportYour PR generated some diffs in downstreams - here they are. Terraform GA: Diff ( 1 file changed, 11 insertions(+), 4 deletions(-)) |
// The API does not return a disk size value for scratch disks. They are largely only one size, | ||
// so we can assume that size here. Prefer disk.DiskSizeGb over the deprecated | ||
// disk.InitializeParams.DiskSizeGb. | ||
if disk.DiskSizeGb == 0 && disk.InitializeParams.DiskSizeGb == 0 && disk.Type == "SCRATCH" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks correct as-is to me. If the disk type is not SCRATCH
and both DiskSizeGb
fields are 0 we can set disk_size_gb
to 0.
Tests analyticsTotal tests: Action takenFound 33 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected testsTestAccComputeRegionInstanceTemplate_minCpuPlatform|TestAccComputeRegionInstanceTemplate_guestAcceleratorSkip|TestAccComputeRegionInstanceTemplate_guestAccelerator|TestAccComputeRegionInstanceTemplate_secondaryAliasIpRange|TestAccComputeRegionInstanceTemplate_primaryAliasIpRange|TestAccComputeRegionInstanceTemplate_metadata_startup_script|TestAccComputeRegionInstanceTemplate_subnet_custom|TestAccComputeRegionAutoscaler_regionAutoscalerBasicExample|TestAccComputeRegionInstanceTemplate_subnet_auto|TestAccComputeRegionInstanceTemplate_regionDisks|TestAccComputeInstanceTemplate_withScratchDisk|TestAccComputeInstanceFromTemplate_012_removableFields|TestAccComputeInstanceFromTemplate_overrideScratchDisk|TestAccComputeInstanceFromTemplate_overrideAttachedDisk|TestAccComputeInstanceFromTemplate_overrideBootDisk|TestAccComputeInstanceFromRegionTemplate_basic|TestAccComputeInstanceFromTemplate_self_link_unique|TestAccComputeInstanceFromTemplate_basic|TestAccComputeInstanceTemplate_minCpuPlatform|TestAccComputeInstanceTemplate_guestAcceleratorSkip|TestAccComputeInstanceTemplate_guestAccelerator|TestAccComputeInstanceTemplate_secondaryAliasIpRange|TestAccComputeInstanceTemplate_primaryAliasIpRange|TestAccComputeInstanceTemplate_metadata_startup_script|TestAccComputeFirewallPolicyRule_multipleRules|TestAccComputeRegionInstanceTemplate_with18TbScratchDisk|TestAccComputeInstanceTemplate_subnet_custom|TestAccComputeRegionInstanceTemplate_withScratchDisk|TestAccComputeInstanceTemplate_subnet_auto|TestAccComputeInstanceTemplate_regionDisks|TestAccComputeInstanceTemplate_NetworkAttachment|TestAccComputeInstanceTemplate_disks|TestAccComputeInstanceTemplate_with18TbScratchDisk |
Tests passed during RECORDING mode: Rerun these tests in REPLAYING mode to catch issuesAll tests passed after rerunning REPLAYING mode. Several tests got terminated during RECORDING mode. |
…gleCloudPlatform#8246) * Add and prefer AttachedDisk.DiskSizeGb over AttachedDisk.InitializeParams.DiskSizeGb * Fix a paren out of place * Add DiskSizeGb outside InitializeParams as a separate field. * Undo unnecessary changes * use one field instead of two * use one field instead of two
…gleCloudPlatform#8246) * Add and prefer AttachedDisk.DiskSizeGb over AttachedDisk.InitializeParams.DiskSizeGb * Fix a paren out of place * Add DiskSizeGb outside InitializeParams as a separate field. * Undo unnecessary changes * use one field instead of two * use one field instead of two
…gleCloudPlatform#8246) * Add and prefer AttachedDisk.DiskSizeGb over AttachedDisk.InitializeParams.DiskSizeGb * Fix a paren out of place * Add DiskSizeGb outside InitializeParams as a separate field. * Undo unnecessary changes * use one field instead of two * use one field instead of two
If this PR is for Terraform, I acknowledge that I have:
make test
andmake lint
in the generated providers to ensure it passes unit and linter tests.Release Note Template for Downstream PRs (will be copied)