-
Notifications
You must be signed in to change notification settings - Fork 209
fix: Removes interval_min validation blocking notification type updates in alert_configuration
#3882
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
base: master
Are you sure you want to change the base?
Conversation
Remove validation that prevented updating alert notifications from types supporting interval_min to PAGER_DUTY/OPS_GENIE/VICTOR_OPS. Since interval_min is optional and not preserved via UseStateForUnknown, it will only be sent to the API if explicitly set in config, allowing updates to succeed. Fixes #3869
…ions Implement a new validator to ensure that the `interval_min` attribute is not set for notification types that do not support it (PAGER_DUTY, OPS_GENIE, VICTOR_OPS). This change prevents configuration errors during the plan phase and enhances user feedback.
|
APIx bot: a message has been sent to Docs Slack channel |
|
Failing test is data federation with s3 access error (investigation going on with upstream team) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR fixes a bug preventing updates from notification types supporting interval_min (e.g., MICROSOFT_TEAMS) to types that don't support it (PAGER_DUTY, OPS_GENIE, VICTOR_OPS). The validation is moved from runtime to schema-level to provide earlier feedback while allowing updates to succeed when interval_min is not explicitly set.
Key changes:
- Replaced runtime validation in
NewNotificationListwith a schema-level validator - Added
IntervalMinValidatorto validateinterval_minduring Terraform plan phase - Added comprehensive test coverage for notification type transitions
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| internal/service/alertconfiguration/validator_interval_min.go | Implements new schema-level validator for interval_min attribute |
| internal/service/alertconfiguration/resource.go | Integrates the validator into the schema definition |
| internal/service/alertconfiguration/model.go | Removes old runtime validation logic |
| internal/service/alertconfiguration/resource_test.go | Adds test cases for notification type transitions and validation |
| .changelog/3882.txt | Documents the bug fix |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Description
Remove validation that prevented updating alert notifications from types
supporting interval_min to PAGER_DUTY/OPS_GENIE/VICTOR_OPS. Since
interval_min is optional and not preserved via UseStateForUnknown, it will
only be sent to the API if explicitly set in config, allowing updates to
succeed.
Link to any related issue(s): #3869 CLOUDP-358194
Type of change:
Required Checklist:
Further comments