oncall-engine/engine/apps
Joey Orlando 3fd9a73a52
GCal autogenerated shift swap requests - don't recreate if one was previously created and deleted (#4281)
# What this PR does

Addresses two issues:
- addresses an internal feature request ([in
Slack](https://raintank-corp.slack.com/archives/C03KS498VGV/p1713550543916289?thread_ts=1713546008.831749&cid=C03KS498VGV))
to not have a new shift swap request auto-generated if one previously
was, but than the user decided to delete that SSR
- when disconnecting the GCal integration from your user, I've seen
cases where Google will return HTTP 400 as such ([example
logs](https://ops.grafana-ops.net/goto/8vX76pBSg?orgId=1)):
  ```
{'error': 'invalid_token', 'error_description': 'Token expired or
revoked'}
  ```
I can't seem to find detailed documentation on the revoke endpoint (`GET
https://accounts.google.com/o/oauth2/revoke?token=<token>`) to try and
better understand the possible `error` values.. but I think our best bet
here is to just continue forward w/
`user.finish_google_oauth2_disconnection_flow()` (which deletes the
`GoogleOAuth2User` associated with the user and sets
`user.google_calendar_settings = None`)

## 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] 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.
2024-04-25 18:16:42 +00:00
..
alerts Fix docs and UI for connecting Grafana Alerting from other stack (#4243) 2024-04-24 08:02:51 +00:00
api Fix docs and UI for connecting Grafana Alerting from other stack (#4243) 2024-04-24 08:02:51 +00:00
api_for_grafana_incident Add render_for_web information to alert group incident API (#3005) 2023-09-12 12:02:42 +00:00
auth_token Google OAuth2 flow + fetch Google Calendar OOO events (#4067) 2024-04-02 14:59:03 -04:00
base Add endpoint for organization config checks (#4204) 2024-04-11 14:51:56 +00:00
email Allow setting email app to use SSL instead of TLS (#3911) 2024-02-20 03:38:09 -05:00
google GCal autogenerated shift swap requests - don't recreate if one was previously created and deleted (#4281) 2024-04-25 18:16:42 +00:00
grafana_plugin Add scheduled task to start cleanup tasks (#3976) 2024-03-04 19:45:01 +00:00
heartbeat Improve OpenAPI schema coverage (#3629) 2024-01-12 15:11:22 +00:00
integrations Add test for caching deleted integration, fix test wrap methods (#4173) 2024-04-05 20:35:38 +00:00
labels Support prescribed labels (#3848) 2024-02-20 14:42:51 +08:00
metrics_exporter Update alert group state by backsync (#4089) 2024-03-27 12:37:01 +00:00
mobile_app Optimize GET /users internal api endpoint (#4168) 2024-04-11 14:49:47 +00:00
oss_installation Improve OpenAPI schema coverage (#3629) 2024-01-12 15:11:22 +00:00
phone_notifications Revert "upgrade to Python 3.12 (#3456)" and "bump uwsgi version to latest #3466" (#3483) 2023-12-01 09:56:26 -05:00
public_api Allow webhook modification by API for advanced webhook (#4175) 2024-04-23 19:18:12 +00:00
schedules Update cached schedule users to consider deleted users (#4246) 2024-04-23 11:40:02 +00:00
slack Add Slack deep link entry to alert group permalinks (#4205) 2024-04-12 13:25:48 +00:00
social_auth GCal autogenerated shift swap requests - don't recreate if one was previously created and deleted (#4281) 2024-04-25 18:16:42 +00:00
telegram Fix docs and UI for connecting Grafana Alerting from other stack (#4243) 2024-04-24 08:02:51 +00:00
twilioapp Update alert group state by backsync (#4089) 2024-03-27 12:37:01 +00:00
user_management Google Calendar Out of Office events - autogenerated shift swap requests (#4104) 2024-04-02 20:10:16 +00:00
webhooks Allow webhook modification by API for advanced webhook (#4175) 2024-04-23 19:18:12 +00:00
zvonok Update alert group state by backsync (#4089) 2024-03-27 12:37:01 +00:00
__init__.py World, meet OnCall! 2022-06-03 08:09:47 -06:00