-
Notifications
You must be signed in to change notification settings - Fork 212
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
Event orch resource singular names #517
Event orch resource singular names #517
Conversation
…ons, pd_automation_actions, automations_action (headers, params) singular
Type: schema.TypeList, | ||
Optional: true, | ||
Elem: &schema.Resource{ | ||
Schema: eventOrchestrationPathVariablesSchema, | ||
}, | ||
}, | ||
"extractions": { | ||
"extraction": { |
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.
I have checked ruleset example https://github.com/PagerDuty/terraform-provider-pagerduty/blob/master/pagerduty/resource_pagerduty_ruleset_rule.go#L246 and it looks like extractions are kept as plural there. Same with subconditions
. Is that overlooked in rulesets?
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.
Does it have something to do with level of nesting?
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.
I believe it was either overlooked or added before the naming convention was established because variables that were added later are singular: https://github.com/PagerDuty/terraform-provider-pagerduty/blob/master/pagerduty/resource_pagerduty_ruleset_rule.go#L285
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.
Just leave it here for the reference https://www.terraform.io/plugin/sdkv2/best-practices/naming#data-source-names
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.
@alexzakabluk Yeah, it looks like I overlooked those fields in the resource_pagerduty_ruleset_rule
. I've been trying to keep the naming convention of singular object names for objects that repeat in a definition. The reasoning has been to stay consistent with the other objects in the PagerDuty provider. If we were starting from scratch we would probably go with the pluralized names to match the Best Practices link you posted.
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.
Thanks @alenapan !! 👍 🎉 🌮
Changes
Schema attributes that represent a list of objects need to have singular names to adhere to the convention. This PR fixes inconsistencies in the following resources:
pagerduty_event_orchestration
:pagerduty_event_orchestration_router
:pagerduty_event_orchestration_unrouted
:sets -> set
rules -> rule
conditions -> condition
actions.variables -> actions.variable
actions.extractions -> actions.extraction
documentation
pagerduty_event_orchestration_service
:sets -> set
rules -> rule
conditions -> condition
actions.variables -> actions.variable
actions.extractions -> actions.extraction
actions.pagerduty_automation_actions -> actions.pagerduty_automation_action
actions.automation_actions -> actions.automation_action
actions.automation_actions.headers -> actions.automation_actions.header
actions.automation_actions.parameters -> actions.automation_actions.parameter
documentation
Testing
Acceptance Tests: