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

The version field should be under configmanagement instead of under oci #9587

Merged
merged 58 commits into from
Dec 12, 2023

Conversation

sahsagar-google
Copy link
Member

@sahsagar-google sahsagar-google commented Dec 5, 2023

Fixes hashicorp/terraform-provider-google#16684

Release Note Template for Downstream PRs (will be copied)

gkehub2: added field `version` under `configmanagement` instead of a child field `oci` in `google_gke_hub_feature` resource

sahsagar-google and others added 30 commits July 19, 2023 19:04
@sahsagar-google
Copy link
Member Author

What happens when users put the version inside oci in the configuration? Does API return an error? @sahsagar-google

Yes, an error is returned. Something like this

Error: Error updating Feature "projects/sagarsahai-gke-dev/locations/global/features/configmanagement": googleapi: Error 400: Invalid JSON payload received. Unknown name "version" at 'resource.fleet_default_member_config.configmanagement.config_sync.oci': Cannot find field.
│ Details:
│ [
│ {
│ "@type": "type.googleapis.com/google.rpc.BadRequest",
│ "fieldViolations": [
│ {
│ "description": "Invalid JSON payload received. Unknown name "version" at 'resource.fleet_default_member_config.configmanagement.config_sync.oci': Cannot find field.",
│ "field": "resource.fleet_default_member_config.configmanagement.config_sync.oci"
│ }
│ ]
│ }
│ ]

@zli82016
Copy link
Member

zli82016 commented Dec 7, 2023

What happens when users put the version inside oci in the configuration? Does API return an error? @sahsagar-google

Yes, an error is returned. Something like this

Error: Error updating Feature "projects/sagarsahai-gke-dev/locations/global/features/configmanagement": googleapi: Error 400: Invalid JSON payload received. Unknown name "version" at 'resource.fleet_default_member_config.configmanagement.config_sync.oci': Cannot find field.
│ Details:
│ [
│ {
│ "@type": "type.googleapis.com/google.rpc.BadRequest",
│ "fieldViolations": [
│ {
│ "description": "Invalid JSON payload received. Unknown name "version" at 'resource.fleet_default_member_config.configmanagement.config_sync.oci': Cannot find field.",
│ "field": "resource.fleet_default_member_config.configmanagement.config_sync.oci"
│ }
│ ]
│ }
│ ]

Thanks for the clarification. Can you please add the test for the version field in the file https://github.com/GoogleCloudPlatform/magic-modules/blob/main/mmv1/third_party/terraform/services/gkehub2/resource_gke_hub_feature_test.go.erb#L456?

@zli82016 zli82016 added the override-breaking-change Allows a potential breaking change to be merged label Dec 7, 2023
@zli82016
Copy link
Member

zli82016 commented Dec 7, 2023

It is not a breaking change as it returns error when version field is in the original place.

@modular-magician
Copy link
Collaborator

Hi there, I'm the Modular magician. I've detected the following information about your changes:

Breaking Change(s) Detected

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

  • Field fleet_default_member_config.configmanagement.config_sync.oci.version within resource google_gke_hub_feature was either removed or renamed - 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.

Diff report

Your PR generated some diffs in downstreams - here they are.

Terraform GA: Diff ( 3 files changed, 28 insertions(+), 26 deletions(-))
Terraform Beta: Diff ( 3 files changed, 28 insertions(+), 26 deletions(-))
TF Conversion: Diff ( 1 file changed, 11 insertions(+), 11 deletions(-))

@modular-magician
Copy link
Collaborator

Hi there, I'm the Modular magician. I've detected the following information about your changes:

Breaking Change(s) Detected

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

  • Field fleet_default_member_config.configmanagement.config_sync.oci.version within resource google_gke_hub_feature was either removed or renamed - 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.

Diff report

Your PR generated some diffs in downstreams - here they are.

Terraform GA: Diff ( 3 files changed, 28 insertions(+), 26 deletions(-))
Terraform Beta: Diff ( 3 files changed, 28 insertions(+), 26 deletions(-))
TF Conversion: Diff ( 1 file changed, 11 insertions(+), 11 deletions(-))

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 3292
Passed tests 2953
Skipped tests: 338
Affected tests: 1

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
TestAccSpannerDatabaseIamPolicy

Get to know how VCR tests work

@modular-magician
Copy link
Collaborator

$\textcolor{green}{\textsf{Tests passed during RECORDING mode:}}$
TestAccSpannerDatabaseIamPolicy[Debug log]

Rerun these tests in REPLAYING mode to catch issues

$\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

@zli82016
Copy link
Member

Can you please run the test TestAccGKEHubFeature_FleetDefaultMemberConfigConfigManagement locally to see if it will pass or not? It is skipped in VCR tests.

Copy link
Member

@zli82016 zli82016 left a comment

Choose a reason for hiding this comment

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

LGTM. The contributor ran the test locally and it passed.

@shuyama1
Copy link
Member

@sahsagar-google @zli82016 This is still a breaking that we should avoid. We may consider - deprecating configmanagement.config_sync.oci.version and adding configmanagement.version for now and wait until next major release to remove configmanagement.config_sync.oci.version. Do we see any issues deprecating the incorrect field for now and removing it in the next major?

@zli82016
Copy link
Member

@sahsagar-google @zli82016 This is still a breaking that we should avoid. We may consider - deprecating configmanagement.config_sync.oci.version and adding configmanagement.version for now and wait until next major release to remove configmanagement.config_sync.oci.version. Do we see any issues deprecating the incorrect field for now and removing it in the next major?

Thanks for reverting the PR, @shuyama1. It makes sense to me. Previously I thought it is OK to remove configmanagement.config_sync.oci.version as it always returns an error.

@zli82016
Copy link
Member

zli82016 commented Dec 14, 2023

Sorry, @sahsagar-google , can you please open a new PR to deprecate configmanagement.config_sync.oci.version and add configmanagement.version? Thanks.

kapreus pushed a commit to kapreus/magic-modules that referenced this pull request Jan 2, 2024
…ci (GoogleCloudPlatform#9587)

* Adding Terraform resources for Tenancy APIs in GKEHub

* Segregating MembershipBinding and MembershipRBACRoleBinding to keep things simpler in the review

* Fixing the docu URIs

* Adding TF support for Tenancy API for Membership Binding

* Adding dependent membership binding to the same commit chain

* Making Scope un-updatable and replacing hard coded project number with the one from test env

* Making Scope RRBAC updatable

* Making Namespace immutable

* Adding update test cases

* Removing all memberships field from Scope since it is no longer supported

* Removing all_memberships field for Scope from all test cases

* Making naming in examples consistent across Tenancy APIs documentation

* Update mmv1/templates/terraform/examples/gkehub_membership_binding_basic.tf.erb

Co-authored-by: Shuya Ma <[email protected]>

* Update mmv1/templates/terraform/examples/gkehub_membership_binding_basic.tf.erb

Co-authored-by: Shuya Ma <[email protected]>

* Update mmv1/templates/terraform/examples/gkehub_membership_rbac_role_binding_basic.tf.erb

Co-authored-by: Shuya Ma <[email protected]>

* Fixing typo in the resource name

* Adding state migrations for Membership

* Updating the feature_membership documentation with the current resource state. Adding membership_location field to the doc

* Fixing the version field to be directly under configmanagement instead of under the oci field

* Adding tests for the field version

* Changing version fields value to test upgradation

---------

Co-authored-by: Shuya Ma <[email protected]>
balanaguharsha pushed a commit to balanaguharsha/magic-modules that referenced this pull request May 2, 2024
…ci (GoogleCloudPlatform#9587)

* Adding Terraform resources for Tenancy APIs in GKEHub

* Segregating MembershipBinding and MembershipRBACRoleBinding to keep things simpler in the review

* Fixing the docu URIs

* Adding TF support for Tenancy API for Membership Binding

* Adding dependent membership binding to the same commit chain

* Making Scope un-updatable and replacing hard coded project number with the one from test env

* Making Scope RRBAC updatable

* Making Namespace immutable

* Adding update test cases

* Removing all memberships field from Scope since it is no longer supported

* Removing all_memberships field for Scope from all test cases

* Making naming in examples consistent across Tenancy APIs documentation

* Update mmv1/templates/terraform/examples/gkehub_membership_binding_basic.tf.erb

Co-authored-by: Shuya Ma <[email protected]>

* Update mmv1/templates/terraform/examples/gkehub_membership_binding_basic.tf.erb

Co-authored-by: Shuya Ma <[email protected]>

* Update mmv1/templates/terraform/examples/gkehub_membership_rbac_role_binding_basic.tf.erb

Co-authored-by: Shuya Ma <[email protected]>

* Fixing typo in the resource name

* Adding state migrations for Membership

* Updating the feature_membership documentation with the current resource state. Adding membership_location field to the doc

* Fixing the version field to be directly under configmanagement instead of under the oci field

* Adding tests for the field version

* Changing version fields value to test upgradation

---------

Co-authored-by: Shuya Ma <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
override-breaking-change Allows a potential breaking change to be merged service/gkehub
Projects
None yet
Development

Successfully merging this pull request may close these issues.

The version field should be under configmanagement for google_gke_hub_feature resource
4 participants