-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Marked customer_name field as optional for interconnect resource #11640
Marked customer_name field as optional for interconnect resource #11640
Conversation
Hello! I am a robot. Tests will require approval from a repository maintainer to run. @shuyama1, 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. |
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.
|
Tests analyticsTotal tests: 993 Click here to see the affected service packages
View the build log |
@@ -2,7 +2,6 @@ data "google_project" "project" {} | |||
|
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.
Looks like this example is skipped from test generation. It will update the examples in the web documentation though. Would you mind also removing the field from this example to have a test coverage on this. Plus, can you also remove this line https://github.com/abhijeetkjha-google/magic-modules/blob/bugFix-361094483/mmv1/products/compute/Interconnect.yaml#L52, given the field is removed from the example. Thanks
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.
Would you mind also removing the field from this example to have a test coverage on this.
Since we are marking a field as optional wouldn't it be a good idea to have one test example with the field and another without the field. The compute_interconnect_basic.tf.erb contains the required field only and compute_interconnect_basic_test.tf.erb includes the optional field as well.
can you also remove this line https://github.com/abhijeetkjha-google/magic-modules/blob/bugFix-361094483/mmv1/products/compute/Interconnect.yaml#L52, given the field is removed from the example.
Sure, Done.
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.
Would you mind also removing the field from this example to have a test coverage on this.
Since we are marking a field as optional wouldn't it be a good idea to have one test example with the field and another without the field. The compute_interconnect_basic.tf.erb contains the required field only and compute_interconnect_basic_test.tf.erb includes the optional field as well.
Oh, right, it makes sense to have the field included in at least one test. But it looks like compute_interconnect_basic.tf.erb is only used to generate the doc instead of tests, as indicated by the flag skip_test
for the example. Are you able to test it locally and make sure the field is not required for resource creation?
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.
Yes yes, I have verified that customer_name is an optional field and is not required for resource creation.
@abhijeetkjha-google Please update the release note. |
Done. |
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.
|
I've changed the change type from |
Tests analyticsTotal tests: 997 Click here to see the affected service packages
View the build log |
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.
I've removed customer_name
from the test case and run tests in a test PR #11668. Looks like the test failed with API error googleapi: Error 400: Required field 'resource.customerName' not specified, required
. I wonder if the field is still required?
The error is rightly thrown, So I investigated this. So this is the issue. We have three interconnects: Dedicated, Partner and Cross cloud. without this change, If a person creates an cross cloud interconnect resource, They have to pass the customer_name field as its marked "required" for now but this will throw an error stating ""Customer name should not be present for Cross Cloud Interconnect". So the test which are failing are for dedicated interconnect, which was a miss. So thats why we are getting this error. |
@shuyama1 This PR has been waiting for review for 3 weekdays. Please take a look! Use the label |
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.
|
Tests analyticsTotal tests: 1005 Click here to see the affected service packages
Action takenFound 2 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
|
|
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.
TestAccComputeInterconnect_computeInterconnectCrossCloudBasicExample
failed with
resource_compute_interconnect_generated_test.go:85: Step 1/2 error: Error running pre-apply refresh: exit status 1
Error: Missing required argument
on terraform_plugin_test.tf line 4, in resource "google_compute_interconnect" "example-interconnect":
4: resource "google_compute_interconnect" "example-interconnect" {
The argument "location" is required, but no definition was found.
Hi @shuyama1, |
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.
Would you be able to set up a local environment and test it locally? We may rely on local testing in this case if our testing environment is not compatible with feature. Thank you! https://googlecloudplatform.github.io/magic-modules/develop/test/run-tests/#run-tests
@@ -89,7 +89,6 @@ properties: | |||
URL of the InterconnectLocation object that represents where this connection is to be provisioned. | |||
resource: 'InterconnectLocations' | |||
imports: 'selfLink' | |||
required: true |
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.
Is making location
optional in this resource intended? Sorry, I'm not fully understand what remote_location field is. Is location field not needed for resource creation in some cases?
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.
Yes, Incase of cross_cloud interconnect we don't need to specify location field as location field implies for google owned location, Incase of cross_cloud interconnect we have to replace it with remote_location field.
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.
Got it. Would you mind also clarifying it in the description of the field? Thanks!
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.
Done
@@ -145,7 +144,6 @@ properties: | |||
Customer name, to put in the Letter of Authorization as the party authorized to request a | |||
crossconnect. | |||
immutable: true | |||
required: true |
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.
Could you please update the description of this field to clarify when this field is required and when it is not? Thanks
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.
Done.
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.
|
Tests analyticsTotal tests: 1011 Click here to see the affected service packages
View the build log |
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.
left a small comment in #11640 (comment) regarding a documentation improvement. Thanks!
Updated the description. Thanks. |
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.
|
Tests analyticsTotal tests: 1015 Click here to see the affected service packages
View the build log |
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.
The contributor has confirmed the changes work as expected with local testing.
Bug Fix: hashicorp/terraform-provider-google#18264
The proto which defines the interconnect resource has customer_name field as an optional, so we should be providing this same parity between the terraform and the provided api. For Cross cloud interconnect, We should not be providing customer_name, else error is being thrown.