Commit graph

429 commits

Author SHA1 Message Date
Maxim Mordasov
387b334d2a
Merge pull request #720 from grafana/matiasb/daily-shifts-by-day
Enable daily/by-day shifts option for web schedules
2022-11-04 14:23:09 +00:00
Vadim Stepanov
b7043277a4
Specify queue for apps.email.tasks.notify_user_async 2022-11-04 14:20:26 +00:00
Ildar Iskhakov
6d28fdf69a
Bump django version and alpine version (#778) 2022-11-04 17:34:49 +08:00
Matias Bordese
4f6734dcf5 Update daily/by-day to user group id when generating weekly shifts 2022-11-03 15:26:46 -03:00
Matias Bordese
b1a664df3b
Merge pull request #742 from grafana/matiasb/web-schedules-all-day-as-datetime
Update web schedule events to return all-day start/end as datetimes
2022-11-03 14:54:28 -03:00
Matias Bordese
2377d74043 Add multiple ical all-day event for testing 2022-11-03 14:36:42 -03:00
Vadim Stepanov
e2456315af
Allow no-auth SMTP connection for email notifications (#759)
* DEFAULT_FROM_EMAIL -> EMAIL_FROM

* add EMAIL_FROM live setting

* EMAIL_FROM -> EMAIL_FROM_ADDRESS

* merge dev

* add test for get_from_email

* allow live settings to be null on internal API

* remove redundant tests
2022-11-03 16:18:37 +00:00
Vadim Stepanov
e9df5ab5c9
Send emails from <slug>.grafana.net for cloud (#766) 2022-11-03 14:45:13 +00:00
Michael Derynck
e52d738ec3
Merge pull request #763 from grafana/add-region-to-organization-migration-only
Migration for regions and organizations
2022-11-03 08:35:13 -06:00
Matias Bordese
e103ec9152
Fix all-day end as datetime value
Co-authored-by: Vadim Stepanov <vadimkerr@gmail.com>
2022-11-03 11:21:42 -03:00
Michael Derynck
5b29ab92ea Migration for regions and organizations 2022-11-02 16:10:41 -06:00
Matias Bordese
3e2d52ad51 Update web schedule events to return all-day as datetimes 2022-11-02 16:12:37 -03:00
Matias Bordese
98b187acd9 Add support for daily/by-day and custom interval 2022-11-02 16:12:16 -03:00
Matias Bordese
4bc3ed17a8 Make interval check more explicit 2022-11-02 16:12:16 -03:00
Matias Bordese
241283959a Enable daily/by-day shifts option for web schedules 2022-11-02 16:12:16 -03:00
Michael Derynck
538e28e739 Check user attribute 2022-11-02 10:47:26 -06:00
Michael Derynck
e5c1db4b55 Merge branch 'dev' into mderynck/add-org-id-request-log 2022-11-02 10:38:50 -06:00
Michael Derynck
c2546460f3 Add user and org id to log to make troubleshooting easier 2022-11-02 10:36:12 -06:00
Matvey Kukuy
85d94d342e
Readme about how to add Integrations and Zabbix Integration (#653)
* Readme and zabbix

* Typos

* Linking
2022-11-02 22:58:47 +08:00
Vadim Stepanov
035584f17e
Enable email backend by default (#740)
* enable email backend by default, catch empty EMAIL_HOST

* fix tests

* fix tests

* fix tests
2022-11-01 13:48:36 +00:00
Ildar Iskhakov
001a760be7
Update manual_incident.py 2022-11-01 17:23:29 +08:00
Innokentii Konstantinov
4e8982cc81
Add management command to manually verify phone numbers (#743)
* Add cmd to manully verify phone numbers

* Rework verify_phone command
2022-11-01 16:38:04 +08:00
Matias Bordese
64570cc9fd Update schedules endpoint to filter by numeric type 2022-10-31 11:08:33 -03:00
Yulia Shanyrova
6b65fc7278 Merge branch 'dev' into 637-telegram-installation-redesign 2022-10-31 12:21:40 +01:00
Joey Orlando
5a4c3d6d77
remove POST /api/internal/v1/custom_buttons/{id}/action (#734)
* remove POST /api/internal/v1/custom_buttons/{id}/action
2022-10-28 10:44:37 +02:00
Joey Orlando
7974f32239
Revert "Revert "Remove migration-tool Django app and UI page (#708)"" 2022-10-27 15:42:21 +02:00
Ildar Iskhakov
00315e5c2d
Merge branch 'main' into dev 2022-10-27 21:28:44 +08:00
Joey Orlando
627afe37e1
Remove references to Alert.migrator_lock attribute
This commit patches issue related to #708.

#708 forgot to remove attributes on models outside of the migration_tool django app that were referencing model attributes from migration_tool.

The only attribute that referenced a field in migration_tool was migrator_lock on the Alert model. This commit removes any references to that attribute.
2022-10-27 13:52:03 +02:00
Joey Orlando
56c6a25dfb Revert "Remove migration-tool Django app and UI page (#708)"
This reverts commit 94934bf3e4.
2022-10-27 12:12:57 +02:00
Joey Orlando
94934bf3e4
Remove migration-tool Django app and UI page (#708)
* remove migration_tool app (#687)
* remove migration-tool page (#699)
2022-10-26 15:47:08 +02:00
Matias Bordese
2c8c66a8c8 Not previously handled backends (eg. mobile) could end here without a messaging backend 2022-10-26 09:30:13 -03:00
Michael Derynck
a37df38930 Merge branch 'dev' into mderynck/add-check-notify-group-task 2022-10-25 12:50:12 -06:00
Matias Bordese
8e2bcf5274 Fix failing test related to users org caching 2022-10-25 14:27:27 -03:00
Michael Derynck
ef097fcdd9 Add check for usergroup to notify group task 2022-10-25 10:23:19 -06:00
Matias Bordese
565cb84bb1 Add optional type filter to internal schedules endpoint 2022-10-25 12:51:06 -03:00
Innokentii Konstantinov
2c6a27154f
Support mutliregion telegram (#676)
* Support mutliregion telegram

* Fix test_personal_message

* Fix tg verification code tests

* Simplify /start cmd handler

* Comment about link with org_id in tg msg
2022-10-25 14:53:07 +08:00
Ben Sully
6ef687061c
Remove 'emoji' property from Slack markdown blocks in resolution notes (#702)
I'm seeing this error in the logs:

> invalid additional property: emoji [json-pointer:/blocks/0/text]

It looks like the 'emoji' argument is not supported when type: mrkdwn.
This PR removes that property in the same place that the change
to mrkdwn was made - see [this
PR](https://github.com/grafana/oncall/pull/646).
2022-10-24 16:15:04 +01:00
Ildar Iskhakov
1bf75d601d
Merge pull request #646 from grafana/slack-resolution-note-formatting
Use markdown formatting for web based resolution notes
2022-10-24 19:22:12 +08:00
Matias Bordese
eb32fa7ba0 Handle scenario when multiple general team manual integrations are available 2022-10-21 14:23:45 -03:00
Matias Bordese
a4830c74b7 Update ical event/user email matching to be case-insensitive 2022-10-20 16:12:41 -03:00
Matias Bordese
6439752949
Rewrite fallback condition for num escalation chains
Co-authored-by: Vadim Stepanov <vadimkerr@gmail.com>
2022-10-20 12:57:59 -03:00
Matias Bordese
3d171f20f7 Defer large unused queryset fields when listing schedules 2022-10-19 17:07:06 -03:00
Matias Bordese
e4a7a5a23d Rework schedule escalation chains/policies count as a subquery 2022-10-19 17:07:06 -03:00
Yulia Shanyrova
fbc672b2d1 Merge branch '318-slack-installation-ux' into 637-telegram-installation-redesign 2022-10-19 13:49:05 +02:00
Vadim Stepanov
e67d3519fe
Restore email notifications (#621)
* remove email verification related code

* remove email verification related code

* remove sendgrid callback

* remove sendgrid related code

* remove sendgrid related code

* rename sendgrid app to email

* remove email from built-in channels

* remove email from built-in channels

* remove email from built-in channels

* add email backend: https://github.com/grafana/oncall/pull/50

* add email templater

* add email templater

* convert md to html

* add email settings to live settings

* use task to send email, handle some exceptions to create logs

* remove ERROR_NOTIFICATION_MAIL_DELIVERY_FAILED usage

* add email limit logic

* fix tests

* add docs

* remove old email templates

* remove old email templates

* add template_fields to messaging backend

* add messaging backends templates to public api

* add comment for deprecated fields

* fix test

* fix tests

* disable email by default

* don't retry on SMTPException and TimeoutError

* add tests

* bring email back to public api docs

* return ERROR_NOTIFICATION_MAIL_LIMIT_EXCEEDED

* make template_fields tuple

* build_subject_and_title -> build_subject_and_message

* add one more comment about template deprecation

* use 8 as backend id

* add comment about gaierror and BadHeaderError

* add comment on importing in notify_user_async

* edit oss docs
2022-10-19 12:32:56 +01:00
Ben Sully
e36757b293
Allow non-JSON custom webhook templates, provided they render as valid JSON (#639)
* Allow non-JSON custom webhook templates, provided they render as valid JSON

Previously, both the provided template _and_ the rendered template had
to be valid JSON in order for validation to pass. This was unnecessarily
restrictive: really, only the rendered template needs to be valid JSON.
It also disallowed using templates such as:

    {
      "labels": {{ alert_payload.labels | tojson }}
    }

even though this would be valid JSON after rendering.

This commit relaxes the validation of custom webhook templates so that
they don't need to be valid JSON, provided that the rendered template
_is_ valid JSON. This is checked using a dummy dictionary of render
params, which use a constant string for the `alert_group_id` field
and a `defaultdict(dict)` for the `alert_payload` field. This should
permit templates like the one above, but still deny templates such as

    {
      "labels": {{ alert_payload.labels }}
    }

which would otherwise fail later if `labels` is not valid JSON.

This should resolve #638.

* Use defaultdict(str) instead of defaultdict(lambda: "")

* Add missing comment to resolution note validation code

* Update validation of resolution notes in public API, too

* Add extra test cases for JSON webhook templates endpoint of public API
2022-10-19 12:32:21 +01:00
Michael Derynck
8e48c441e8
Merge pull request #651 from grafana/mderynck/handle-channel-filter-exception
Catch exception for parsing regex during channel filtering
2022-10-18 09:43:08 -06:00
Michael Derynck
8ad593b36f
Merge pull request #650 from grafana/mderynck/suppress-integration-exception
Add middleware to catch exception for missing integration
2022-10-18 09:16:09 -06:00
Michael Derynck
4eb814798c Make return value explicit 2022-10-18 08:05:01 -06:00
David van der Spek
292849e782
fix relation already exists (#660)
Signed-off-by: DavidSpek <vanderspek.david@gmail.com>

Signed-off-by: DavidSpek <vanderspek.david@gmail.com>
2022-10-18 14:04:27 +01:00