Commit graph

1120 commits

Author SHA1 Message Date
Joey Orlando
6e5cb4e8a7
[UI] fix eslint/prettier warnings (#678)
* UI spring cleaning

- fix ~570 outstanding eslint warnings
- make eslint force user to correct warnings
- remove .css files that are not referenced
- remove dummy.tsx as it is not consumed anywhere
- remove a few functions that were "dead code" (ie. not consumed anywhere)
- remove commented out blocks of code that had no explanatory comments surrounding them

* add prettier to pre-commit configuration

* change ignoreRestSiblings to true

we have a few spots in the codebase where we destructure
an object key and then use something like ...restProps
setting this to true allows that

* upgrade from eslint 7.21.0 to 8.25.0
- add @grafana/eslint-config to dev dependencies and pre-commit eslint deps
- add @grafana/eslint-config peer dependencies to package.json

* fix remaining outstanding prettier warnings

* enable noUnusedLocals and noUnusedParameters and fix errors related to this

* make pre-commit complain about eslint warnings

* import from moment-timezone instead of moment

* fix react/display-name eslint warning

* add eslint-plugin-react-hooks to dev deps

this is a peer dependency from @grafana/eslint-config

* turn off react/prop-types

* temporarily turn off react-hooks/exhaustive-deps

add note that it will be turned back on and fixed in next PR

* fix unused import errors after rebase to dev

* fix more new prettier errors

* turn react/no-unescaped-entities eslint rule off

* address PR comment about useReducer

* remove includeTemplateGroup from src/components/AlertTemplates/AlertTemplatesForm.helper.tsx

* update arg typing for refreshPageError

* update handleSyncException typing

* fix strict equality in containers/IntegrationSettings/parts/Autoresolve.tsx

* enhance typing in components/AlertTemplates/AlertTemplatesForm.tsx

* revert small change per Maxim's comment
2022-10-24 20:27:03 +08:00
Ildar Iskhakov
a60e14c3c6
Update CHANGELOG.md 2022-10-24 19:22:56 +08: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
Ildar Iskhakov
998bcbaa31
Merge pull request #692 from grafana/matiasb/689-slack-slash-command-related-issue
Handle multiple general team manual integrations available
2022-10-24 18:03:19 +08:00
Ildar Iskhakov
7cc01e0585
Merge pull request #670 from pluralsh/helm-smtp
Helm chart: add smtp settings to helm chart
2022-10-24 11:28:22 +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
2e73a54672
Merge pull request #683 from grafana/matiasb/681-ical-emails-case-insensitive
Update ical event/user email matching to be case-insensitive
2022-10-21 10:39:43 -03:00
Rares Mardare
610f6a5975
Merge pull request #680 from grafana/rares/ci-add-test-runner
ci frontend unit tests
2022-10-21 14:42:52 +03:00
Rares Mardare
73bd736768 Merge branch 'dev' into rares/ci-add-test-runner 2022-10-21 14:37:27 +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
f5896582ba
Merge pull request #675 from grafana/matiasb/list-schedules-query-rework
Rework schedule escalation chains/policies count as a subquery
2022-10-20 13:04:04 -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
Rares Mardare
c23172dbde remove build from test, add cd path 2022-10-20 17:42:09 +03:00
Rares Mardare
6c80e0baab ci frontend unit tests 2022-10-20 17:34:45 +03:00
Rares Mardare
b9864a821e
Merge pull request #645 from grafana/rares/testing-library
Jest test runner
2022-10-20 17:03:22 +03:00
Ildar Iskhakov
82d4746fd3
Merge pull request #665 from alfrunes/helm-fix-slack
fix(helm): Update the Slack helm values and environment variables
2022-10-20 13:41:58 +08:00
Ildar Iskhakov
2a9bcb4f7e
Merge pull request #669 from grafana/iskhakov/upgrade-helm
Bump oncall backend version
2022-10-20 13:40:08 +08: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
Michael Derynck
5d20c60895
Add step to check docker build (#673)
* Add step to check docker build
2022-10-19 17:08:37 +02:00
David van der Spek
8eed99865a
fix using secret for smtp 2022-10-19 15:01:49 +02:00
DavidSpek
e8b34a895b fix missing env vars
Signed-off-by: DavidSpek <vanderspek.david@gmail.com>
2022-10-19 14:40:44 +02:00
DavidSpek
7ea9f3e7f8 add smtp settings to helm chart
Signed-off-by: DavidSpek <vanderspek.david@gmail.com>
2022-10-19 14:19:22 +02:00
Ildar Iskhakov
8c7912c344 Bump oncall backend version 2022-10-19 19:39:11 +08:00
Vadim Stepanov
427c6c95c5
Edit docs for PagerDuty migrator scripts (#662)
* add docs on add_users_pagerduty_to_grafana.py

* spelling
2022-10-19 12:33:59 +01: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
Alf-Rune Siqveland
d48582d517
fix(helm): Update the Slack helm values and environment variables
The former helm values apiToken and apiTokenCommon were outdated/unused
by the application.

Signed-off-by: Alf-Rune Siqveland <alf.rune@northern.tech>
2022-10-19 13:00:34 +02: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
Vadim Stepanov
b9c543b0e8
PagerDuty migrator minor improvements (#659)
* tolerate ONCALL_API_URL without trailing slash

* tolerate ONCALL_API_URL without trailing slash

* show vendor name if integration type is not supported

* isort

* black
2022-10-18 15:32:07 +01: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
Ildar Iskhakov
e94fee1e25
Merge pull request #623 from grafana/disable-autorestarts
Allow disabling autorestarts in helm deployment
2022-10-18 09:42:05 +08:00
Ildar Iskhakov
161f012847
Merge pull request #655 from purwandi/dev
[helm] change telegram webhook host
2022-10-18 09:41:08 +08:00
Matias Bordese
0e79adfb60
Merge pull request #658 from grafana/matiasb/add-developer-makefile-notes
Add details about Makefile to DEVELOPER.md
2022-10-17 11:20:57 -03:00
Matias Bordese
8fb8adb315 Add details about Makefile to DEVELOPER.md 2022-10-17 10:45:49 -03:00
Matias Bordese
db5c34f3b7
Merge pull request #630 from grafana/matiasb/adding-makefile
Add simple Makefile
2022-10-17 09:31:43 -03:00
purwandi
712b820eff
change telegram webhook host 2022-10-16 15:15:38 +07:00
Michael Derynck
c731b9b113 Catch exception for parsing regex during channel filtering 2022-10-13 18:34:04 -06:00
Michael Derynck
5f5f427c9f Add middleware to catch exception for missing integration, reduce spamminess of logs 2022-10-13 17:18:22 -06:00
Michael Derynck
80abd8b8e5
Merge pull request #647 from grafana/mderynck/add-pull-request-template
Add simple pull request template
2022-10-13 15:43:04 -06:00
Maxim Mordasov
680e11bb64
Merge pull request #617 from grafana/add-settings-button
New schedules 2nd bunch of fixes
2022-10-13 15:32:24 +01:00
Ildar Iskhakov
1155bc3f00
Update README.md 2022-10-13 21:41:42 +08:00
Ildar Iskhakov
a2529bbb78
Update README.md 2022-10-13 21:40:56 +08:00
Maxim Mordasov
f044731e2f
Merge pull request #648 from grafana/rares/fix-avatar
Rares/fix avatar
2022-10-13 14:30:59 +01:00
Rares Mardare
a5147a0215 package fix 2022-10-13 16:04:03 +03:00
Rares Mardare
d37779e3b0 update 2022-10-13 15:05:36 +03:00
Rares Mardare
cecfcb1d56 avatar fix 2022-10-13 15:03:27 +03:00
Maxim
b4a311e6ed fix props 2022-10-13 12:30:01 +01:00