feat: update-oncall-usergroups: implement --next-schedules, which selects ingress on-call
This is an alternative implementation of !691 (closed).
We revisiting this prior assumption, specifically the "predictive capability" part. We do in fact have the ability to see who is going to be on-call for an escalation policy in the future, and we are already using that for the handover.
We can see the since and until parameters for the /oncalls endpoint: PagerDuty API docs.
This was tested locally with a PD API token. The slack bit was not tested, but we can test it in production with DRY_RUN=true. This will be added to gitlab-com/gl-infra/k8s-workloads/tanka-deployments!1244 (merged).
This patch is designed to handle our rather complex setup for staggered ceoc schedules:
[EMEA G1] # next = AMER G1
[EMEA G2] # next = AMER G1
[AMER G1] # next = AMER G2 (until start of G2, then same as G2)
[AMER G2] # next = AMER G3 (until start of G3, then same as G3)
[AMER G3] # next = APAC G1
[APAC G1] # next = APAC G2
[APAC G2] # next = EMEA G1 and G2
[EMEA G1]
[EMEA G2]
Thanks @kballon for pairing on this!
Edited by Igor