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 the subnetLength field to the InterconnectAttachment resource #10722

Merged
merged 9 commits into from
May 20, 2024

Conversation

bopas2
Copy link
Contributor

@bopas2 bopas2 commented May 16, 2024

Add the subnetLength field to the InterconnectAttachment resource

compute: added `subnet_length` field to `google_compute_interconnect_attachment` resource

Copy link

Hello! I am a robot. Tests will require approval from a repository maintainer to run.

@roaks3, a repository maintainer, has been assigned to review your changes. If you have not received review feedback within 2 business days, please leave a comment on this PR asking them to take a look.

You can help make sure that review is quick by doing a self-review and by running impacted tests locally.

@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 ( 3 files changed, 52 insertions(+))
google-beta provider: Diff ( 3 files changed, 52 insertions(+))
terraform-google-conversion: Diff ( 1 file changed, 10 insertions(+))
Open in Cloud Shell: Diff ( 1 file changed, 1 insertion(+))

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 917
Passed tests: 844
Skipped tests: 72
Affected tests: 1

Click here to see the affected service packages
  • compute

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
TestAccComputeInterconnectAttachment_interconnectAttachmentBasicExample

Get to know how VCR tests work

@modular-magician
Copy link
Collaborator

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

$\textcolor{red}{\textsf{Please fix these 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 ( 2 files changed, 50 insertions(+))
google-beta provider: Diff ( 2 files changed, 50 insertions(+))
terraform-google-conversion: Diff ( 1 file changed, 10 insertions(+))

Missing test report

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

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

resource "google_compute_interconnect_attachment" "primary" {
  subnet_length = # value needed
}

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 917
Passed tests: 845
Skipped tests: 72
Affected tests: 0

Click here to see the affected service packages
  • compute

$\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 ( 3 files changed, 115 insertions(+), 6 deletions(-))
google-beta provider: Diff ( 3 files changed, 115 insertions(+), 6 deletions(-))
terraform-google-conversion: Diff ( 1 file changed, 10 insertions(+))
Open in Cloud Shell: Diff ( 4 files changed, 136 insertions(+))

Missing test report

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

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

resource "google_compute_interconnect_attachment" "primary" {
  stack_type = # 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 ( 3 files changed, 116 insertions(+), 6 deletions(-))
google-beta provider: Diff ( 3 files changed, 116 insertions(+), 6 deletions(-))
terraform-google-conversion: Diff ( 1 file changed, 10 insertions(+))
Open in Cloud Shell: Diff ( 4 files changed, 137 insertions(+))

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 922
Passed tests: 849
Skipped tests: 72
Affected tests: 1

Click here to see the affected service packages
  • compute

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
TestAccComputeInterconnectAttachment_interconnectAttachmentDedicatedExample

Get to know how VCR tests work

@modular-magician
Copy link
Collaborator

$\textcolor{green}{\textsf{Tests passed during RECORDING mode:}}$
TestAccComputeInterconnectAttachment_interconnectAttachmentDedicatedExample[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

Tests analytics

Total tests: 922
Passed tests: 849
Skipped tests: 72
Affected tests: 1

Click here to see the affected service packages
  • compute

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
TestAccComputeInterconnectAttachment_interconnectAttachmentDedicatedExample

Get to know how VCR tests work

@modular-magician
Copy link
Collaborator

$\textcolor{green}{\textsf{Tests passed during RECORDING mode:}}$
TestAccComputeInterconnectAttachment_interconnectAttachmentDedicatedExample[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

Copy link
Contributor

@roaks3 roaks3 left a comment

Choose a reason for hiding this comment

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

Overall LGTM, but just checking if the field config is correct, and I'm not sure the test is ideal.

interconnect = google_compute_interconnect.foobar.id
router = google_compute_router.foobar.id
mtu = 1500
subnet_length = 0
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm a little confused about this test. The description for the field says that 29 and 30 are valid values, but here we are testing 0. Because of how TF handles zero-values, this might not even be sent to the server (ie. the equivalent of not setting the field). Is it not possible to test with the suggested values of 29 or 30?

Also, is the default value set on the server? If so, you may need to add default_from_api: true.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added the default_from_api field.

Followed up about the 0 value offline.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ok, confirmed that this value is not being sent:

---[ REQUEST ]---------------------------------------
POST /compute/beta/projects/ci-test-project-188019/regions/us-east4/interconnectAttachments?alt=json HTTP/1.1
Host: compute.googleapis.com
User-Agent: Terraform/1.2.5 (+https://www.terraform.io) Terraform-Plugin-SDK/2.33.0 terraform-provider-google-beta/acc
Content-Length: 429
Content-Type: application/json
Accept-Encoding: gzip

{
 "adminEnabled": true,
 "encryption": "NONE",
 "interconnect": "projects/ci-test-project-188019/global/interconnects/tf-test-interconenct-18x24pgb1wd",
 "mtu": "1500",
 "name": "tf-test-on-prem-attachment8x24pgb1wd",
 "region": "projects/ci-test-project-188019/global/regions/us-east4",
 "router": "projects/ci-test-project-188019/regions/us-east4/routers/tf-test-router-18x24pgb1wd",
 "stackType": "IPV4_ONLY",
 "type": "DEDICATED",
 "vlanTag8021q": 1000
}

If the 0 truly holds value here (I'm still not 100% clear), you may want to use the config send_empty_value: true to allow it to be sent. Otherwise, I believe there isn't any value in the test, and we should just remove it. I know there are limitations with this particular resource, and it is only a single field that is not being tested. It would be nice to have some sort of future-looking plan to test this, if possible, but not blocking.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok, that plan sounds good to me. I will file a bug for our team to go back and add a test for this field in the future. Thanks!

@github-actions github-actions bot requested a review from roaks3 May 17, 2024 16:14
@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 ( 3 files changed, 117 insertions(+), 6 deletions(-))
google-beta provider: Diff ( 3 files changed, 117 insertions(+), 6 deletions(-))
terraform-google-conversion: Diff ( 1 file changed, 10 insertions(+))
Open in Cloud Shell: Diff ( 4 files changed, 137 insertions(+))

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 922
Passed tests: 850
Skipped tests: 72
Affected tests: 0

Click here to see the affected service packages
  • compute

$\textcolor{green}{\textsf{All tests passed!}}$
View the build log

Copy link
Contributor

@roaks3 roaks3 left a comment

Choose a reason for hiding this comment

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

LGTM, just waiting on checks to complete before merge

@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 ( 2 files changed, 51 insertions(+), 6 deletions(-))
google-beta provider: Diff ( 2 files changed, 51 insertions(+), 6 deletions(-))
terraform-google-conversion: Diff ( 1 file changed, 10 insertions(+))

Missing test report

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

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

resource "google_compute_interconnect_attachment" "primary" {
  stack_type    = # value needed
  subnet_length = # value needed
}

@bopas2 bopas2 marked this pull request as draft May 17, 2024 20:59
@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 922
Passed tests: 850
Skipped tests: 72
Affected tests: 0

Click here to see the affected service packages
  • compute

$\textcolor{green}{\textsf{All tests passed!}}$
View the build log

@bopas2 bopas2 marked this pull request as ready for review May 17, 2024 21:32
@github-actions github-actions bot requested a review from roaks3 May 17, 2024 21:33
@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 ( 3 files changed, 99 insertions(+), 8 deletions(-))
google-beta provider: Diff ( 3 files changed, 99 insertions(+), 8 deletions(-))
terraform-google-conversion: Diff ( 1 file changed, 10 insertions(+))
Open in Cloud Shell: Diff ( 4 files changed, 137 insertions(+))

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 923
Passed tests: 850
Skipped tests: 72
Affected tests: 1

Click here to see the affected service packages
  • compute

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
TestAccComputeInterconnectAttachment_interconnectAttachmentDedicatedExample

Get to know how VCR tests work

@modular-magician
Copy link
Collaborator

$\textcolor{green}{\textsf{Tests passed during RECORDING mode:}}$
TestAccComputeInterconnectAttachment_interconnectAttachmentDedicatedExample[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 ( 3 files changed, 98 insertions(+), 8 deletions(-))
google-beta provider: Diff ( 3 files changed, 98 insertions(+), 8 deletions(-))
terraform-google-conversion: Diff ( 1 file changed, 10 insertions(+))
Open in Cloud Shell: Diff ( 4 files changed, 137 insertions(+))

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 923
Passed tests: 851
Skipped tests: 72
Affected tests: 0

Click here to see the affected service packages
  • compute

$\textcolor{green}{\textsf{All tests passed!}}$
View the build log

Copy link
Contributor

@roaks3 roaks3 left a comment

Choose a reason for hiding this comment

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

LGTM, will merge on Monday morning (which will be well ahead of the release cut on Tuesday evening)

@roaks3 roaks3 merged commit c4ee9b0 into GoogleCloudPlatform:main May 20, 2024
14 checks passed
avijain25 pushed a commit to avijain25/magic-modules that referenced this pull request May 21, 2024
ma-g-22 pushed a commit to ma-g-22/magic-modules that referenced this pull request May 21, 2024
pengq-google pushed a commit to pengq-google/magic-modules that referenced this pull request May 21, 2024
Cheriit pushed a commit to Cheriit/magic-modules that referenced this pull request Jun 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants