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

Shared reservation update #5653

Merged

Conversation

simamGit
Copy link
Contributor

@simamGit simamGit commented Jan 26, 2022

If this PR is for Terraform, I acknowledge that I have:

  • Searched through the issue tracker for an open issue that this either resolves or contributes to, commented on it to claim it, and written "fixes {url}" or "part of {url}" in this PR description. If there were no relevant open issues, I opened one and commented that I would like to work on it (not necessary for very small changes).
  • Generated Terraform, and ran make test and make lint to ensure it passes unit and linter tests.
  • Ensured that all new fields I added that can be set by a user appear in at least one example (for generated resources) or third_party test (for handwritten resources or update tests).
  • Ran relevant acceptance tests (If the acceptance tests do not yet pass or you are unable to run them, please let your reviewer know).
  • Read the Release Notes Guide before writing my release note below.

Release Note Template for Downstream PRs (will be copied)

compute: added update support for `google_compute_reservation.share_settings`

@modular-magician
Copy link
Collaborator

Oops! It looks like you're using an unknown release-note type in your changelog entries:

  • REPLACEME

Please only use the types listed in /~https://github.com/GoogleCloudPlatform/magic-modules/blob/master/.ci/RELEASE_NOTES_GUIDE.md.

@modular-magician
Copy link
Collaborator

Hello! I am a robot who works on Magic Modules PRs.

I have detected that you are a community contributor, so your PR will be assigned to someone with a commit-bit on this repo for initial review.

Thanks for your contribution! A human will be with you soon.

@megan07, please review this PR or find an appropriate assignee.

@simamGit
Copy link
Contributor Author

simamGit commented Jan 26, 2022

this test: "mmv1/third_party/terraform/tests/resource_compute_shared_reservation_update_test.go" is failing.
generally these changes trying to update projectMaps of Shared Reservation. but the test is not recognizing the update, it keep deleting the current sharedReservation .
also this change is temporary: mmv1/templates/terraform/update_encoder/reservation.go.erb, I only tried it to see if it helps, but generally it is not correct change, since it causes resizing test failure.

I would be thankful if help me to figure out what part is wrong or how I can fix it.

@simamGit
Copy link
Contributor Author

this test: "mmv1/third_party/terraform/tests/resource_compute_shared_reservation_update_test.go" is failing. generally these changes trying to update projectMaps of Shared Reservation. but the test is not recognizing the update, it keep deleting the current sharedReservation . I would be thankful if help me to figure out what part is wrong or how I can fix it.

@simamGit simamGit closed this Jan 26, 2022
@rileykarson rileykarson reopened this Jan 26, 2022
@rileykarson rileykarson requested review from rileykarson and removed request for megan07 January 26, 2022 22:03
@modular-magician
Copy link
Collaborator

Oops! It looks like you're using an unknown release-note type in your changelog entries:

  • REPLACEME

Please only use the types listed in /~https://github.com/GoogleCloudPlatform/magic-modules/blob/master/.ci/RELEASE_NOTES_GUIDE.md.

@rileykarson
Copy link
Member

Ah, generate-diffs failed due to a breakage in an unrelated PR. If you're able to rebase and push, this should generate successfully.

@rileykarson
Copy link
Member

Ah, wait, a rebase won't work quite yet- #5659 needs to get in.

@ScottSuarez
Copy link
Contributor

/gcbrun

@modular-magician
Copy link
Collaborator

Hi! I'm the modular magician. Your PR generated some diffs in downstreams - here they are.

Diff report:

Terraform GA: Diff ( 2 files changed, 214 insertions(+), 6 deletions(-))
Terraform Beta: Diff ( 2 files changed, 214 insertions(+), 6 deletions(-))
TF Validator: Diff ( 2 files changed, 214 insertions(+), 6 deletions(-))

@simamGit
Copy link
Contributor Author

Ah, wait, a rebase won't work quite yet- #5659 needs to get in.

test is failing with this error message:

    provider_test.go:278: ImportStateVerify attributes not equivalent. Difference is shown below. Top is actual, bottom is expected.
        
        (map[string]string) {
        }
        
        
        (map[string]string) (len=7) {
         (string) (len=16) "share_settings.#": (string) (len=1) "1",
         (string) (len=18) "share_settings.0.%": (string) (len=1) "2",
         (string) (len=30) "share_settings.0.project_map.#": (string) (len=1) "1",
         (string) (len=32) "share_settings.0.project_map.0.%": (string) (len=1) "2",
         (string) (len=33) "share_settings.0.project_map.0.id": (string) (len=19) "tf-test-296988n6za3",
         (string) (len=41) "share_settings.0.project_map.0.project_id": (string) (len=19) "tf-test-296988n6za3",
         (string) (len=27) "share_settings.0.share_type": (string) (len=17) "SPECIFIC_PROJECTS"
        }

@modular-magician
Copy link
Collaborator

Hi! I'm the modular magician. Your PR generated some diffs in downstreams - here they are.

Diff report:

Terraform GA: Diff ( 2 files changed, 214 insertions(+), 6 deletions(-))
Terraform Beta: Diff ( 2 files changed, 214 insertions(+), 6 deletions(-))
TF Validator: Diff ( 2 files changed, 214 insertions(+), 6 deletions(-))

Copy link
Member

@rileykarson rileykarson left a comment

Choose a reason for hiding this comment

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

That error indicates that the settings aren't getting read back from the API correctly. I can inspect myself w/ test logs, we've just gotta pass the linter to get those. See inline.

@modular-magician
Copy link
Collaborator

Hi! I'm the modular magician. Your PR generated some diffs in downstreams - here they are.

Diff report:

Terraform GA: Diff ( 2 files changed, 214 insertions(+), 6 deletions(-))
Terraform Beta: Diff ( 2 files changed, 214 insertions(+), 6 deletions(-))
TF Validator: Diff ( 2 files changed, 214 insertions(+), 6 deletions(-))

@rileykarson
Copy link
Member

/gcbrun

@modular-magician
Copy link
Collaborator

Hi! I'm the modular magician. Your PR generated some diffs in downstreams - here they are.

Diff report:

Terraform GA: Diff ( 2 files changed, 214 insertions(+), 6 deletions(-))
Terraform Beta: Diff ( 2 files changed, 214 insertions(+), 6 deletions(-))
TF Validator: Diff ( 2 files changed, 214 insertions(+), 6 deletions(-))

@simamGit
Copy link
Contributor Author

simamGit commented Feb 9, 2022

the update test is working now for delete and add projects to the projectMap.
1- added "share_settings" to ImportStateVerifyIgnore list for all update test configuration. please let me know if it is wrong.
2- the test is running in my local terraform-provider. I have updated the pre_update but I do not know why the "boundle" command is not working correctly. it does not merge pre_update code (shared_reservation_update.go.erb) with resource_copmpute_reservation.go.

@modular-magician
Copy link
Collaborator

Hi! I'm the modular magician. Your PR generated some diffs in downstreams - here they are.

Diff report:

Terraform GA: Diff ( 2 files changed, 401 insertions(+), 14 deletions(-))
Terraform Beta: Diff ( 2 files changed, 401 insertions(+), 14 deletions(-))
TF Validator: Diff ( 2 files changed, 3 insertions(+), 3 deletions(-))

@modular-magician
Copy link
Collaborator

Hi! I'm the modular magician. Your PR generated some diffs in downstreams - here they are.

Diff report:

Terraform GA: Diff ( 2 files changed, 401 insertions(+), 14 deletions(-))
Terraform Beta: Diff ( 2 files changed, 401 insertions(+), 14 deletions(-))
TF Validator: Diff ( 2 files changed, 3 insertions(+), 3 deletions(-))

@modular-magician
Copy link
Collaborator

Hi! I'm the modular magician. Your PR generated some diffs in downstreams - here they are.

Diff report:

Terraform GA: Diff ( 2 files changed, 401 insertions(+), 14 deletions(-))
Terraform Beta: Diff ( 2 files changed, 401 insertions(+), 14 deletions(-))
TF Validator: Diff ( 2 files changed, 3 insertions(+), 3 deletions(-))

@rileykarson
Copy link
Member

/gcbrun

@modular-magician
Copy link
Collaborator

Hi! I'm the modular magician. Your PR generated some diffs in downstreams - here they are.

Diff report:

Terraform GA: Diff ( 2 files changed, 401 insertions(+), 14 deletions(-))
Terraform Beta: Diff ( 2 files changed, 401 insertions(+), 14 deletions(-))
TF Validator: Diff ( 2 files changed, 3 insertions(+), 3 deletions(-))

@modular-magician
Copy link
Collaborator

Tests were added that did not run in TeamCity:

  • TestAccComputeSharedReservation_update

@modular-magician
Copy link
Collaborator

I have triggered VCR tests in RECORDING mode for the following tests that failed during VCR: TestAccDatasourceGoogleServiceNetworkingPeeredDnsDomain_basic|TestAccApigeeEnvironmentIamBindingGenerated|TestAccApigeeEnvironmentIamMemberGenerated|TestAccApigeeEnvironmentIamPolicyGenerated|TestAccCloudbuildWorkerPool_basic|TestAccContainerCluster_withAuthenticatorGroupsConfig You can view the result here: https://ci-oss.hashicorp.engineering/viewQueued.html?itemId=260307

Copy link
Member

@rileykarson rileykarson left a comment

Choose a reason for hiding this comment

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

The test passed! 🎉

Got a few questions / comments, main blocker is the error during the call to the resourcemanager API

@simamGit
Copy link
Contributor Author

simamGit commented Feb 23, 2022

Thanks Riley for all the feedback, they applied and code is already pushed. I resolved all the conversations, but not sure who has to press the resolve conversion button!

@rileykarson
Copy link
Member

Resolve conversation's the same thing as Done in Critique, you're good to press it!

I don't expect the result to change, just running the test one more time.

@modular-magician
Copy link
Collaborator

Hi! I'm the modular magician. Your PR generated some diffs in downstreams - here they are.

Diff report:

Terraform GA: Diff ( 2 files changed, 401 insertions(+), 14 deletions(-))
Terraform Beta: Diff ( 2 files changed, 401 insertions(+), 14 deletions(-))
TF Validator: Diff ( 2 files changed, 3 insertions(+), 3 deletions(-))

Copy link
Member

@rileykarson rileykarson left a comment

Choose a reason for hiding this comment

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

Oh wait, I think we need to apply input: true to some more fields. In /~https://github.com/modular-magician/terraform-provider-google-beta/compare/auto-pr-5653-old..auto-pr-5653 you can see numerous unrelated fields losing ForceNew: true.

@modular-magician
Copy link
Collaborator

Hi! I'm the modular magician. Your PR generated some diffs in downstreams - here they are.

Diff report:

Terraform GA: Diff ( 2 files changed, 401 insertions(+), 6 deletions(-))
Terraform Beta: Diff ( 2 files changed, 401 insertions(+), 6 deletions(-))
TF Validator: Diff ( 2 files changed, 3 insertions(+), 3 deletions(-))

@rileykarson rileykarson merged commit dbadfce into GoogleCloudPlatform:master Mar 1, 2022
lcaggio pushed a commit to lcaggio/magic-modules that referenced this pull request Mar 16, 2022
lcaggio pushed a commit to lcaggio/magic-modules that referenced this pull request Mar 17, 2022
lcaggio pushed a commit to lcaggio/magic-modules that referenced this pull request Mar 18, 2022
betsy-lichtenberg pushed a commit to betsy-lichtenberg/magic-modules that referenced this pull request Apr 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants