# What this PR does
Current implementation of PD migrator creates schedule layers with
priority levels starting from 0.
This PR makes so layers start from 1, so it's closer to original PD
schedules that are starting from 1.
## Checklist
- [x] Tests updated
# What this PR does
Allows PD migrator to migrate overrides (the current implementation only
migrates rotation layers).
Also tweaks public API so created overrides are consistent with the web
UI.
## Checklist
- [x] Tests updated
Allow PD migrator tool to migrate on-call shifts when migrating
schedules (currently it migrates schedules using PD ICal file):
https://github.com/grafana/oncall/issues/1283.
This PR will allow to select the mode of schedule migration via
`SCHEDULE_MIGRATION_MODE_WEB` env variable (`ical` or `web`). Due to
differences in the scheduling systems of PD and OnCall, it's not always
possible to migrate shifts automatically (migration plan will show any
schedules and layers that can't be migrated).
PD rotations that will be possible to migrate:
- Any rotation without restrictions ("restriction" is a PD term for
describing active periods for rotation)
- Daily rotations with daily restrictions
- Weekly rotations with weekly restrictions
- Some weekly rotations with daily restrictions
- Some daily rotations with weekly restrictions
There will be a separate PR to update the
[instruction](https://github.com/grafana/oncall/tree/dev/tools/pagerduty-migrator#readme)
since this one is pretty huge already.
# What this PR does
Currently PD migrator can fail with HTTP 400 error when dealing with PD
resource names like " Schedule" (note the extra space). This PR makes
sure that PD migrator script can handle such cases.
# What this PR does
Fix case sensitivity issues for PD migrator when using MySQL
`utf8mb4_unicode_ci` collation.
This fixes a bug when the migrator tries to create a resource but fails
to do so because there is already a resource with the same name but
different capitalisation (e.g. migrating PD schedule with name "Test"
and there's already a schedule with name "test" in OnCall).
## Checklist
- [x] Tests updated
* tolerate ONCALL_API_URL without trailing slash
* tolerate ONCALL_API_URL without trailing slash
* show vendor name if integration type is not supported
* isort
* black