Commit graph

1425 commits

Author SHA1 Message Date
Matias Bordese
19b5c6553c
Add is_from_connected_integration field to webhook model (#3951)
Related to https://github.com/grafana/oncall-private/issues/2541.
2024-02-23 15:57:57 +00:00
Matias Bordese
d2917373b7
Migrate webhooks integration_filter to use a m2m field instead (#3946)
Related to https://github.com/grafana/oncall-private/issues/2541
2024-02-23 11:55:44 +00:00
Matias Bordese
1a8e4fef40
Update OrderedModel.swap to retry on IntegrityError (#3940)
Related to https://github.com/grafana/oncall-private/issues/2386.

Issue seems related to [multiple concurrent Terraform-triggered
updates](https://ops.grafana-ops.net/explore?schemaVersion=1&panes=%7B%22j0s%22:%7B%22datasource%22:%22000000193%22,%22queries%22:%5B%7B%22refId%22:%22B%22,%22expr%22:%22%7Bcluster%3D%5C%22prod-eu-west-0%5C%22,%20namespace%3D%5C%22amixr-prod%5C%22%7D%20%7C%3D%20%5C%22logger%3Dinsight_logger%20tenant_id%3D735393%5C%22%20%7C%3D%20%5C%22resource_type%3Droute%5C%22%22,%22queryType%22:%22range%22,%22datasource%22:%7B%22type%22:%22loki%22,%22uid%22:%22000000193%22%7D,%22editorMode%22:%22code%22%7D%5D,%22range%22:%7B%22from%22:%221707813893526%22,%22to%22:%221707815856774%22%7D%7D%7D&orgId=1
) changing the route order to zero (and eventually succeeding)

Sample test run with the failing error:
```
========================================== short test summary info ===========================================
FAILED common/tests/test_ordered_model.py::test_ordered_model_swap_all_to_zero - assert not [DoesNotExist(), IntegrityError(1062, "Duplicate entry 'test-0' for key 'base_testorderedmodel...
======================================= 1 failed, 5 warnings in 34.39s =======================================
make: *** [Makefile:283: run-backend-test] Error 1
```
2024-02-22 20:51:05 +00:00
Vadim Stepanov
2b5554c079
Remove explicit request size limits (#3878)
# What this PR does

Remove explicit request size limits both for uwsgi & Django. After this
change, the effective request size limit will be 2.5MB as the default
Django value for
[DATA_UPLOAD_MAX_MEMORY_SIZE](https://docs.djangoproject.com/en/4.2/ref/settings/#data-upload-max-memory-size).

## 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-22 15:00:33 +00:00
Matias Bordese
c1b279aab8
Use pip-tools to handle Python deps (#3892)
[pip-tools](https://github.com/jazzband/pip-tools) helps making builds
deterministic, controlling deps (and indirect deps) upgrades (and
versions consistency) avoiding unexpected (and potentially breaking)
changes.

We keep our direct deps in `requirements.in` from which we generate the
`requirements.txt` (where *all* deps are pinned). We also constrain dev
(and enterprise) deps based on base requirements.

Check how to [update
deps](https://github.com/jazzband/pip-tools?tab=readme-ov-file#updating-requirements).
2024-02-20 17:44:15 +00:00
Karim Darwish
2a46e4ff84
Add parse_json template function (#3929) 2024-02-20 10:29:03 -05:00
Matias Bordese
d6467e9cb7
Add escalation step to notify all members from a team (#3908)
Based on https://github.com/grafana/oncall/pull/3477

---------

Co-authored-by: xssfox <xss@sprocketfox.io>
2024-02-20 10:02:23 -03:00
Dominik Broj
6da36b3c0b
Use autogenerated types for alert_receive_channels (#3851)
# What this PR does

- autogenerate new types exposed by backend, remove custom types that
duplicate autogenerated ones
- use autogenerated types for alert receive channels
- in alert_receive_channel model:
  - use autogenerate http client (`onCallApi`) for http requests
- extract methods that don't update state into
alert_receive_channel.helpers.ts and make them pure (they accept
AlertReceiveChannelStore as param) to avoid inconsistency and issues
with `this` binding
  - use `makeAutoObservable`
  - remove unneeded decorators
- rename update* methods to fetch* whenever such methods retrieve data
from backend with GET requests
- in other models use `@action.bound` for actions and arrow functions
for store methods that are not actions (in subsequent PRs we will apply
the same changes as in alert_receive_channel, this is just for now until
we do it)
- refactor http-client so that it shows global notification on http
errors automatically and provide the possibility to opt-out from it when
making a call
- improve type-safety of `GSelect`
- fix bug related to attaching alert group
(https://raintank-corp.slack.com/archives/C04JCU51NF8/p1707476487580579)

## Which issue(s) this PR fixes

https://github.com/grafana/oncall/issues/3331

## 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)

---------

Co-authored-by: Vadim Stepanov <vadimkerr@gmail.com>
2024-02-20 12:09:22 +00:00
Sean Wood
61a657b0cd
Allow setting email app to use SSL instead of TLS (#3911)
# What this PR does
Adds flexibility of the method of encryption in the SMTP email app. Some
email servers are configured to use port 465 (intrinsic TLS) which
requires `EMAIL_USE_SSL` instead of `EMAIL_USE_TLS`.

## Which issue(s) this PR fixes
Fixes https://github.com/grafana/oncall/issues/1044

## 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)

---------

Co-authored-by: Joey Orlando <joey.orlando@grafana.com>
Co-authored-by: Joey Orlando <joseph.t.orlando@gmail.com>
2024-02-20 03:38:09 -05:00
Innokentii Konstantinov
acd0c44c33
Support prescribed labels (#3848)
# What this PR does

**Cleanup label typing:**
1. LabelParam -> two separate types LabekKey and LabelValue 
2. LabelData -> renamed to LabelPair. 
3. LabelKeyData -> renamed to LabelOption
Data is not giving any info about what this type represents. 
4. Remove LabelsData and LabelsKeysData types. They are just list of
types listed above and with new naming it feels obsolete.
5. ValueData removed. LabelPair is used instead.
6. Rework AlertGroupCustomLabel to use LabelKey type for key to make
type system more consistent. Name model type AlertGroupCustomLabel**DB**
and api type AlertGroupCustomLabel**API** to clearly distinguish them.

**Split update_labels_cache into two tasks** update_label_option_cache
and update_label_pairs_cache.
Original task was expecting array of LabelsData (now it's LabelPair) OR
one LabelKeyData ( now it's LabelOption). I believe having one function
with two sp different argument types makes it more complicated for
understanding.


**Make OnCall backend support prescribed labels**. OnCall will sync and
store "prescribed" field for key and values, so Label dropdown able to
disable editing for certain labels.

## Which issue(s) this PR fixes

## Checklist

- [x] Unit, integration, and e2e (if applicable) tests updated
- [ ] 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)

---------

Co-authored-by: Maxim Mordasov <maxim.mordasov@grafana.com>
Co-authored-by: Yulya Artyukhina <Ferril.darkdiver@gmail.com>
2024-02-20 14:42:51 +08:00
Matias Bordese
0711484a50
Add status change trigger type to webhooks (#3920)
Related to https://github.com/grafana/oncall/issues/3395

This should help with upcoming planned integrations work.
2024-02-19 14:12:56 -03:00
Matias Bordese
12f55ac936
Fix user hidden fields tests (#3919) 2024-02-19 14:27:13 +00:00
Matias Bordese
4ace9780c5
Update user details internal API perms (#3900)
Related to https://github.com/grafana/oncall/issues/1820
Editor and Viewer roles have the user-settings:read permission, which
allows them to list users but with some of the data hidden. It makes
sense to allow the same thing for the detail endpoint, keeping the
viewable data restriction (fixing the referenced issue too).
2024-02-16 16:48:24 +00:00
Michael Derynck
617146f5ea
When team is removed do not delete webhooks belonging to it (#3873)
# What this PR does
When a team is deleted webhooks belonging to that team will be marked as
having no team instead of the webhook being deleted.

## Which issue(s) this PR fixes

## 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-15 17:53:55 +00:00
Yulya Artyukhina
445ac74088
Quick fix for labels error on labels cache update (#3899)
# What this PR does
Check response from labels repo before updating labels cache and update
cache only if there are no errors in the response.
## Which issue(s) this PR fixes
https://github.com/grafana/oncall-private/issues/2532
## 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-15 08:55:43 +00:00
Matias Bordese
adaab1c6ad
Check for permissions on Slack escalate command (#3891)
Related to https://github.com/grafana/oncall/issues/3109

Fixes issue from https://github.com/grafana/oncall/pull/3881 (problem
was that there is no organization set in the Slack request, making it
impossible to check for user permissions; check permission once an
organization is set in the form instead).
2024-02-14 19:02:09 +00:00
Michael Derynck
07916d0c71
Don't check chatops gateway link in OSS deployment (#3893)
# What this PR does
Prevents checking ability to connect instance with chatops gateway when
running in OSS deployment.

## Which issue(s) this PR fixes
#3834 

## 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-14 13:15:04 +00:00
Innokentii Konstantinov
9e1ab69b23
Handle 400 status codes from Chatops Proxy (#3886) 2024-02-13 14:36:49 +08:00
Michael Derynck
586a65a094
Don't html escape quotes when rendering (#3884)
# What this PR does
Disable escaping quotes for html in template results

![Screenshot from 2024-02-12
12-40-38](https://github.com/grafana/oncall/assets/28077050/221be1e9-1ced-48bf-9bbc-45fa8c9a4347)

Alert group 6 shows the new rendering vs group 5 which has the previous
incorrect rendering.

## Which issue(s) this PR fixes
#3864 

## 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-12 21:10:22 +00:00
Matias Bordese
5ecdc26b0a
Revert requiring permission on Slack direct paging (#3881)
Reverting part of https://github.com/grafana/oncall/pull/3861
2024-02-12 18:48:43 +00:00
Matias Bordese
0007fc69b7
Restrict integration name uniqueness per team (#3863)
Related to https://github.com/grafana/oncall/issues/3858

We still need to improve error messages in the UI, [to be
discussed](https://raintank-corp.slack.com/archives/C04JCU51NF8/p1707486122947369).
2024-02-12 11:40:08 +00:00
Matias Bordese
2a46152477
Include all upcoming shifts in upcoming shifts internal endpoint (#3871)
Related to https://github.com/grafana/oncall/issues/3859
2024-02-09 20:36:12 +00:00
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
Michael Derynck
aebd98b8f9
Change email templating to not wrap user defined templates (#3862)
# What this PR does
Change email notification templates to not wrap the user template in a
fixed body. Info has been moved to a footer. The title now also matches
the template from the user exactly and will only get a default message
if the user template result is empty.
Example:

![Screenshot from 2024-02-08
12-16-38](https://github.com/grafana/oncall/assets/28077050/bb59b7a7-7ec8-4d9d-8aef-8aff012c74f7)

## Which issue(s) this PR fixes
#3857 

## 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 19:03:25 +00:00
Matias Bordese
160d501bbe
Add permission checks for Slack paging and shift swaps actions (#3861)
Fixes https://github.com/grafana/oncall/issues/3109
2024-02-09 12:30:05 +00:00
Joey Orlando
dd73e589ac
make mobile app notification title and subtitle templatable (#3845)
# What this PR does

Closes https://github.com/grafana/oncall/issues/2050

https://www.loom.com/share/cca9af04f905456087f25e9cbf1845ab

## 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-08 17:23:15 -05:00
Andrey Oleynik
7cd814507e
Improve zvonok verification call (#3768)
# What this PR does

Added support for message template during phone number verification for
the Zvonok service. Template message support allows the use of
[SSML](https://www.w3.org/TR/2010/REC-speech-synthesis11-20100907/)
markup depending on the speaker used for speech synthesis.

Example: `Your verification code is <prosody
rate="x-slow">$verification_code</prosody>`

## Which issue(s) this PR fixes

## 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)

---------

Co-authored-by: Innokentii Konstantinov <innokenty.konstantinov@grafana.com>
Co-authored-by: Joey Orlando <joey.orlando@grafana.com>
Co-authored-by: Joey Orlando <joseph.t.orlando@gmail.com>
2024-02-08 14:05:11 -05:00
Matias Bordese
cb48842e49
Update escalation step wording (#3854)
Fixes https://github.com/grafana/oncall/issues/3828 (was debugging some
code around, simple update)
2024-02-08 15:04:35 +00:00
dependabot[bot]
d64ca29756
Bump django from 4.2.7 to 4.2.10 in /engine (#3853)
Bumps [django](https://github.com/django/django) from 4.2.7 to 4.2.10.
<details>
<summary>Commits</summary>
<ul>
<li><a
href="a684d73fc9"><code>a684d73</code></a>
[4.2.x] Bumped version for 4.2.10 release.</li>
<li><a
href="572ea07e84"><code>572ea07</code></a>
[4.2.x] Fixed CVE-2024-24680 -- Mitigated potential DoS in intcomma
template ...</li>
<li><a
href="9fe7411235"><code>9fe7411</code></a>
[4.2.x] Pinned black == 23.12.1 for blacken-docs checks.</li>
<li><a
href="71dd587da9"><code>71dd587</code></a>
[4.2.x] Pinned black == 23.12.1 in GitHub actions, pre-commit and test
requir...</li>
<li><a
href="74582b8d11"><code>74582b8</code></a>
[4.2.x] Added stub release notes for 4.2.10 and 3.2.24.</li>
<li><a
href="4198a5cb2d"><code>4198a5c</code></a>
[4.2.x] Post-release version bump.</li>
<li><a
href="f339c4c8e4"><code>f339c4c</code></a>
[4.2.x] Bumped version for 4.2.9 release.</li>
<li><a
href="0a4c5e56b4"><code>0a4c5e5</code></a>
[4.2.x] Added release date for 4.2.9.</li>
<li><a
href="ca43990813"><code>ca43990</code></a>
[4.2.x] Fixed <a
href="https://redirect.github.com/django/django/issues/35012">#35012</a>
-- Restored wrapping admin fieldsets with multiple field...</li>
<li><a
href="d9ba0ea6cb"><code>d9ba0ea</code></a>
[4.2.x] Added stub release notes for 4.2.9.</li>
<li>Additional commits viewable in <a
href="https://github.com/django/django/compare/4.2.7...4.2.10">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=django&package-manager=pip&previous-version=4.2.7&new-version=4.2.10)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)
You can disable automated security fix PRs for this repo from the
[Security Alerts
page](https://github.com/grafana/oncall/network/alerts).

</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-02-08 08:36:17 -05:00
Salvatore Giordano
47768f01fc
let mobile app use escalation options endpoints (#3847)
# What this PR does

## Which issue(s) this PR fixes

## 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-07 09:55:38 +00:00
Joey Orlando
0a1cb2e801
address occasional failing tests when run w/ pytest-xdist (#3840)
Follow up to https://github.com/grafana/oncall/pull/3839
2024-02-06 11:57:54 -05:00
Joey Orlando
aca2804502
add pytest-xdist to speed up backend tests (#3839)
# What this PR does

Speeds up `pytest` test execution by ~30%.

More specifically, adds
[`pytest-xdist`](https://pytest-xdist.readthedocs.io/en/stable/), which
according to their docs:
> plugin extends pytest with new test execution modes, the most used
being distributing tests across multiple CPUs to speed up test execution

**Before**
<img width="270" alt="Screenshot 2024-02-05 at 15 53 13"
src="https://github.com/grafana/oncall/assets/9406895/4da33299-5bd0-4dc3-86e1-32cfdf9106f7">

**After**
<img width="254" alt="Screenshot 2024-02-05 at 15 53 04"
src="https://github.com/grafana/oncall/assets/9406895/a59eeb52-291d-4cdc-82b2-55fd31e1c1c5">
2024-02-05 16:04:15 -05:00
Joey Orlando
a414e1ded2
update request body to Cloud Auth API POST /v1/sign API call (#3838)
# What this PR does

Update's `POST /v1/sign` API call to Cloud Auth API

## 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)

---------

Co-authored-by: Victor Cinaglia <victorcinaglia@gmail.com>
2024-02-05 14:56:48 -05:00
Matias Bordese
97cb0f597b
Add acknowledged/resolved by data to alert groups public API (#3833)
Minor improvements to the alert groups public API (helping to get better
reporting information)
2024-02-05 11:02:55 -03:00
Yulya Artyukhina
395c21f6a4
Handle ag telegram message does not exist (#3830)
# What this PR does
Restart `send_link_to_channel_message_or_fallback_to_full_alert_group`
task without retry on the first run if alert group telegram message
doesn't exist. On the second run raise Exception

## Which issue(s) this PR fixes
https://github.com/grafana/oncall-private/issues/2492
## 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-05 12:19:41 +00:00
Joey Orlando
e477394b9c
patch occasional UnicodeEncodeError that occurs with outgoing webhooks (#3832)
# Which issue(s) this PR fixes

Closes https://github.com/grafana/oncall/issues/3831

## 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-02 21:08:04 +00:00
Matias Bordese
f5065462c9
Include teams info in users API (#3817) 2024-02-01 17:16:57 -03:00
Joey Orlando
7db7b09c55
attempt to address some SlackAPIRatelimitError exceptions (#3820)
# Which issue(s) this PR fixes

Closes https://github.com/grafana/oncall-private/issues/2515

Attempts to address some `SlackAPIRatelimitError` exceptions seen in the
following tasks:
- `apps.slack.tasks.post_slack_rate_limit_message`
([logs](https://ops.grafana-ops.net/explore?schemaVersion=1&panes=%7B%22qhs%22:%7B%22datasource%22:%22000000193%22,%22queries%22:%5B%7B%22refId%22:%22A%22,%22expr%22:%22%23%20%7Bcluster%3D~%5C%22prod-%28us-central-0%7Ceu-west-0%29%5C%22,%20namespace%3D%5C%22amixr-prod%5C%22,%20job%3D~%5C%22amixr-prod%2Famixr-engine-celery-retry%2A%5C%22%7D%5Cn%7Bcluster%3D~%5C%22prod-%28us-central-0%7Ceu-west-0%29%5C%22,%20namespace%3D%5C%22amixr-prod%5C%22%7D%20%7C%3D%20%5C%22apps.slack.tasks.post_slack_rate_limit_message%5C%22%20%7C%3D%20%5C%22retry%5C%22%22,%22queryType%22:%22range%22,%22datasource%22:%7B%22type%22:%22loki%22,%22uid%22:%22000000193%22%7D,%22editorMode%22:%22code%22%7D%5D,%22range%22:%7B%22from%22:%22now-7d%22,%22to%22:%22now%22%7D%7D%7D&orgId=1))
- `alerts.tasks.notify_user.perform_notification`
([logs](https://ops.grafana-ops.net/explore?schemaVersion=1&panes=%7B%22qhs%22:%7B%22datasource%22:%22000000193%22,%22queries%22:%5B%7B%22refId%22:%22A%22,%22expr%22:%22%7Bcluster%3D~%5C%22prod-%28us-central-0%7Ceu-west-0%29%5C%22,%20namespace%3D%5C%22amixr-prod%5C%22%7D%20%7C%3D%20%5C%22SlackAPIRatelimitError%5C%22%22,%22queryType%22:%22range%22,%22datasource%22:%7B%22type%22:%22loki%22,%22uid%22:%22000000193%22%7D,%22editorMode%22:%22code%22%7D%5D,%22range%22:%7B%22from%22:%22now-7d%22,%22to%22:%22now%22%7D%7D%7D&orgId=1))

## Checklist

- [ ] Unit, integration, and e2e (if applicable) tests updated
- [ ] Documentation added (or `pr:no public docs` PR label added if not
required)
- [ ] `CHANGELOG.md` updated (or `pr:no changelog` PR label added if not
required)
2024-02-01 14:47:12 -05:00
Matias Bordese
de0e5a19a6
Handle alert group does not exist on telegram button press (#3814)
Fixes https://github.com/grafana/oncall-private/issues/2364
2024-02-01 17:55:35 +00:00
Yulya Artyukhina
ba122ec6ef
Update notification checker (#3818)
# What this PR does
Count sms with status "accepted" as delivered in notification checker
## Which issue(s) this PR fixes

https://raintank-corp.slack.com/archives/C025VMT6SPK/p1706799009342889?thread_ts=1706786822.083149&cid=C025VMT6SPK
## 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-01 15:42:43 +00:00
KevinDW-Fluxys
4e3194c106
expose OUTGOING_WEBHOOK_TIMEOUT as env var (#3801)
# What this PR does
It adds functionality to be able to configure the outgoing webhook
timeout from an environment variable.

## Which issue(s) this PR fixes
Running into timeouts when outgoing webhooks take longer than 4 seconds
(which is exceptional, but can happen) the webhook reports failure,
while it still might have succeeded on the webhook side.

## 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)

---------

Co-authored-by: Joey Orlando <joey.orlando@grafana.com>
Co-authored-by: Joey Orlando <joseph.t.orlando@gmail.com>
2024-02-01 10:48:09 -05:00
Innokentii Konstantinov
006d64a889
Add ability to migrate one org (#3809) 2024-02-01 18:25:36 +08:00
Innokentii Konstantinov
eb3f41c80f
Enable Grafana Alerting v2 integration (#3808)
Enables Grafana Alerting v2 feature. It will enable integration dropdown
in OnCall Contact point in the Alerting UI.
In OSS if user has grafana version which supports this feature it will
work as well. If user has old grafana/oncall - nothing will happen.

---------

Co-authored-by: Ildar Iskhakov <Ildar.iskhakov@grafana.com>
2024-02-01 16:20:47 +08:00
Innokentii Konstantinov
dc355dbf0f Fix grafana_labels sync 2024-02-01 13:43:32 +08:00
Michael Derynck
2a466a0c4f
Add transaction on_commit before signals for alert group actions (#3731)
# What this PR does
Add transactions around log record creation and check transaction
on_commit before sending signals passing DB id of alert group log
records. In cases for delete we can then assume any missing IDs on tasks
are from intentionally deleted alert groups and we can stop tasks from
retrying endlessly.

## Which issue(s) this PR fixes

## 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-01-31 15:54:50 -07:00
Joey Orlando
14feaba3d1
Merge branch 'dev' of github.com:grafana/oncall into dev 2024-01-31 15:48:05 -05:00
Joey Orlando
bc0f51c071
update tests for going_oncall_notification 2024-01-31 15:48:00 -05:00
Michael Derynck
8427953fad
Fix Incident plugin status sync (#3802)
# What this PR does
- Handle case where key exists for jsonData but explicitly set to None
- Disable incident if plugin disabled after or in the case it was
removed completely from the Grafana instance

## Which issue(s) this PR fixes

## 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-01-31 11:52:20 -07:00
Joey Orlando
758c12790d
fix slack API rate limit errors in send_message_to_thread_if_bot_not_in_channel task (#3803)
# What this PR does

See [this
conversation](https://raintank-corp.slack.com/archives/C04JCU51NF8/p1706722752735009)
for more context.

Additionally, improves logging for this task + adds unit tests.

## 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-01-31 13:42:52 -05:00
Matias Bordese
3795c836d1
Add transaction block and callbacks when triggering tasks (#3779)
Related to https://github.com/grafana/oncall/issues/3729
2024-01-31 09:26:14 -05:00