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

Prevent permadiff on monitoring_uptime_check_config #10694

Conversation

VenelinMartinov
Copy link
Contributor

@VenelinMartinov VenelinMartinov commented May 14, 2024

Fixes a permadiff on uptime check config which causes it to be recreated every time.

The labels property in the monitored_resource property should ignore changes to the project_id label if not set by the user. GCP sets the project_id and that causes the resource to exhibit a diff and get recreated every time.

fixes hashicorp/terraform-provider-google#18038

Release Note Template for Downstream PRs (will be copied)

monitoring: fixed a permadiff with `monitored_resource.labels` property in the `google_monitoring_uptime_check_config` resource

Copy link

google-cla bot commented May 14, 2024

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@github-actions github-actions bot requested a review from c2thorn May 14, 2024 11:56
Copy link

Hello! I am a robot. Tests will require approval from a repository maintainer to run.

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

@modular-magician modular-magician added the awaiting-approval Pull requests that needs reviewer's approval to run presubmit tests label May 14, 2024
@VenelinMartinov VenelinMartinov changed the title Make lables on uptime check config computed Prevent permadiff on monitoring_uptime_check_config May 14, 2024
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.

Hi @VenelinMartinov, thanks for contributing this fix. Would you mind adding a test to https://github.com/GoogleCloudPlatform/magic-modules/blob/main/mmv1/third_party/terraform/services/monitoring/resource_monitoring_uptime_check_config_test.go that shows the currently failing scenario? There are other examples there and we have documentation under the handwritten tab in https://googlecloudplatform.github.io/magic-modules/develop/test/test/#add-a-create-test

@modular-magician modular-magician added service/monitoring-uptime and removed awaiting-approval Pull requests that needs reviewer's approval to run presubmit tests labels May 14, 2024
@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 ( 1 file changed, 15 insertions(+), 5 deletions(-))
google-beta provider: Diff ( 1 file changed, 15 insertions(+), 5 deletions(-))
terraform-google-conversion: Diff ( 1 file changed, 10 insertions(+))

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 55
Passed tests: 52
Skipped tests: 3
Affected tests: 0

Click here to see the affected service packages
  • monitoring

$\textcolor{green}{\textsf{All tests passed!}}$
View the build log

@github-actions github-actions bot requested a review from c2thorn May 15, 2024 11:52
@modular-magician modular-magician added the awaiting-approval Pull requests that needs reviewer's approval to run presubmit tests label May 15, 2024
@VenelinMartinov
Copy link
Contributor Author

Hi @c2thorn, thanks for your review. I've added a test as suggested. I verified that it fails before my fix and is fixed after.

I've also verified that hashicorp/terraform-provider-google#18038 no longer reproes with the fix.

LMK if there are any other issues here.

@modular-magician modular-magician removed the awaiting-approval Pull requests that needs reviewer's approval to run presubmit tests label May 16, 2024
@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, 76 insertions(+), 5 deletions(-))
google-beta provider: Diff ( 2 files changed, 76 insertions(+), 5 deletions(-))
terraform-google-conversion: Diff ( 1 file changed, 10 insertions(+))

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 56
Passed tests: 52
Skipped tests: 3
Affected tests: 1

Click here to see the affected service packages
  • monitoring

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
TestAccMonitoringUptimeCheckConfig_noProjectId

Get to know how VCR tests work

@modular-magician
Copy link
Collaborator

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

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

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.

LGTM thank you!

ma-g-22 pushed a commit to ma-g-22/magic-modules that referenced this pull request May 21, 2024
pengq-google pushed a commit to pengq-google/magic-modules that referenced this pull request May 21, 2024
Cheriit pushed a commit to Cheriit/magic-modules that referenced this pull request Jun 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants