PagerDuty / terraform-provider-pagerduty

Terraform PagerDuty provider
https://www.terraform.io/docs/providers/pagerduty/
Mozilla Public License 2.0
206 stars 210 forks source link

Adding an escape for an empty specifiedSteps slice when calling flattenIncidentWorkflowSteps #815

Closed jkueh closed 7 months ago

jkueh commented 8 months ago

I had encountered the same issue as reported here when importing an incident workflow:

I'm not 100% sure if this handles the resource attributes appropriately, would love a sanity check :) Testing this locally worked for me, as far as I can tell - Or at least let me finish importing my resources.

I've run the local acceptance tests, but it looks like one test fails before I've added my changes, so I can't be too sure 🤔 image

mfmbarros commented 8 months ago

I tested those changes locally and I confirm the plugin crash is gone when running plan with incident workflow import block on. However, in that plan I have Terraform attempting to update incident workflow by adding the steps present in declared resource but those steps are already created in PD instance so I was expecting an import without modifications rather than with update in the resource.

jkueh commented 8 months ago

Thanks! Will give that scenario a test and see if I can work out which bit is misbehaving 👍

imjaroiswebdev commented 7 months ago

Hi @jkueh thank you for the time you invested trying to fix this issue. The update you are proposing would save the provider from crashing when importing IW, however, it will also skip the fetching of the steps already set up on PagerDuty environment. A more complete patch for this has been merged in https://github.com/PagerDuty/terraform-provider-pagerduty/pull/820.

This patch for this will be released in a new version of the provider today. Please stay tuned :v: