Skip to content
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

Stop retrying on Schedule deletion when open incidents are untraceable #714

Conversation

imjaroiswebdev
Copy link
Contributor

@imjaroiswebdev imjaroiswebdev commented Jul 21, 2023

When an Escalation Policy using and Schedule receives a new Incident, a snapshot of the EP gets created to trace the relation of the Incident with that EP and its dependencies during the Incident life cycle, however when a that Schedule gets moved from the EP before closing or reassigning the Incident, the traceability of the Schedule with the Incident is lost, therefore retrying on error "[Schedule can't be deleted if it's being used by an escalation policy snapshot with open incidents]" becomes meaningless, so this update is meant to return immediately after matching this scenario.

Test results

$ PAGERDUTY_ACC_SCHEDULE_USED_BY_EP_W_1_LAYER=1 make testacc TESTARGS="-run TestAccPagerDutySchedule"
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test $(go list ./... |grep -v 'vendor') -v -run TestAccPagerDutySchedule -timeout 120m
?       github.com/terraform-providers/terraform-provider-pagerduty     [no test files]
=== RUN   TestAccPagerDutySchedule_import
--- PASS: TestAccPagerDutySchedule_import (13.91s)
=== RUN   TestAccPagerDutySchedule_Basic
--- PASS: TestAccPagerDutySchedule_Basic (22.27s)
=== RUN   TestAccPagerDutyScheduleWithTeams_Basic
--- PASS: TestAccPagerDutyScheduleWithTeams_Basic (16.23s)
=== RUN   TestAccPagerDutySchedule_BasicWithExternalDestroyHandling
--- PASS: TestAccPagerDutySchedule_BasicWithExternalDestroyHandling (13.00s)
=== RUN   TestAccPagerDutyScheduleWithTeams_EscalationPolicyDependant
--- PASS: TestAccPagerDutyScheduleWithTeams_EscalationPolicyDependant (19.05s)
=== RUN   TestAccPagerDutyScheduleWithTeams_EscalationPolicyDependantWithOneLayer
--- PASS: TestAccPagerDutyScheduleWithTeams_EscalationPolicyDependantWithOneLayer (47.27s)
=== RUN   TestAccPagerDutyScheduleWithTeams_EscalationPolicyDependantWithOpenIncidents
--- PASS: TestAccPagerDutyScheduleWithTeams_EscalationPolicyDependantWithOpenIncidents (54.16s)
=== RUN   TestAccPagerDutySchedule_EscalationPolicyDependantWithOpenIncidents
--- PASS: TestAccPagerDutySchedule_EscalationPolicyDependantWithOpenIncidents (60.47s)
=== RUN   TestAccPagerDutyScheduleOverflow_Basic
--- PASS: TestAccPagerDutyScheduleOverflow_Basic (14.31s)
=== RUN   TestAccPagerDutySchedule_BasicWeek
--- PASS: TestAccPagerDutySchedule_BasicWeek (14.31s)
=== RUN   TestAccPagerDutySchedule_Multi
--- PASS: TestAccPagerDutySchedule_Multi (16.58s)
PASS
ok      github.com/terraform-providers/terraform-provider-pagerduty/pagerduty   292.056s

@imjaroiswebdev imjaroiswebdev changed the title Stop retrying on Schedule del when open incidents are untrackable Stop retrying on Schedule deletion when open incidents are untraceable Jul 21, 2023
@imjaroiswebdev imjaroiswebdev merged commit 14ac5f1 into PagerDuty:master Jul 21, 2023
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant