opsgenie / terraform-provider-opsgenie

Terraform OpsGenie provider
https://registry.terraform.io/providers/opsgenie/opsgenie/latest/docs
Mozilla Public License 2.0
104 stars 137 forks source link

How to add a new user to a schedule rotation without breaking the order #185

Open zonArt opened 4 years ago

zonArt commented 4 years ago

Hi there,

It looks like when you add a user to a schedule rotation you need to update the start date to not break the current schedule. This is done smoothly in the UI where it propose you a new start date to not break stuff but how can you deduce this date when applying the terraform code?

Terraform Version

Terraform v0.12.29

Affected Resource(s)

Terraform Configuration Files

resource "opsgenie_schedule_rotation" "test" {
  name        = test schedule rotation
  start_date  = 2020-10-06T00:00:00Z
  length      = 1
  type        = "weekly"
  schedule_id = opsgenie_schedule.test.id
  participant {
    type = "user"
    id   = opsgenie_user.user1.id
  }
  participant {
    type = "user"
    id   = opsgenie_user.user2.id
  }
  participant {
    type = "user"
    id   = opsgenie_user.user3.id
  }
  participant {
    type = "user"
    id   = opsgenie_user.user4.id
  }
  participant {
    type = "user"
    id   = opsgenie_user.user5.id
  }
}

Expected Behavior

User is added to the schedule without breaking the current one, added at the end

Actual Behavior

User is added at the end and all the schedule is shuffled from the previous start date making current oncall a full mess to manage

Steps to Reproduce

Please list the steps required to reproduce the issue, for example:

  1. add a new schedule rotation with a few members, a specific order with type weekly and length 1
  2. wait a few weeks and try to add another user
ffahri commented 3 years ago

Yep we should also support this feature thanks @zonArt

zonArt commented 3 years ago

Any news on this one?