Skip to content

Normalize name field#8360

Merged
trodge merged 6 commits into
GoogleCloudPlatform:mainfrom
trodge:monitoring-monitored-project
Jul 15, 2023
Merged

Normalize name field#8360
trodge merged 6 commits into
GoogleCloudPlatform:mainfrom
trodge:monitoring-monitored-project

Conversation

@trodge

@trodge trodge commented Jul 14, 2023

Copy link
Copy Markdown
Contributor

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)

monitoring: fixed an issue which occurred when `name` field of `google_monitoring_monitored_project` was long-form

@zli82016

Copy link
Copy Markdown
Member

Which test has the problem, @trodge ? Is this one TestAccMonitoringMonitoredProject_monitoringMonitoredProjectBasicExample?

@modular-magician

Copy link
Copy Markdown
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 ( 2 files changed, 9 insertions(+), 4 deletions(-))
Terraform Beta: Diff ( 1 file changed, 8 insertions(+), 4 deletions(-))
TF Conversion: Diff ( 2 files changed, 3 insertions(+), 3 deletions(-))

@trodge trodge requested a review from zli82016 July 14, 2023 19:47
@modular-magician

Copy link
Copy Markdown
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 ( 4 files changed, 61 insertions(+), 9 deletions(-))
Terraform Beta: Diff ( 3 files changed, 61 insertions(+), 7 deletions(-))
TF Conversion: Diff ( 3 files changed, 4 insertions(+), 3 deletions(-))

@zli82016

Copy link
Copy Markdown
Member

Add a secondary reviewer @slevenick

immutable: true
error_retry_predicates: ['transport_tpg.IsMonitoringPermissionError']
custom_code: !ruby/object:Provider::Terraform::CustomCode
custom_import: templates/terraform/custom_import/monitoring_monitored_project.go.erb

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Why do we need a custom import here? Is it only to support importing with the v1/ prefix?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

It's there to shorten the name and metrics_scope fields in the import id.

delete_url: v1/locations/global/metricsScopes/{{metrics_scope}}/projects/{{name}}
self_link: v1/locations/global/metricsScopes/{{metrics_scope}}
id_format: v1/locations/global/metricsScopes/{{metrics_scope}}/projects/{{name}}
id_format: locations/global/metricsScopes/{{metrics_scope}}/projects/{{name}}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think we need an upgrade state function to make sure any of these resources that were created with the v1/ prefix are moved to the correct id format

@modular-magician

Copy link
Copy Markdown
Collaborator

Tests analytics

Total tests: 2857
Passed tests 2555
Skipped tests: 299
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
TestAccContainerAwsNodePool_BetaBasicHandWritten|TestAccComputeFirewallPolicyRule_multipleRules|TestAccMonitoringMonitoredProject_monitoringMonitoredProjectLongFormExample

Get to know how VCR tests work

@modular-magician

Copy link
Copy Markdown
Collaborator

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

Rerun these tests in REPLAYING mode to catch issues

$\textcolor{green}{\textsf{No issues found for passed tests after REPLAYING rerun.}}$


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

@trodge trodge force-pushed the monitoring-monitored-project branch from 238962d to 1c2aedb Compare July 14, 2023 22:39
@trodge trodge requested a review from slevenick July 14, 2023 22:40
@modular-magician

Copy link
Copy Markdown
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 ( 3 files changed, 111 insertions(+), 9 deletions(-))
Terraform Beta: Diff ( 3 files changed, 111 insertions(+), 9 deletions(-))
TF Conversion: Diff ( 3 files changed, 4 insertions(+), 3 deletions(-))

@modular-magician

Copy link
Copy Markdown
Collaborator

Tests analytics

Total tests: 2861
Passed tests 2560
Skipped tests: 299
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
TestAccContainerAwsNodePool_BetaBasicHandWritten|TestAccComputeFirewallPolicyRule_multipleRules

Get to know how VCR tests work

@modular-magician

Copy link
Copy Markdown
Collaborator

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

@slevenick slevenick left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM, I tried out the upgrade path from 4.70.0 --> 4.73.1 --> this version manually and it works

@trodge trodge merged commit a779650 into GoogleCloudPlatform:main Jul 15, 2023
@trodge trodge deleted the monitoring-monitored-project branch July 15, 2023 00:55
ericayyliu pushed a commit to ericayyliu/magic-modules that referenced this pull request Jul 26, 2023
* Normalize name field

* Fix import

* Support previous import id

* Also shorten name in encoder

* Add long form test

* Add upgrade state function
wj-chen pushed a commit to wj-chen/magic-modules that referenced this pull request Aug 1, 2023
* Normalize name field

* Fix import

* Support previous import id

* Also shorten name in encoder

* Add long form test

* Add upgrade state function
DanielRieske pushed a commit to bschaatsbergen/magic-modules that referenced this pull request Aug 2, 2023
* Normalize name field

* Fix import

* Support previous import id

* Also shorten name in encoder

* Add long form test

* Add upgrade state function
hao-nan-li pushed a commit to hao-nan-li/magic-modules that referenced this pull request Aug 9, 2023
* Normalize name field

* Fix import

* Support previous import id

* Also shorten name in encoder

* Add long form test

* Add upgrade state function
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.

4 participants