-
Notifications
You must be signed in to change notification settings - Fork 248
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
feat(alert_muting_rule): Add action_on_muting_rule_window_ended
attribute in newrelic_alert_muting_rule
Terraform Resource
#2783
base: main
Are you sure you want to change the base?
Conversation
… handlers in alert muting rule
end_behaviour
attribute in newrelic_alert_muting_rule
Terraform Resource
…for terraform provider
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.
approved
end_behaviour
attribute in newrelic_alert_muting_rule
Terraform Resourceend_behaviour
attribute in newrelic_alert_muting_rule
Terraform Resource
@Aashirwadjain please add documentation changes (I've pointed where the documentation is to be added below), without which customers would not be aware of the addition of this new attribute. terraform-provider-newrelic/website/docs/r/alert_muting_rule.html.markdown Lines 48 to 57 in 25894e4
|
@Aashirwadjain in addition, please add relevant changes to integration tests, to make sure this new attribute is also part of the configuration that is created, read, and updated by the integration test for muting rules. Please see the following file, add wherever appropriate. By this, I mean - you don't have to add the attribute to all tests, just make sure the attribute is added wherever needed to make sure atleast one test fully covers this attribute too, along with other attributes of the resource (during create, read, update). |
@Aashirwadjain one occurrence that you will also find while testing your changes :) Screen.Recording.2024-12-19.at.12.18.13.AM.mov
Think of why this is happening, and what needs to be added/deleted/fixed in the code to prevent this occurrence. Fixing this is important, otherwise this would affect current customers using this Terraform resource without the new attribute (if these changes are merged without the fix, they would see a change upon Please rigorously test your changes to help fill such gaps :) |
…muting_rule_window_ended and validation method
…ement typecasting
…to alert muting rule test cases
…bute to newrelic_alert_muting_rule documentation
Thanks for suggestions @pranav-new-relic, Following changes are made accordingly:
|
…window_ended attribute in docs
…NewRelicAlertMutingRuleBasic method
…ourInput test method
…indow_ended attribute
end_behaviour
attribute in newrelic_alert_muting_rule
Terraform Resourceaction_on_muting_rule_window_ended
attribute in newrelic_alert_muting_rule
Terraform Resource
if _, ok := d.GetOk("action_on_muting_rule_window_ended"); ok { | ||
_ = d.Set("action_on_muting_rule_window_ended", mutingRule.ActionOnMutingRuleWindowEnded) | ||
} | ||
_ = d.Set("action_on_muting_rule_window_ended", mutingRule.ActionOnMutingRuleWindowEnded) |
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.
@vagrawal-newrelic @Aashirwadjain this is nice, but the attribute doesn't need to be Computed
for this to happen since the read function is anyway being called in create; you can just have this condition.
The only thing to double check is that since this is coming from an enum in client go, if there is no value returned from the API for this attribute, is an empty string effectively being sent to Terraform from the Go Client via this attribute and saved as "" to the state; if this is the case, we should be okay; and if not, a condition might need to be added accordingly. I don't think this should be the case though.
Please test these changes (for all cases we ideated previously) and let me know if you discover something unusual
@@ -54,7 +55,7 @@ The following arguments are supported: | |||
* `name` - The name of the MutingRule. | |||
* `description` - The description of the MutingRule. | |||
* `schedule` - (Optional) Specify a schedule for enabling the MutingRule. See [Schedule](#schedule) below for details | |||
|
|||
* `action_on_muting_rule_window_ended` - (Optional) The action when the muting rule window is ended or disabled. Valid values are `CLOSE_ISSUES_ON_INACTIVE`, `DO_NOTHING` |
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.
* `action_on_muting_rule_window_ended` - (Optional) The action when the muting rule window is ended or disabled. Valid values are `CLOSE_ISSUES_ON_INACTIVE`, `DO_NOTHING` | |
* `action_on_muting_rule_window_ended` - (Optional) The action when the muting rule window is ended or disabled. Valid values are `CLOSE_ISSUES_ON_INACTIVE`, `DO_NOTHING`. |
just a .
:)
we should be good to merge once the requested changes are done (and further reviewed by VIshal/me), but
|
Description
action_on_muting_rule_window_ended
attribute in thenewrelic_alert_muting_rule
Terraform resource aims to enhance the functionality of muting rules within New Relic's alerting system using terraform.action_on_muting_rule_window_ended
is added to MutingRule Schema Resource and handler methods.newrelic_alert_muting_rule
: Support for Muting Rule "End Behaviour" #2774Type of change
Please delete options that are not relevant.
Checklist:
Please delete options that are not relevant.