Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Add conflict for notification_rate_limit when alert policy is not log based #12941

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

philipsabri
Copy link
Contributor

Currently, when you try to add notification_rate_limit to a non-log alert policy, the GCP API stops you at the apply stage. This change would prevent it at the plan stage instead.

No changes are needed for users, as the API already enforces this restriction. However, if you work in an environment where the apply stage only happens after merging your PR, you would have to create another PR to remove this block. This has happened to me multiple times when copying other policy blocks that included notification_rate_limit.

https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/monitoring_alert_policy#notification_rate_limit-1

Release Note Template for Downstream PRs (will be copied)

See Write release notes for guidance.

Add conflict rules for notification_rate_limit when alert policy is not log based

@github-actions github-actions bot requested a review from trodge February 1, 2025 13:38
Copy link

github-actions bot commented Feb 1, 2025

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

@trodge, 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 need reviewer's approval to run presubmit tests label Feb 1, 2025
@philipsabri philipsabri force-pushed the alert-policy-notification-rate-limit-conflict branch from d5e0667 to 7fab1f9 Compare February 1, 2025 13:41
Copy link

github-actions bot commented Feb 6, 2025

@trodge This PR has been waiting for review for 3 weekdays. Please take a look! Use the label disable-review-reminders to disable these notifications.

@modular-magician modular-magician added service/monitoring-alerting and removed awaiting-approval Pull requests that need reviewer's approval to run presubmit tests labels Feb 7, 2025
@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, 1 insertion(+))
google-beta provider: Diff ( 1 file changed, 1 insertion(+))

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 56
Passed tests: 0
Skipped tests: 3
Affected tests: 53

Click here to see the affected service packages
  • monitoring

Action taken

Found 53 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
  • TestAccDataSourceGoogleMonitoringNotificationChannel_ErrorNoDisplayNameOrType
  • TestAccDataSourceGoogleMonitoringNotificationChannel_ErrorNotFound
  • TestAccDataSourceGoogleMonitoringNotificationChannel_ErrorNotUnique
  • TestAccDataSourceGoogleMonitoringNotificationChannel_UserLabel
  • TestAccDataSourceGoogleMonitoringNotificationChannel_byDisplayName
  • TestAccDataSourceGoogleMonitoringNotificationChannel_byDisplayNameAndType
  • TestAccDataSourceGoogleMonitoringNotificationChannel_byTypeAndLabel
  • TestAccDataSourceGoogleMonitoringUptimeCheckIps_basic
  • TestAccDataSourceMonitoringService_AppEngine
  • TestAccMonitoringAlertPolicy
  • TestAccMonitoringDashboard_basic
  • TestAccMonitoringDashboard_rowLayout
  • TestAccMonitoringDashboard_update
  • TestAccMonitoringGenericService_monitoringServiceExampleExample
  • TestAccMonitoringGroup_monitoringGroupBasicExample
  • TestAccMonitoringGroup_monitoringGroupSubgroupExample
  • TestAccMonitoringGroup_update
  • TestAccMonitoringMetricDescriptor_monitoringMetricDescriptorAlertExample
  • TestAccMonitoringMetricDescriptor_monitoringMetricDescriptorBasicExample
  • TestAccMonitoringMetricDescriptor_update
  • TestAccMonitoringMonitoredProject_monitoringMonitoredProjectBasicExample
  • TestAccMonitoringMonitoredProject_monitoringMonitoredProjectLongFormExample
  • TestAccMonitoringMonitoredProject_projectNumLongForm
  • TestAccMonitoringMonitoredProject_projectNumShortForm
  • TestAccMonitoringNotificationChannel_notificationChannelBasicExample
  • TestAccMonitoringNotificationChannel_update
  • TestAccMonitoringNotificationChannel_updateLabels
  • TestAccMonitoringNotificationChannel_updateSensitiveLabels
  • TestAccMonitoringService_basic
  • TestAccMonitoringService_monitoringServiceCustomExample
  • TestAccMonitoringSlo_availabilitySli
  • TestAccMonitoringSlo_basic
  • TestAccMonitoringSlo_genericService
  • TestAccMonitoringSlo_monitoringSloAppengineExample
  • TestAccMonitoringSlo_monitoringSloRequestBasedExample
  • TestAccMonitoringSlo_monitoringSloWindowsBasedGoodBadMetricFilterExample
  • TestAccMonitoringSlo_monitoringSloWindowsBasedMetricMeanExample
  • TestAccMonitoringSlo_monitoringSloWindowsBasedMetricSumExample
  • TestAccMonitoringSlo_monitoringSloWindowsBasedRatioThresholdExample
  • TestAccMonitoringSlo_requestBased
  • TestAccMonitoringSlo_windowBasedGoodTotalRatioThresholdSlis
  • TestAccMonitoringSlo_windowBasedMetricMeanRangeSlis
  • TestAccMonitoringSlo_windowBasedMetricSumRangeSlis
  • TestAccMonitoringSlo_windowBased_updateSlis
  • TestAccMonitoringUptimeCheckConfig_changeNonUpdatableFields
  • TestAccMonitoringUptimeCheckConfig_jsonPathUpdate
  • TestAccMonitoringUptimeCheckConfig_noProjectId
  • TestAccMonitoringUptimeCheckConfig_update
  • TestAccMonitoringUptimeCheckConfig_uptimeCheckConfigHttpExample
  • TestAccMonitoringUptimeCheckConfig_uptimeCheckConfigHttpsExample
  • TestAccMonitoringUptimeCheckConfig_uptimeCheckConfigStatusCodeExample
  • TestAccMonitoringUptimeCheckConfig_uptimeCheckConfigSyntheticMonitorExample
  • TestAccMonitoringUptimeCheckConfig_uptimeCheckTcpExample

Get to know how VCR tests work

@modular-magician
Copy link
Collaborator

🔴 Tests failed during RECORDING mode:
TestAccDataSourceGoogleMonitoringNotificationChannel_ErrorNoDisplayNameOrType [Error message] [Debug log]
TestAccDataSourceGoogleMonitoringNotificationChannel_ErrorNotFound [Error message] [Debug log]
TestAccDataSourceGoogleMonitoringNotificationChannel_ErrorNotUnique [Error message] [Debug log]
TestAccDataSourceGoogleMonitoringNotificationChannel_UserLabel [Error message] [Debug log]
TestAccDataSourceGoogleMonitoringNotificationChannel_byDisplayName [Error message] [Debug log]
TestAccDataSourceGoogleMonitoringNotificationChannel_byDisplayNameAndType [Error message] [Debug log]
TestAccDataSourceGoogleMonitoringNotificationChannel_byTypeAndLabel [Error message] [Debug log]
TestAccDataSourceGoogleMonitoringUptimeCheckIps_basic [Error message] [Debug log]
TestAccDataSourceMonitoringService_AppEngine [Error message] [Debug log]
TestAccMonitoringAlertPolicy [Error message] [Debug log]
TestAccMonitoringDashboard_basic [Error message] [Debug log]
TestAccMonitoringDashboard_rowLayout [Error message] [Debug log]
TestAccMonitoringDashboard_update [Error message] [Debug log]
TestAccMonitoringGenericService_monitoringServiceExampleExample [Error message] [Debug log]
TestAccMonitoringGroup_monitoringGroupBasicExample [Error message] [Debug log]
TestAccMonitoringGroup_monitoringGroupSubgroupExample [Error message] [Debug log]
TestAccMonitoringGroup_update [Error message] [Debug log]
TestAccMonitoringMetricDescriptor_monitoringMetricDescriptorAlertExample [Error message] [Debug log]
TestAccMonitoringMetricDescriptor_monitoringMetricDescriptorBasicExample [Error message] [Debug log]
TestAccMonitoringMetricDescriptor_update [Error message] [Debug log]
TestAccMonitoringMonitoredProject_monitoringMonitoredProjectBasicExample [Error message] [Debug log]
TestAccMonitoringMonitoredProject_monitoringMonitoredProjectLongFormExample [Error message] [Debug log]
TestAccMonitoringMonitoredProject_projectNumLongForm [Error message] [Debug log]
TestAccMonitoringMonitoredProject_projectNumShortForm [Error message] [Debug log]
TestAccMonitoringNotificationChannel_notificationChannelBasicExample [Error message] [Debug log]
TestAccMonitoringNotificationChannel_update [Error message] [Debug log]
TestAccMonitoringNotificationChannel_updateLabels [Error message] [Debug log]
TestAccMonitoringNotificationChannel_updateSensitiveLabels [Error message] [Debug log]
TestAccMonitoringService_basic [Error message] [Debug log]
TestAccMonitoringService_monitoringServiceCustomExample [Error message] [Debug log]
TestAccMonitoringSlo_availabilitySli [Error message] [Debug log]
TestAccMonitoringSlo_basic [Error message] [Debug log]
TestAccMonitoringSlo_genericService [Error message] [Debug log]
TestAccMonitoringSlo_monitoringSloAppengineExample [Error message] [Debug log]
TestAccMonitoringSlo_monitoringSloRequestBasedExample [Error message] [Debug log]
TestAccMonitoringSlo_monitoringSloWindowsBasedGoodBadMetricFilterExample [Error message] [Debug log]
TestAccMonitoringSlo_monitoringSloWindowsBasedMetricMeanExample [Error message] [Debug log]
TestAccMonitoringSlo_monitoringSloWindowsBasedMetricSumExample [Error message] [Debug log]
TestAccMonitoringSlo_monitoringSloWindowsBasedRatioThresholdExample [Error message] [Debug log]
TestAccMonitoringSlo_requestBased [Error message] [Debug log]
TestAccMonitoringSlo_windowBasedGoodTotalRatioThresholdSlis [Error message] [Debug log]
TestAccMonitoringSlo_windowBasedMetricMeanRangeSlis [Error message] [Debug log]
TestAccMonitoringSlo_windowBasedMetricSumRangeSlis [Error message] [Debug log]
TestAccMonitoringSlo_windowBased_updateSlis [Error message] [Debug log]
TestAccMonitoringUptimeCheckConfig_changeNonUpdatableFields [Error message] [Debug log]
TestAccMonitoringUptimeCheckConfig_jsonPathUpdate [Error message] [Debug log]
TestAccMonitoringUptimeCheckConfig_noProjectId [Error message] [Debug log]
TestAccMonitoringUptimeCheckConfig_update [Error message] [Debug log]
TestAccMonitoringUptimeCheckConfig_uptimeCheckConfigHttpExample [Error message] [Debug log]
TestAccMonitoringUptimeCheckConfig_uptimeCheckConfigHttpsExample [Error message] [Debug log]
TestAccMonitoringUptimeCheckConfig_uptimeCheckConfigStatusCodeExample [Error message] [Debug log]
TestAccMonitoringUptimeCheckConfig_uptimeCheckConfigSyntheticMonitorExample [Error message] [Debug log]
TestAccMonitoringUptimeCheckConfig_uptimeCheckTcpExample [Error message] [Debug log]

🔴 Errors occurred during RECORDING mode. Please fix them to complete your PR.

View the build log or the debug log for each test

# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants