-
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
[#9353] Make cloud router sort advertised_ip_ranges in state by config order #10572
[#9353] Make cloud router sort advertised_ip_ranges in state by config order #10572
Conversation
…s in state by config order
Hello! I am a robot. Tests will require approval from a repository maintainer to run. @SarahFrench, 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.
|
@SarahFrench I can't understand from our CloudBuild logs what's failing. Do you find any useful log anywhere? |
Tests analyticsTotal tests: Click here to see the affected service packages
|
Once this gets passes the tests and gets reviewed, I can also put (here or through another PR) the same flatten function for |
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'll look in more depth tomorrow, but in case it helps unblock you the error is:
Error compiling file: /.../GoogleCloudPlatform/magic-modules/mmv1/templates/terraform/custom_flatten/compute_router_range.go.erb
Error compiling file: /.../GoogleCloudPlatform/magic-modules/mmv1/templates/terraform/flatten_property_method.erb
Error compiling file: /.../GoogleCloudPlatform/magic-modules/mmv1/templates/terraform/flatten_property_method.erb
Error compiling file: /.../GoogleCloudPlatform/magic-modules/mmv1//templates/terraform/resource.erb
bundler: failed to load command: compiler.rb (compiler.rb)
(erb):2:in `compile_template': undefined local variable or method `range' for #<Provider::Terraform:0x0000000104c75fb0 @api=#<Api::Product:0x0000000104e257e8 @name="Compute", @display_name="Compute Engine", @version
@SarahFrench thank you! With the message you provided is all clear but I'm wondering where you found it. I do have access to CB logs but I still can't find any. |
I think the logs in Cloud Build omitted a bunch of log lines. The logs show I investigating the error by generating the provider from your PR's branch on my laptop, following this guidance: https://googlecloudplatform.github.io/magic-modules/get-started/generate-providers/ |
mmv1/templates/terraform/custom_flatten/compute_router_range.go.erb
Outdated
Show resolved
Hide resolved
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: Click here to see the affected service packages
|
}) | ||
} | ||
configData := []map[string]interface{}{} | ||
for _, item := range d.Get("advertisedIpRanges.0.range").([]interface{}) { |
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 error mentioned here is due to the problem below, and I think the test that first encountered the error was TestAccComputeRouter_noRegion
panic: interface conversion: interface {} is string, not []interface {}
goroutine 4529793 [running]:
github.com/hashicorp/terraform-provider-google-beta/google-beta/services/compute.flattenComputeRouterBgpAdvertisedIpRangesRange({0x3e85f60?, 0xc016c89f40?}, 0x4763f12?, 0x5?)
/go/src/github.com/modular-magician/terraform-provider-google-beta/google-beta/services/compute/resource_compute_router.go:654 +0x4e9
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 attached my comment to the wrong line - L654 mentioned in the panic is here
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.
@SarahFrench apologies if I disappeared but I'm in and out working at other customers.
I'm not able to debug this code now as
- I can't run the test on my computer. Both the GA and the beta provider seem to be failing in this exact moment
- The lines reported in the build log and in the diff don't seem to correspond
I'd probably need to log some things here and there to be able to say more. As soon as I'll find again some time I'll try again and let you know. In the meantime, if you see anything obvious, please let me know.
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.
The lines reported in the build log and in the diff don't seem to correspond
The panic output I posted above refers to the code in the provider that's built from the Magic Modules repo. If you click the links on Diff Report posts on the PR it'll show the resulting provider code from your PR and the lines should correspond. A useful bit of context is that the tests that run on PRs use the google-beta code generated from the PR, so if there are differences in a file between the GA and Beta versions of the provider that could result in some code line confusion too.
No worries about juggling other tasks, that's totally understandable!
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.
@SarahFrench there's something I'm clearly not understanding here :)
If I build the GA provider on my computer and run TestAccComputeRouter_noRegion
I never get an error.
I guess the first thing I wish is being able to reproduce it in my local environment, so I can debug it and understand what's going on.
You said you got the error during your local build. May I ask you how you got to the error exactly?
FYI my commands:
make provider VERSION=ga OUTPUT_PATH="$GOPATH/src/github.com/hashicorp/terraform-provider-google" PRODUCT=compute
cd $GOPATH/src/github.com/hashicorp/terraform-provider-google
make testacc TEST=./google/services/compute TESTARGS='-run=TestAccComputeRouter_noRegion'
What am I missing? Also, are you a Googler? If you are, can you please reach me in chat? 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.
👋 I'm a HashiCorp employee so I'm afraid this PR is the best place for us to talk.
If I build the GA provider on my computer and run TestAccComputeRouter_noRegion I never get an error.
I'll have a go running the Compute tests against your PR, the output where the panic was reported may have been misleading about which test triggered the problem. I'll report back!
You said you got the error during your local build. May I ask you how you got to the error exactly?
Do you mean when I helped with the build error here? That build error is separate to the panic that we're now seeing when the tests are running using the built provider code.
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: Click here to see the affected service packages
|
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.
Reviewing again as GHA automation re-requested review from me, but see previous discussion for next steps
@LucaPrete, this PR is waiting for action from you. Please address any comments or change requests, or re-request review from a core reviewer if no action is required. If no action is taken, this PR will be closed in 28 days. This notification can be disabled with the |
I'm running individual tests in TeamCity to test this PR (see #10572 (comment)) but I'll re-trigger tests on this PR directly too: /gcbrun |
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: Click here to see the affected service packages
|
mmv1/templates/terraform/custom_flatten/compute_router_range.go.erb
Outdated
Show resolved
Hide resolved
Tests that triggered the panic in our testing environment when I ran all Compute tests against this PR:
All the panics point to google-beta/services/compute/resource_compute_router.go:649. The data coming from the API before the panic is a GET request to get the resource's data: Expand me to see the API interaction
|
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 take a look at my suggested code change, and if you're able could you please try running the TestAccComputeRouter_full
test locally?
mmv1/templates/terraform/custom_flatten/compute_router_range.go.erb
Outdated
Show resolved
Hide resolved
…o.erb Co-authored-by: Sarah French <15078782+SarahFrench@users.noreply.github.com>
@SarahFrench thanks a lot! I committed your proposed change. Your help has been key! Let's see if we have more tests complaining now... |
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: Click here to see the affected service packages
|
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 reproduced the original issue from hashicorp/terraform-provider-google#9353 locally with the latest google provider release and saw the reordering diff, and with the provider built from this PR the diff isn't there anymore! 🎉
Given the existing tests are passing ok and my manual test I'm happy to merge
Thanks for your work on this @LucaPrete! |
…s in state by config order (GoogleCloudPlatform#10572) Co-authored-by: Luca Prete <lucaprete@google.com> Co-authored-by: Sarah French <15078782+SarahFrench@users.noreply.github.com>
…s in state by config order (GoogleCloudPlatform#10572) Co-authored-by: Luca Prete <lucaprete@google.com> Co-authored-by: Sarah French <15078782+SarahFrench@users.noreply.github.com>
…s in state by config order (GoogleCloudPlatform#10572) Co-authored-by: Luca Prete <lucaprete@google.com> Co-authored-by: Sarah French <15078782+SarahFrench@users.noreply.github.com>
Use the new function introduced in #10410 to order advertised_ip_ranges properties according to the order in config.
Pre-6.0.0 fix for hashicorp/terraform-provider-google/issues/9353.
Release Note Template for Downstream PRs (will be copied)