oncall-engine/engine/apps/schedules/tests
Vadim Stepanov a936c8c7fe
Improve schedule quality feature (#1602)
# What this PR does

Before:

<img width="281" alt="Screenshot 2023-03-23 at 16 56 42"
src="https://user-images.githubusercontent.com/20116910/227279464-c883ec05-a964-4360-bda2-3443409ca90a.png">

After:

<img width="338" alt="Screenshot 2023-03-23 at 16 57 41"
src="https://user-images.githubusercontent.com/20116910/227279476-468bffba-922a-45ea-b400-5f34d6bf0534.png">


- Add scores for overloaded users, e.g. `(+25% avg)` which means the
user is scheduled to be on-call 25% more than average for given
schedule.
- Add score for gaps, e.g. `Schedule has gaps (29% not covered)` which
means 29% of time no one is scheduled to be on-call.
- Make things easier to understand when there are gaps in the schedule,
add `(see overloaded users)` text.
- Consider events for next 52 weeks (~1 year) instead of 90 days (~3
months), so the quality report is more accurate. Also treat any balance
quality >95% as perfectly balanced. These two changes (period change and
adding 95% threshold) should help eliminate false positives for _most_
schedules.
- Modify backend & frontend so the backend returns all necessary user
information to render without using the user store.
- Move quality report generation to `OnCallSchedule` model, add more
tests.

## Which issue(s) this PR fixes
Related to https://github.com/grafana/oncall/issues/1552

## Checklist

- [x] Tests updated
- [x] `CHANGELOG.md` updated
(public docs will be added in a separate PR)
2023-03-27 11:03:16 +00:00
..
calendars Make emails case-insensitive for ICal schedules (#1297) 2023-02-06 12:11:13 +00:00
__init__.py World, meet OnCall! 2022-06-03 08:09:47 -06:00
conftest.py World, meet OnCall! 2022-06-03 08:09:47 -06:00
factories.py Initial web schedule model and serializers. Add override shift type. 2022-07-05 12:41:55 -03:00
test_amixr_users_in_ical.py World, meet OnCall! 2022-06-03 08:09:47 -06:00
test_custom_on_call_shift.py Update override delete-related updates (#1599) 2023-03-23 15:45:27 +00:00
test_ical_proxy.py Add multiple ical all-day event for testing 2022-11-03 14:36:42 -03:00
test_ical_utils.py Do not include event repetitions terminated before start (until rrule) 2022-11-30 08:56:19 -03:00
test_on_call_schedule.py Add support for web overrides to Terraform schedules (#1222) 2023-03-10 16:21:50 +00:00
test_quality_score.py Improve schedule quality feature (#1602) 2023-03-27 11:03:16 +00:00
test_tasks_refresh_ical_files.py Matiasb/fix task refresh ical when empty value (#1401) 2023-02-24 21:16:09 +00:00