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

Change advertised_ip_ranges fields in google_compute_router_peer and google_compute_router resources to Sets #10845

Conversation

LucaPrete
Copy link
Member

@LucaPrete LucaPrete commented May 31, 2024

[breaking change for 6.0.0 major release]

Change advertised_ip_ranges fields in google_compute_router_peer and google_compute_router resources to Sets.

Fixes hashicorp/terraform-provider-google/issues/9353

compute: changed the `advertised_ip_ranges` fields in both `google_compute_router_peer` and `google_compute_router` resources to be sets. This will reduce diffs due to re-ordering.

@github-actions github-actions bot requested a review from roaks3 May 31, 2024 13:58
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.

@LucaPrete LucaPrete force-pushed the routerIdempotence branch from 48ab804 to e9d0374 Compare May 31, 2024 13:58
@LucaPrete
Copy link
Member Author

@SarahFrench I opened this because I wasn't able to work on https://github.com/GoogleCloudPlatform/magic-modules/pull/10118. In case the @Maarc-D is able to move forward with the other I'm happy to abandon this one.

I applied the changes you recommended and it's well understood this is a breaking change that can be merged in 6.0.0.

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

Errors

google provider:

  • The diff processor failed to build. This is usually due to the downstream provider failing to compile.

google-beta provider:

  • The diff processor failed to build. This is usually due to the downstream provider failing to compile.

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 0
Passed tests: 0
Skipped tests: 0
Affected tests: 0

Click here to see the affected service packages
  • compute

$\textcolor{red}{\textsf{Errors occurred during REPLAYING mode. Please fix them to complete your PR.}}$
View the build log

@SarahFrench
Copy link
Contributor

I'll leave review to @roaks3.

If this PR addresses ordering diffs on this field by converting it to a Set in 6.0.0 then this PR will also need to remove the ordering logic added in https://github.com/GoogleCloudPlatform/magic-modules/pull/10572/files

@LucaPrete
Copy link
Member Author

LucaPrete commented May 31, 2024 via email

@LucaPrete
Copy link
Member Author

I'll leave review to @roaks3.

If this PR addresses ordering diffs on this field by converting it to a Set in 6.0.0 then this PR will also need to remove the ordering logic added in https://github.com/GoogleCloudPlatform/magic-modules/pull/10572/files

@SarahFrench done! Please, check if it looks good to you. @roaks3 this should be ready (I know you won't be able to merge until the release...)

@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, 39 insertions(+), 36 deletions(-))
google-beta provider: Diff ( 3 files changed, 39 insertions(+), 36 deletions(-))
terraform-google-conversion: Diff ( 1 file changed, 1 insertion(+))

Errors

google provider:

  • The diff processor failed to build. This is usually due to the downstream provider failing to compile.

google-beta provider:

  • The diff processor failed to build. This is usually due to the downstream provider failing to compile.

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 0
Passed tests: 0
Skipped tests: 0
Affected tests: 0

Click here to see the affected service packages
  • compute

$\textcolor{red}{\textsf{Errors occurred during REPLAYING mode. Please fix them to complete your PR.}}$
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, 39 insertions(+), 36 deletions(-))
google-beta provider: Diff ( 3 files changed, 39 insertions(+), 36 deletions(-))
terraform-google-conversion: Diff ( 1 file changed, 1 insertion(+))

Errors

google provider:

  • The diff processor failed to build. This is usually due to the downstream provider failing to compile.

google-beta provider:

  • The diff processor failed to build. This is usually due to the downstream provider failing to compile.

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 0
Passed tests: 0
Skipped tests: 0
Affected tests: 0

Click here to see the affected service packages
  • compute

$\textcolor{red}{\textsf{Errors occurred during REPLAYING mode. Please fix them to complete your PR.}}$
View the build log

Copy link

github-actions bot commented Jun 4, 2024

This PR has been waiting for review for 2 weekdays. Please take a look! Use the label disable-review-reminders to disable these notifications.

@LucaPrete LucaPrete force-pushed the routerIdempotence branch from eb26506 to 86d7eba Compare June 4, 2024 13:48
@LucaPrete
Copy link
Member Author

LucaPrete commented Jun 4, 2024

@SarahFrench @roaks3 I see in my local tests that something is failing in the generated router code:

make testacc TEST=./google-beta/services/compute TESTARGS='-run=
TestAccComputeRouter_routerBasicExample'
==> Checking that code complies with gofmt requirements...
go vet
TF_ACC=1 TF_SCHEMA_PANIC_ON_ERROR=1 go test ./google-beta/services/compute -v -run=TestAccComputeRouter_routerBasicExample -timeout 240m -ldflags="-X=github.com/hashicorp/terraform-provider-google-beta/version.ProviderVersion=acc"
=== RUN   TestAccComputeRouter_routerBasicExample
=== PAUSE TestAccComputeRouter_routerBasicExample
=== CONT  TestAccComputeRouter_routerBasicExample
panic: interface conversion: interface {} is *schema.Set, not []interface {}

goroutine 307 [running]:
github.com/hashicorp/terraform-provider-google-beta/google-beta/services/compute.resourceComputeRouterCustomDiff({0x0?, 0x0?}, 0x0?, {0x0?, 0x0?})
	/Users/lucaprete/go/src/github.com/hashicorp/terraform-provider-google-beta/google-beta/services/compute/resource_compute_router.go:42 +0x1aa
github.com/hashicorp/terraform-provider-google-beta/google-beta/services/compute.ResourceComputeRouter.All.func1({0x56e9e20, 0xc00104a780}, 0x4de4eda?, {0x4d9f5c0, 0xc00026f000})
	/Users/lucaprete/go/pkg/mod/github.com/hashicorp/terraform-plugin-sdk/[email protected]/helper/customdiff/compose.go:52 +0xd2
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.schemaMap.Diff(0xc000981380, {0x56e9e20, 0xc00104a780}, 0xc0011b8d00, 0xc001ba1770, 0xc000480d40, {0x4d9f5c0, 0xc00026f000}, 0x0)
	/Users/lucaprete/go/pkg/mod/github.com/hashicorp/terraform-plugin-sdk/[email protected]/helper/schema/schema.go:698 +0x4b4
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).SimpleDiff(0x56ea088?, {0x56e9e20?, 0xc00104a780?}, 0xc0011b8d00, 0x47711c0?, {0x4d9f5c0?, 0xc00026f000?})
	/Users/lucaprete/go/pkg/mod/github.com/hashicorp/terraform-plugin-sdk/[email protected]/helper/schema/resource.go:962 +0xd5
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*GRPCProviderServer).PlanResourceChange(0xc000ff6e70, {0x56e9e20?, 0xc00104a6c0?}, 0xc001ba1630)
	/Users/lucaprete/go/pkg/mod/github.com/hashicorp/terraform-plugin-sdk/[email protected]/helper/schema/grpc_provider.go:798 +0x9b6
github.com/hashicorp/terraform-plugin-mux/tf5muxserver.(*muxServer).PlanResourceChange(0xc00015f570, {0x56e9e20?, 0xc00104a420?}, 0xc001ba1630)
	/Users/lucaprete/go/pkg/mod/github.com/hashicorp/[email protected]/tf5muxserver/mux_server_PlanResourceChange.go:73 +0x2ad
github.com/hashicorp/terraform-plugin-go/tfprotov5/tf5server.(*server).PlanResourceChange(0xc0004a8dc0, {0x56e9e20?, 0xc001c7fbf0?}, 0xc000e609a0)
	/Users/lucaprete/go/pkg/mod/github.com/hashicorp/[email protected]/tfprotov5/tf5server/server.go:811 +0x3d0
github.com/hashicorp/terraform-plugin-go/tfprotov5/internal/tfplugin5._Provider_PlanResourceChange_Handler({0x4d45080?, 0xc0004a8dc0}, {0x56e9e20, 0xc001c7fbf0}, 0xc002709c80, 0x0)
	/Users/lucaprete/go/pkg/mod/github.com/hashicorp/[email protected]/tfprotov5/internal/tfplugin5/tfplugin5_grpc.pb.go:500 +0x169
google.golang.org/grpc.(*Server).processUnaryRPC(0xc001020600, {0x56e9e20, 0xc001c7fb60}, {0x56f5aa8, 0xc00053de00}, 0xc001aea360, 0xc001068840, 0x754c080, 0x0)
	/Users/lucaprete/go/pkg/mod/google.golang.org/[email protected]/server.go:1369 +0xe23
google.golang.org/grpc.(*Server).handleStream(0xc001020600, {0x56f5aa8, 0xc00053de00}, 0xc001aea360)
	/Users/lucaprete/go/pkg/mod/google.golang.org/[email protected]/server.go:1780 +0x1016
google.golang.org/grpc.(*Server).serveStreams.func2.1()
	/Users/lucaprete/go/pkg/mod/google.golang.org/[email protected]/server.go:1019 +0x8b
created by google.golang.org/grpc.(*Server).serveStreams.func2 in goroutine 245
	/Users/lucaprete/go/pkg/mod/google.golang.org/[email protected]/server.go:1030 +0x135
FAIL	github.com/hashicorp/terraform-provider-google-beta/google-beta/services/compute	4.509s
FAIL
make: *** [testacc] Error 1

On the other hand, here I see some test failures that seem completely unrelated to this change. I'll try to re-trigger them and see if at least I get something consistent with what I get on my device.

Any idea what I am missing, given it's just a one line modification?

@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, 61 insertions(+), 59 deletions(-))
google-beta provider: Diff ( 3 files changed, 61 insertions(+), 59 deletions(-))
terraform-google-conversion: Diff ( 1 file changed, 1 insertion(+))

Breaking Change(s) Detected

The following breaking change(s) were detected within your pull request.

  • Field advertised_ip_ranges changed from TypeList to TypeSet on google_compute_router_peer - reference
  • Field bgp.advertised_ip_ranges changed from TypeList to TypeSet on google_compute_router - reference

If you believe this detection to be incorrect please raise the concern with your reviewer.
If you intend to make this change you will need to wait for a major release window.
An override-breaking-change label can be added to allow merging.

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 78
Passed tests: 18
Skipped tests: 58
Affected tests: 2

Click here to see the affected service packages
  • compute

Action taken

Found 2 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
TestAccComputeInstanceNetworkIntefaceWithSecurityPolicy|TestAccComputeRegionAutoscaler_update

Get to know how VCR tests work

@modular-magician
Copy link
Collaborator

$\textcolor{red}{\textsf{Tests failed during RECORDING mode:}}$
TestAccComputeInstanceNetworkIntefaceWithSecurityPolicy[Error message] [Debug log]
TestAccComputeRegionAutoscaler_update[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

@LucaPrete LucaPrete force-pushed the routerIdempotence branch from 86d7eba to 86a3457 Compare June 5, 2024 12:06
@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, 61 insertions(+), 59 deletions(-))
google-beta provider: Diff ( 3 files changed, 61 insertions(+), 59 deletions(-))
terraform-google-conversion: Diff ( 1 file changed, 1 insertion(+))

Breaking Change(s) Detected

The following breaking change(s) were detected within your pull request.

  • Field advertised_ip_ranges changed from TypeList to TypeSet on google_compute_router_peer - reference
  • Field bgp.advertised_ip_ranges changed from TypeList to TypeSet on google_compute_router - reference

If you believe this detection to be incorrect please raise the concern with your reviewer.
If you intend to make this change you will need to wait for a major release window.
An override-breaking-change label can be added to allow merging.

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 80
Passed tests: 19
Skipped tests: 60
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
TestAccComputeInstanceNetworkIntefaceWithSecurityPolicy

Get to know how VCR tests work

@LucaPrete LucaPrete force-pushed the routerIdempotence branch from 86a3457 to 1011234 Compare June 5, 2024 12:38
@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, 59 insertions(+), 57 deletions(-))
google-beta provider: Diff ( 3 files changed, 59 insertions(+), 57 deletions(-))
terraform-google-conversion: Diff ( 1 file changed, 1 insertion(+))

Breaking Change(s) Detected

The following breaking change(s) were detected within your pull request.

  • Field advertised_ip_ranges changed from TypeList to TypeSet on google_compute_router_peer - reference
  • Field bgp.advertised_ip_ranges changed from TypeList to TypeSet on google_compute_router - reference

If you believe this detection to be incorrect please raise the concern with your reviewer.
If you intend to make this change you will need to wait for a major release window.
An override-breaking-change label can be added to allow merging.

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 80
Passed tests: 19
Skipped tests: 60
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
TestAccComputeInstanceNetworkIntefaceWithSecurityPolicy

Get to know how VCR tests work

@modular-magician
Copy link
Collaborator

$\textcolor{red}{\textsf{Tests failed during RECORDING mode:}}$
TestAccComputeInstanceNetworkIntefaceWithSecurityPolicy[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

$\textcolor{red}{\textsf{Tests failed during RECORDING mode:}}$
TestAccComputeInstanceNetworkIntefaceWithSecurityPolicy[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

@LucaPrete LucaPrete changed the base branch from main to FEATURE-BRANCH-major-release-6.0.0 June 28, 2024 16:23
@LucaPrete
Copy link
Member Author

Follow-up note: this should be changed to point to the feature branch since it is a breaking change (see https://googlecloudplatform.github.io/magic-modules/develop/breaking-changes/make-a-breaking-change/)

Thanks @roaks3 I just rebased, hopefully on the correct branch. Please, let me know if there's anything else I should do.

@github-actions github-actions bot requested a review from roaks3 June 28, 2024 16:24
@LucaPrete
Copy link
Member Author

I was also hoping the rebase would have re-triggered the tests but it doesn't seem the case. Can you please help me re-running them? I remember I wasn't able to trigger them on my own...

@SarahFrench
Copy link
Contributor

/gcbrun

@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, 59 insertions(+), 57 deletions(-))
google-beta provider: Diff ( 3 files changed, 59 insertions(+), 57 deletions(-))
terraform-google-conversion: Diff ( 1 file changed, 1 insertion(+))

Breaking Change(s) Detected

The following breaking change(s) were detected within your pull request.

  • Field advertised_ip_ranges changed from TypeList to TypeSet on google_compute_router_peer - reference
  • Field bgp.advertised_ip_ranges changed from TypeList to TypeSet on google_compute_router - reference

If you believe this detection to be incorrect please raise the concern with your reviewer.
If you intend to make this change you will need to wait for a major release window.
An override-breaking-change label can be added to allow merging.

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 79
Passed tests: 19
Skipped tests: 59
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
  • TestAccComputeInstanceNetworkIntefaceWithSecurityPolicy

Get to know how VCR tests work

@modular-magician
Copy link
Collaborator

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

$\textcolor{red}{\textsf{Errors occurred during RECORDING mode. Please fix them to complete your PR.}}$

View the build log or the debug log for each test

@SarahFrench
Copy link
Contributor

I can see there's a panic affecting the TGC unit tests, FYI @roaks3

@roaks3
Copy link
Contributor

roaks3 commented Jul 15, 2024

Yea, I had missed it before but it looks like the panic has always been present. I'm seeing it occur from a nil pointer on this line https://github.com/modular-magician/terraform-provider-google-beta/compare/auto-pr-10845-old..auto-pr-10845#diff-d2eb6a6a2712aaced589de3439e521d9a17895670b7118da797a5e90681285b6R42.

@LucaPrete it's not immediately obvious to me what is wrong, so you may need to step through the code and see where the nil could be coming from with this change. I would suspect there is an edge case that was simply missed, but it could also be related to the set behaving differently in some way.

Copy link

@GoogleCloudPlatform/terraform-team @roaks3 This PR has been waiting for review for 3 weeks. Please take a look! Use the label disable-review-reminders to disable these notifications.

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.

Quiet review notification

Copy link

github-actions bot commented Aug 2, 2024

@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.

Image showing the re-request review button

If no action is taken, this PR will be closed in 28 days.

This notification can be disabled with the disable-automatic-closure label.

Copy link

@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.

Image showing the re-request review button

If no action is taken, this PR will be closed in 14 days.

This notification can be disabled with the disable-automatic-closure label.

@roaks3
Copy link
Contributor

roaks3 commented Aug 20, 2024

@LucaPrete @c2thorn I'm noticing this a bit late, but this PR was targeting 6.0.0, which I think is about to be closed (if it isn't already). The last message was mentioning a panic that needs to be fixed, so I know the change isn't ready in its current state, but wanted to raise awareness: if we can't get this in now, the long-term solution proposed here might not be available until 7.0.0 next year.

@c2thorn
Copy link
Member

c2thorn commented Aug 20, 2024

@LucaPrete @c2thorn I'm noticing this a bit late, but this PR was targeting 6.0.0, which I think is about to be closed (if it isn't already). The last message was mentioning a panic that needs to be fixed, so I know the change isn't ready in its current state, but wanted to raise awareness: if we can't get this in now, the long-term solution proposed here might not be available until 7.0.0 next year.

The window is closed unfortunately, we need time to sync the branches and test

@LucaPrete
Copy link
Member Author

LucaPrete commented Aug 20, 2024 via email

@github-actions github-actions bot requested a review from roaks3 August 20, 2024 18:07
@c2thorn
Copy link
Member

c2thorn commented Aug 20, 2024

Hello folks, It seems the panic comes from something deeper into the code. It’s something I haven’t time to look into….on the other hand, I want to underline how this change is crucial for many of our customers. Happy to contribute and make thing happen in no time, but I’ll definitely need help from somebody from the core dev team as well. Please, let me know how you’d like to proceed. Thanks!

There is simply no time left, the contribution window for 6.0 closed Friday, and the 6.0 branch is effectively frozen so the major release as a whole can be completed in time and tested thoroughly. I've already declined other changes that missed the window that were in a more ready state than this is.

If there is significant enough prioritization, we can discuss internally after 6.0 is released.

Copy link

@roaks3 This PR has been waiting for review for 3 weekdays. Please take a look! Use the label disable-review-reminders to disable these notifications.

Copy link

@GoogleCloudPlatform/terraform-team @roaks3 This PR has been waiting for review for 1 week. Please take a look! Use the label disable-review-reminders to disable these notifications.

Copy link

github-actions bot commented Sep 3, 2024

@GoogleCloudPlatform/terraform-team @roaks3 This PR has been waiting for review for 2 weeks. Please take a look! Use the label disable-review-reminders to disable these notifications.

Copy link

@GoogleCloudPlatform/terraform-team @roaks3 This PR has been waiting for review for 3 weeks. Please take a look! Use the label disable-review-reminders to disable these notifications.

Copy link

@GoogleCloudPlatform/terraform-team @roaks3 This PR has been waiting for review for 4 weeks. Please take a look! Use the label disable-review-reminders to disable these notifications.

Copy link

@GoogleCloudPlatform/terraform-team @roaks3 This PR has been waiting for review for 5 weeks. Please take a look! Use the label disable-review-reminders to disable these notifications.

Copy link

github-actions bot commented Oct 1, 2024

@GoogleCloudPlatform/terraform-team @roaks3 This PR has been waiting for review for 6 weeks. Please take a look! Use the label disable-review-reminders to disable these notifications.

Copy link

github-actions bot commented Oct 8, 2024

@GoogleCloudPlatform/terraform-team @roaks3 This PR has been waiting for review for 7 weeks. Please take a look! Use the label disable-review-reminders to disable these notifications.

Copy link

@GoogleCloudPlatform/terraform-team @roaks3 This PR has been waiting for review for 8 weeks. Please take a look! Use the label disable-review-reminders to disable these notifications.

@c2thorn c2thorn closed this Oct 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

google_compute_router: dynamic block leads to undesired diff in plan
6 participants