oncall-engine/engine/apps
Joey Orlando aa0d4468db
Fix rounding issue with displayed time when sending "You're going oncall" push notification (#3872)
# Which issue(s) this PR fixes

So because of how we run the task that sends the "You're going oncall"
push notifications, there are sometimes rounding "errors" in the
displayed text of the push notification. For example, if you've
configured your mobile app to remind you 12h before your on-call shift
starts it sometimes might say:

> You're going oncall in 11 hours

This is because of the [background task being executed every
10mins](https://github.com/grafana/oncall/blob/dev/engine/settings/base.py#L545-L548)
and us continually checking if now is the appropriate time to send the
notification (we took this approach because we don't have any easy way
of emitting an event exactly when a shift starts.. yay ical).

This PR corrects that by rounding to the closest configuration value
that we allow.

## 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)
2024-02-09 15:31:34 -05:00
..
alerts make mobile app notification title and subtitle templatable (#3845) 2024-02-08 17:23:15 -05:00
api make mobile app notification title and subtitle templatable (#3845) 2024-02-08 17:23:15 -05: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 Add more logging to plugin sync and install (#3730) 2024-01-23 22:59:33 +00:00
base make mobile app notification title and subtitle templatable (#3845) 2024-02-08 17:23:15 -05:00
email Change email templating to not wrap user defined templates (#3862) 2024-02-09 19:03:25 +00:00
grafana_plugin Enable labels feature only if labels plugin is enabled (#3769) 2024-01-30 07:29:16 +00:00
heartbeat Improve OpenAPI schema coverage (#3629) 2024-01-12 15:11:22 +00:00
integrations add pytest-xdist to speed up backend tests (#3839) 2024-02-05 16:04:15 -05:00
labels Support alert routing based on labels (#3778) 2024-01-30 13:07:19 -05:00
metrics_exporter Add transaction on_commit before signals for alert group actions (#3731) 2024-01-31 15:54:50 -07:00
mobile_app Fix rounding issue with displayed time when sending "You're going oncall" push notification (#3872) 2024-02-09 15:31:34 -05: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 Add acknowledged/resolved by data to alert groups public API (#3833) 2024-02-05 11:02:55 -03:00
schedules Refactor gaps and empty shift checks (#3785) 2024-01-31 15:25:06 +01:00
slack Add permission checks for Slack paging and shift swaps actions (#3861) 2024-02-09 12:30:05 +00:00
social_auth Chatops api v3 (#3721) 2024-01-20 06:56:17 +00:00
telegram Handle ag telegram message does not exist (#3830) 2024-02-05 12:19:41 +00:00
twilioapp add missing db migrations + add additional backend db migration check to CI (#3234) 2023-10-31 16:00:55 -04:00
user_management Fix grafana_labels sync 2024-02-01 13:43:32 +08:00
webhooks patch occasional UnicodeEncodeError that occurs with outgoing webhooks (#3832) 2024-02-02 21:08:04 +00:00
zvonok Improve zvonok verification call (#3768) 2024-02-08 14:05:11 -05:00
__init__.py World, meet OnCall! 2022-06-03 08:09:47 -06:00