Commit graph

108 commits

Author SHA1 Message Date
Pēteris Caune
b2c5e91c70
Implement legacy -> canonical timezone conversion
There are three related changes:

* Removed legacy timezones from hc.lib.tz.all_timezones
* Added data migration to update existing Check.tz values
* For backwards compatibility, added code to automatically
  replace a legacy timezone with a canonical timezone when a
  legacy timezone is passed to an API call

I used the timezone mapping on
https://en.wikipedia.org/wiki/List_of_tz_database_time_zones
2024-06-14 12:55:57 +03:00
Pēteris Caune
c5bd666faf
Add data migration to update timezone "Europe/Kiev" to "Europe/Kyiv" 2024-06-13 15:03:51 +03:00
Pēteris Caune
26a57343b1
Add a data migration to fill null api_notification.code values
Using model's default didn't quite work, as Django tried to use
the same UUID for all rows.
2024-05-17 10:43:46 +03:00
Pēteris Caune
d486d2db14
Add uniqueness constraint to api_notification.code
This is primarily to make notification lookups by code efficient.
We look up notifications by code in hc.api.views.boundces.

This field has a default value (uuid.uuid4), so any null values
will be filled with random UUIDs during migration.
2024-05-17 10:30:01 +03:00
Pēteris Caune
1322bb1123
Add support for per-check status badges
Fixes: #853
2024-02-27 12:55:51 +02:00
Michael Boateng
6bfd9c901c
Make grace time editable when job is created (#953)
Fixes: #945
2024-02-08 15:34:52 +02:00
Pēteris Caune
fa25453734
Add migration for the Group integration 2023-11-22 10:16:27 +02:00
Pēteris Caune
343e55bd4f
Improve type hints 2023-10-25 18:12:12 +03:00
Pēteris Caune
aa541e760b
Add Channel.opsgenie property
It replaces:

* Channel.opsgenie_key
* Channel.opsgenie_region

Also, add data migration to normalize Opsgenie channel values
to always be JSON maps.
2023-09-11 16:44:38 +03:00
Pēteris Caune
4147bd951d
Make Channel.disabled non-nullable 2023-08-29 16:29:29 +03:00
Pēteris Caune
58cc623377
Format migration files with black 2023-07-12 10:11:07 +03:00
Pēteris Caune
368e76016d
Add Channel.last_notify_duration, use in sendalerts for prioritization 2023-07-07 16:40:23 +03:00
Pēteris Caune
34530e0e91
Add Profile.over_limit_date DB field 2023-06-16 16:28:03 +03:00
Pēteris Caune
1fd343a820
Remove usages of django.utils.timezone.utc which is deprecated 2023-05-04 10:56:19 +03:00
Pēteris Caune
a9b084ec9a
Add "Start Keyword" filtering for inbound emails
Fixes: #716
2023-01-16 13:19:35 +02:00
Pēteris Caune
7458770b41
Improve alerting logic when run IDs are used
* Add Check.last_start_rid field
* Fill Check.last_start_rid on every start event
* Clear Check.last_start on every "fail" event
* Clear Check.last_start on success event if either case is true:
 - the event's rid matches Check.last_start_rid
 - the event does not specify rid

In human terms, the alerting logic will be: we track the
execution time of the most recent "start" event only. It would
take a major redesign to track the execution time of all
concurrent "start" events and send alerts when *any* of them
overshoots the time budget. So, whenever we see a "start" event,
the timer resets.

Example:

* 00:00 client sends start signal with rid=A, timer starts
* 00:10 client sends start signal with rid=B, timer resets
* 00:20 client sends success signal with rid=A, timer
  does not reset because rid A does not match the rid seen in
  the most recent start signal (it was B)
* 00:30 the grace time runs out, the check's status shows
  as started + failed

At this point the check can be reset to a healthy state in 3
different ways:

* send a success signal with rid=B
* send a failure signal with any rid value or without it
* send a success signal without a rid value
2022-11-09 19:01:22 +02:00
seidnerj
b6027fa126
Added support for a "run id" parameter (#722)
Add support for specifying a run ID via a "rid" query parameter

cc: #461
2022-11-08 11:34:26 +02:00
seidnerj
c82c1a3a4a
Added duration to ping details (#720)
* Added duration to ping details. This is useful on a device with a small screen, since the duration cannot be seen in the main view so now one can see it in the ping's details.
* Changed terms across the board from "delta" to "duration"
* timedelta is now consistently imported as "td" across the entire project (even in Django generated migration files)
2022-11-01 09:18:34 +02:00
Pēteris Caune
4766aade95
Fix migrations
When adding "NOT NULL" on multiple columns at once, Django
throws errors:

    django.db.utils.OperationalError:
    cannot ALTER TABLE "api_check" because it has
    pending trigger events

A workaround is to modify columns one by one in
separate migrations.
2022-07-13 12:24:47 +03:00
Pēteris Caune
ae4ee37053
Add "NOT NULL" constraints on the new api_check fields
cc: #653
2022-07-13 12:02:58 +03:00
Pēteris Caune
cc32af6127
Remove api_check.subject and api_check.subject_fail fields
cc: #653
2022-07-13 11:40:35 +03:00
Pēteris Caune
003d35d431
Add "Filter by keywords in the message body" feature
cc: #653
2022-07-12 15:46:15 +03:00
Pēteris Caune
03dea07ae2
Remove obsolete field: Check.last_ping_was_fail 2022-05-31 15:13:00 +03:00
Pēteris Caune
05bb80130b
Add support for storing ping bodies in S3-compatible object storage
This is an initial, minimal implementation. It is currently
missing: error handling, timeouts for S3 operations, documentation.

cc: #609
2022-02-28 11:51:04 +02:00
Pēteris Caune
5ecd625c0b
Add Ping.body_raw field for storing body as bytes 2022-02-25 16:50:54 +02:00
Pēteris Caune
7317adc7f7
Refactor transport classes, add Channel.disabled field
- Refactor transport classes to raise exceptions
  on delivery problems, instead of returning error
  message as string. Exceptions can carry extra meta
  information (see TransportError.permanent field, see
  MigrationRequiredError subclass). I considered attaching
  the extra information to strings by subclassing str, but
  using exceptions felt cleaner and less hacky.

- Add Channel.disabled field, for disabling integrations
  on permanent errors. For example, if Slack returns
  HTTP 404, we will now mark the integration as disabled
  and will not make requests to that Slack endpoint again.
2022-01-05 09:46:39 +02:00
Pēteris Caune
6bb0c77934
Replace backfillchannels with a data migration 2021-10-21 12:35:29 +03:00
Pēteris Caune
33fb4a36ca
Add Channel.last_notify and a command to backfill it 2021-10-21 10:56:03 +03:00
Pēteris Caune
5b9008e321
Implement alternative ping URLs, WIP 2021-09-09 09:32:10 +03:00
Pēteris Caune
855d188981
Add support for "... is UP" SMS notifications
Fixes: #512
2021-05-21 12:57:23 +03:00
Pēteris Caune
64f2e86051
Increase "Success / Failure Keywords" field lengths to 200 2021-05-06 11:00:36 +03:00
Pēteris Caune
617bd92434
Add Ping.exitstatus field, store received exit status values in db
Fixes #455
2020-11-29 12:12:44 +02:00
Pēteris Caune
750b96c374
Use Django 3.1 2020-08-05 13:11:39 +03:00
Pēteris Caune
8c13457037
Use separate counters for SMS and phone calls. 2020-08-03 17:52:09 +03:00
Pēteris Caune
0d03e3f00b
Add "Failure Keyword" filtering for inbound emails (cc: #396) 2020-07-21 14:57:48 +03:00
Pēteris Caune
3a00c0d2aa
Sending a test notification updates Channel.last_error. Fixes #391 2020-07-01 14:03:11 +03:00
Pēteris Caune
3eebd8968d
Added "When paused, ignore pings" option in the Filtering Rules dialog (#369) 2020-06-02 10:54:16 +03:00
Pēteris Caune
f42b2b144a
New feature: Project Settings > Transfer Ownership (WIP, missing tests) 2020-04-12 14:46:12 +03:00
Pēteris Caune
77033760f9
Make sure Check.last_ping and Ping.created timestamps match exactly 2020-01-17 14:30:32 +02:00
Pēteris Caune
58a118c494
Make Ping.body size limit configurable. Fixes #301 2020-01-17 12:44:39 +02:00
Pēteris Caune
4ee2646539
Show a red "!" in project's top navigation if any integration is not working 2020-01-03 13:15:24 +02:00
Pēteris Caune
3f19181028
"Filtering Rules" dialog, an option to require HTTP POST. Fixes #297 2019-11-27 16:33:36 +02:00
Pēteris Caune
f74860bc0c
Add Profile.last_active_date field for more accurate inactive user detection 2019-11-19 16:29:38 +02:00
Pēteris Caune
0d924f4627
Add the "Last Duration" field in the "My Checks" page. Add "last_duration" attribute to the Check API resource. Fixes #257 2019-09-03 13:46:41 +03:00
Pēteris Caune
033d0ab197
Partial indexes for api_check.alert_after and api_flip.processed fields. 2019-07-20 16:58:41 +03:00
Pēteris Caune
9dea24e937
A data migration to convert webhook values to the most recent format. 2019-05-30 00:26:30 +03:00
Pēteris Caune
cdfc9840a7
Source formatted with Black 2019-05-15 14:27:50 +03:00
Pēteris Caune
aaa3b2748e
Rate limiting for the "Log In" emails 2019-04-25 21:28:40 +03:00
Michal Bryc
9b4c4482cb Always use "Pager Team" and use more descriptive tagline 2019-03-15 16:23:37 -07:00
Michal Bryc
073bcb1f6f Add migration (autogenerated via manage.py makemigrations) 2019-03-14 11:03:52 -07:00