oncall-engine/engine/apps/api/views
Ildar Iskhakov 784b7e5344
Add latest alert to public api alert groups endpoint (#5059)
# What this PR does

Added last alert information 
and optimized the API call so it makes 10x less queries by:
* prefetching chatops messages (based on @vadimkerr 's
https://github.com/grafana/oncall/pull/4738)
* using `enrich` from private api

Previously: 
<img width="1102" alt="Screenshot 2024-09-24 at 4 47 00 PM"
src="https://github.com/user-attachments/assets/84edb78e-257a-49cd-bc94-083dd8d043d7">
Now:
<img width="1066" alt="Screenshot 2024-09-24 at 4 44 56 PM"
src="https://github.com/user-attachments/assets/e7dfcc40-dce6-4a0d-9677-910aab2b4f17">



## Which issue(s) this PR closes

Related to [issue link here]

<!--
*Note*: If you want the issue to be auto-closed once the PR is merged,
change "Related to" to "Closes" in the line above.
If you have more than one GitHub issue that this PR closes, be sure to
preface
each issue link with a [closing
keyword](https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/using-keywords-in-issues-and-pull-requests#linking-a-pull-request-to-an-issue).
This ensures that the issue(s) are auto-closed once the PR has been
merged.
-->

## Checklist

- [ ] Unit, integration, and e2e (if applicable) tests updated
- [ ] Documentation added (or `pr:no public docs` PR label added if not
required)
- [ ] Added the relevant release notes label (see labels prefixed w/
`release:`). These labels dictate how your PR will
    show up in the autogenerated release notes.

---------

Co-authored-by: Vadim Stepanov <vadimkerr@gmail.com>
2024-10-02 17:09:50 +00:00
..
__init__.py World, meet OnCall! 2022-06-03 08:09:47 -06:00
alert_group.py Add latest alert to public api alert groups endpoint (#5059) 2024-10-02 17:09:50 +00:00
alert_group_table_settings.py Google OAuth2 flow + fetch Google Calendar OOO events (#4067) 2024-04-02 14:59:03 -04:00
alert_receive_channel.py Address deprecation warnings in tests (#4681) 2024-08-13 20:51:18 +00:00
alert_receive_channel_template.py Support alert routing based on labels (#3778) 2024-01-30 13:07:19 -05:00
alerts.py Add alert detail view (#385) 2022-08-19 14:03:07 +05:00
auth.py Prepare OnCall for Unified Slack App (#4232) 2024-06-03 09:07:10 +00:00
channel_filter.py Support alert routing based on labels (#3778) 2024-01-30 13:07:19 -05:00
direct_paging.py add POST /escalation public API endpoint + add public API docs for teams/organization endpoints (#4815) 2024-08-15 18:31:35 +00:00
escalation_chain.py Make it clear alert groups can't be searched (#4713) 2024-07-22 10:30:28 +00:00
escalation_policy.py Add declare incident step and model (#5047) 2024-10-02 13:38:33 +00:00
features.py adjust to unified slack (#4776) 2024-08-08 14:16:19 +00:00
integration_heartbeat.py Add reset button to disable integration heartbeat (#3959) 2024-03-04 19:20:00 +00:00
labels.py Support prescribed labels (#3848) 2024-02-20 14:42:51 +08:00
live_setting.py Support alert routing based on labels (#3778) 2024-01-30 13:07:19 -05:00
on_call_shifts.py Support alert routing based on labels (#3778) 2024-01-30 13:07:19 -05:00
organization.py Add endpoint for organization config checks (#4204) 2024-04-11 14:51:56 +00:00
preview_template_options.py Fix of templates api behaviour for public and private api (#1408) 2023-03-01 16:32:15 +08:00
public_api_tokens.py Add RBAC Support (#777) 2022-11-29 09:41:56 +01:00
resolution_note.py Support alert routing based on labels (#3778) 2024-01-30 13:07:19 -05:00
route_regex_debugger.py remove references to AlertGroup.is_archived and AlertGroup.unarchived_objects (#2524) 2023-07-18 11:48:34 +00:00
schedule.py Speed up internal api endpoints (#4830) 2024-08-15 14:20:55 +00:00
shift_swap.py Address deprecation warnings in tests (#4681) 2024-08-13 20:51:18 +00:00
slack_channel.py Support alert routing based on labels (#3778) 2024-01-30 13:07:19 -05:00
slack_team_settings.py Handle None role when syncing users from Grafana (#3147) 2023-10-19 17:39:08 +00:00
team.py Support alert routing based on labels (#3778) 2024-01-30 13:07:19 -05:00
telegram_channels.py Support alert routing based on labels (#3778) 2024-01-30 13:07:19 -05:00
user.py address Google OAuth2 issues where user didn't grant us the https://www.googleapis.com/auth/calendar.events.readonly scope (#4802) 2024-08-14 18:02:34 -04:00
user_group.py Add endpoint to get a single user group (#4395) 2024-05-24 20:26:28 +00:00
user_notification_policy.py don't force create default user notification policies (#4608) 2024-07-05 15:08:17 -04:00
webhooks.py Add manual trigger support for webhooks (#4934) 2024-09-09 12:17:23 +00:00