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

split customize_diff, schema_version, and migrate_state from resource definition files #8203

Merged

Conversation

NickElliot
Copy link
Contributor

@NickElliot NickElliot commented Jun 23, 2023

Removes all but one resource_definition file and adds new custom_code attributes for mentioning custom_diff and migrate_state functions directly. To preserve the current functionality of schema_version when included .yaml schemas, a new attribute boolean has been added called "state_upgraders" for when that version compatibility feature needs to be used with the schema.

Work is required to remove a blocker on hashicorp/terraform-provider-google#11339 for resources that have existing customize_diff functions.

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).
  • 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).
  • Generated Terraform providers, and ran make test and make lint in the generated providers to ensure it passes unit and linter tests.
  • Ran relevant acceptance tests using my own Google Cloud project and credentials (If the acceptance tests do not yet pass or you are unable to run them, please let your reviewer know).
  • Read Write release notes before writing my release note below.

Release Note Template for Downstream PRs (will be copied)


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

Terraform GA: Diff ( 290 files changed, 882 insertions(+), 22 deletions(-))
Terraform Beta: Diff ( 351 files changed, 1066 insertions(+), 23 deletions(-))
TF Conversion: Diff ( 2 files changed, 3 insertions(+), 3 deletions(-))

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 2815
Passed tests 2511
Skipped tests: 301
Affected tests: 3

Action taken

Found 3 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
TestAccFolderIamPolicy_basic|TestAccComputeNetworkEndpoints_networkEndpointsBasic|TestAccComputeFirewallPolicyRule_multipleRules

Get to know how VCR tests work

@modular-magician
Copy link
Collaborator

Tests passed during RECORDING mode:
TestAccFolderIamPolicy_basic[Debug log]
TestAccComputeNetworkEndpoints_networkEndpointsBasic[Debug log]

Tests failed during RECORDING mode:
TestAccComputeFirewallPolicyRule_multipleRules[Error message] [Debug log]

Please fix these to complete your PR
View the build log or the debug log for each test

@NickElliot NickElliot marked this pull request as ready for review June 26, 2023 05:56
@NickElliot NickElliot requested a review from c2thorn June 26, 2023 05:57
@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.

Terraform GA: Diff ( 26 files changed, 81 insertions(+), 22 deletions(-))
Terraform Beta: Diff ( 27 files changed, 85 insertions(+), 23 deletions(-))
TF Conversion: Diff ( 2 files changed, 3 insertions(+), 3 deletions(-))

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 2816
Passed tests 2513
Skipped tests: 301
Affected tests: 2

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
TestAccComputeNetworkEndpoints_networkEndpointsBasic|TestAccComputeFirewallPolicyRule_multipleRules

Get to know how VCR tests work

@modular-magician
Copy link
Collaborator

Tests passed during RECORDING mode:
TestAccComputeNetworkEndpoints_networkEndpointsBasic[Debug log]

Tests failed during RECORDING mode:
TestAccComputeFirewallPolicyRule_multipleRules[Error message] [Debug log]

Please fix these to complete your PR
View the build log or the debug log for each test

Copy link
Member

@c2thorn c2thorn left a comment

Choose a reason for hiding this comment

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

new attributes make sense to me and the resulting diffs look good. LGTM

@NickElliot
Copy link
Contributor Author

Going to move the migrate_state and custom_diff blocks out of custom_code at Riley's suggestion

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

Terraform GA: Diff ( 26 files changed, 81 insertions(+), 22 deletions(-))
Terraform Beta: Diff ( 27 files changed, 85 insertions(+), 23 deletions(-))
TF Conversion: Diff ( 2 files changed, 3 insertions(+), 3 deletions(-))

@NickElliot
Copy link
Contributor Author

Same diffs produced, will merge soon.

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 2819
Passed tests 2516
Skipped tests: 301
Affected tests: 2

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
TestAccComputeNetworkEndpoints_networkEndpointsBasic|TestAccComputeFirewallPolicyRule_multipleRules

Get to know how VCR tests work

@modular-magician
Copy link
Collaborator

Tests passed during RECORDING mode:
TestAccComputeNetworkEndpoints_networkEndpointsBasic[Debug log]

Tests failed during RECORDING mode:
TestAccComputeFirewallPolicyRule_multipleRules[Error message] [Debug log]

Please fix these to complete your PR
View the build log or the debug log for each test

rainshen49 pushed a commit to rainshen49/magic-modules that referenced this pull request Jun 27, 2023
… definition files (GoogleCloudPlatform#8203)

updated yaml parser and generator to offer more flexible schema_version usage, and support directly included migrate_state and customize_diff functions
ericayyliu pushed a commit to ericayyliu/magic-modules that referenced this pull request Jul 26, 2023
… definition files (GoogleCloudPlatform#8203)

updated yaml parser and generator to offer more flexible schema_version usage, and support directly included migrate_state and customize_diff functions
wj-chen pushed a commit to wj-chen/magic-modules that referenced this pull request Aug 1, 2023
… definition files (GoogleCloudPlatform#8203)

updated yaml parser and generator to offer more flexible schema_version usage, and support directly included migrate_state and customize_diff functions
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.

3 participants