oncall-engine/engine/apps/api
Joey Orlando eb0f465970
add get_cached_oncall_users_for_multiple_schedules method + add DELETE /alertgroups/<id> internal API endpoint (#3280)
# What this PR does

This PR:
- adds a new method
`apps.schedules.ical_utils.get_cached_oncall_users_for_multiple_schedules`.
In short this method basically adds a layer of caching on top of
`apps.schedules.ical_utils.get_oncall_users_for_multiple_schedules`. We
store one cache value for each schedule. Cache results are stored for 15
minutes. To me this feels like a good balance between improving
performance + returning stale results. Cache values are stored as:
  - key = `f"schedule_{schedule.public_primary_key}_oncall_users"`
- value = `[user.public_primary_key for user in
schedule.currently_oncall_users]`
- adds a `DELETE /alertgroups/<id>` internal API endpoint (needed by
Grafana Incident for the Add Responders integration)
- updates the `is_currently_oncall` query parameter for the `GET /users`
internal API endpoint to return ALL users when the query param value `==
"all"`

## Which issue(s) this PR fixes

https://github.com/grafana/oncall-private/issues/2264

## Checklist

- [x] Unit, integration, and e2e (if applicable) tests updated
- [x] Documentation added (or `pr:no public docs` PR label added if not
required)
- [x] `CHANGELOG.md` updated (or `pr:no changelog` PR label added if not
required)
2023-11-06 15:30:32 -05:00
..
serializers Improve performance of GET /users and GET /teams endpoints used by add responders popup (#3241) 2023-11-03 12:40:54 -04:00
tests add get_cached_oncall_users_for_multiple_schedules method + add DELETE /alertgroups/<id> internal API endpoint (#3280) 2023-11-06 15:30:32 -05:00
throttlers Fix warnings when running backend tests (#2079) 2023-06-06 18:38:00 +00:00
views add get_cached_oncall_users_for_multiple_schedules method + add DELETE /alertgroups/<id> internal API endpoint (#3280) 2023-11-06 15:30:32 -05:00
__init__.py World, meet OnCall! 2022-06-03 08:09:47 -06:00
errors.py Fix backend for resolution notes via mobile app (#2117) 2023-06-07 12:19:16 +00:00
permissions.py Permissions for labels (#3173) 2023-10-23 11:03:51 +00:00
urls.py Alert group labels filter (#3238) 2023-11-06 10:31:12 +00:00