oncall-engine/engine/apps
Vadim Stepanov 7a1f176cb5
Schedule score backend (#338)
This PR adds an endpoint returning a schedule quality score, overloaded
users and comments on the existing issues (e.g. balance issues or gaps).

## Limitations
- Since working hours editor is not implemented yet, there are only two
scores taken into account: balance score and a score representing the
ratio of time when someone is on-call to the whole time period.
- Time period is now set to be constant (90 days from today), so **in
some cases the results will be inaccurate** (when rotations don't align
with the time period)
- It only takes primary rotations into account (overrides are ignored)

## Usage
`GET /api/internal/v1/schedules/<pk>/quality?date=<TOMORROW_DATE>`

Note that `date` should be tomorrow date, because we can only be sure
about changing tomorrow's shifts (some of the shifts for current day
could be "deleted" but still show up in the UI).

## Example response
```json
{
  "total_score": 90,
  "comments": ["Schedule has no gaps", "Schedule is well-balanced, but still can be improved"],
  "overloaded_users": ["USSZ5WRH2CUA9", "U74XJZSSQGBIH"]
}
```

Issue: #118
2023-01-04 16:49:58 +00:00
..
alerts Improve handling of template exceptions during group data creation (#1068) 2023-01-03 12:30:59 -07:00
api Schedule score backend (#338) 2023-01-04 16:49:58 +00:00
api_for_grafana_incident World, meet OnCall! 2022-06-03 08:09:47 -06:00
auth_token Add RBAC Support (#777) 2022-11-29 09:41:56 +01:00
base Add RBAC Support (#777) 2022-11-29 09:41:56 +01:00
email Allow no-auth SMTP connection for email notifications (#759) 2022-11-03 16:18:37 +00:00
grafana_plugin remove is_rbac_permissions_enabled logic from check_gcom_permission function (#976) 2022-12-12 17:05:44 +01:00
heartbeat Insight logs (#348) 2022-08-24 12:04:44 +05:00
integrations 1.1.5.5 -> dev (#1060) 2023-01-03 11:57:16 +08:00
mobile_app modify push notification settings + use fcm-django library (#998) 2022-12-20 12:41:34 +01:00
oss_installation Add RBAC Support (#777) 2022-11-29 09:41:56 +01:00
public_api add permalinks.web attribute to alert group internal/public api response (#953) 2022-12-06 11:06:05 +01:00
schedules Schedule score backend (#338) 2023-01-04 16:49:58 +00:00
slack Catch DoesNotExist in post_slack_rate_limit_message (#1067) 2023-01-03 17:44:56 +00:00
social_auth Support of oncall-gw (#741) 2022-11-08 14:43:22 +08:00
telegram Don't render logs for too big telegram dm (#1051) 2022-12-29 13:22:15 +00:00
twilioapp Add simple check if using API key instead of AUTH token 2022-11-09 21:52:42 -07:00
user_management fix sync.. again (#978) 2022-12-12 18:48:26 +01:00
__init__.py World, meet OnCall! 2022-06-03 08:09:47 -06:00