Commit graph

3451 commits

Author SHA1 Message Date
Joey Orlando
1a22db0c29
Merge branch 'dev' of github.com:grafana/oncall into dev 2023-12-11 10:20:15 -05:00
Joey Orlando
c667d625d8
tiltfile - port forward mariadb to host machine 2023-12-11 10:20:01 -05:00
Maxim Mordasov
fcad289089
Fix schedules invalid dates issue (#3541)
# What this PR does

Fix schedules invalid dates issue

## Which issue(s) this PR fixes

https://github.com/grafana/support-escalations/issues/8084

## 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)
2023-12-11 14:17:41 +00:00
Rares Mardare
abb698e825
Unified logo with IRM, added few minor UI tweaks, bumped labels version (#3531)
# What this PR does

- Mostly this -> https://github.com/grafana/oncall/issues/1905

## Which issue(s) this PR fixes

## 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)
2023-12-11 13:54:31 +00:00
Innokentii Konstantinov
3de2b1d4ad Update CHANGELOG 2023-12-11 18:25:39 +08:00
Innokentii Konstantinov
885f3e53f5
Fix labels wording (#3537) 2023-12-11 17:59:02 +08:00
Dominik Broj
94f5fce070
Further improvements on labels (#3536)
# 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)
2023-12-11 09:11:27 +00:00
Dominik Broj
c28b866495
Brojd/further labels polishing (#3532)
# What this PR does
Polishing labels

## Which issue(s) this PR fixes
https://github.com/grafana/oncall-private/issues/2355
https://github.com/grafana/oncall-private/issues/2305
https://github.com/grafana/oncall-private/issues/2336 

## 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>
2023-12-11 07:44:54 +00:00
Joey Orlando
783e0f7ad0
Update CHANGELOG.md 2023-12-08 11:14:51 -05:00
Joey Orlando
bdc120b3c6
move some grafana-plugin/README contents (#3525) 2023-12-08 10:30:01 -05:00
Vadim Stepanov
6d1e124e05
Limit the number of labels per alert group (#3507)
# What this PR does

Limits the maximum number of labels attached to an alert group. (only
backend part)

## Which issue(s) this PR fixes

Related to https://github.com/grafana/oncall-private/issues/2305

## 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)
2023-12-08 10:34:25 +00:00
Dominik Broj
b072d5b870
Brojd/polishing labels (#3528)
# What this PR does
- auto adjust column widths in alert group table
- add missing space below drawer buttons 

## Which issue(s) this PR fixes
**https://github.com/grafana/oncall-private/issues/2355**

## 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)
2023-12-08 07:34:09 +00:00
Matias Bordese
3feba3675b
Log average/max delta between alert ingestion and alert group creation (#3526)
Related to https://github.com/grafana/oncall-private/issues/2347
2023-12-07 16:03:41 +00:00
Yulya Artyukhina
7e54a43f50
Fix team changing on PUT request if team is not in request data (#3530)
# What this PR does
Removes setting team to default value on PUT request to internal
endpoints if team is not in request data.
(For integrations, escalation chains, schedules and webhooks)

## Which issue(s) this PR fixes
https://github.com/grafana/oncall-private/issues/2368

## 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)
2023-12-07 14:44:52 +00:00
Rares Mardare
dfe4f37371
Bump labels package version (#3521)
# What this PR does

## Which issue(s) this PR fixes

## 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)
2023-12-07 10:15:46 +02:00
Joey Orlando
6953c3f73e
Improve FCMDevice.send_message logging (#3527)
# What this PR does

Add more logging around `FCMDevice.send_message` in an effort to fix
https://github.com/grafana/oncall-private/issues/1820
2023-12-06 15:47:11 -05:00
Matias Bordese
e54817246b
Update CHANGELOG.md 2023-12-06 13:11:16 -03:00
Matias Bordese
054401a214
Fix missing timestamp value, add test (#3522) 2023-12-06 16:02:54 +00:00
Vadim Stepanov
a46610b096
Update CHANGELOG.md 2023-12-06 13:33:58 +00:00
Vadim Stepanov
44484b56f1
Modify alert group list index (#3502)
# What this PR does

Modifies the database index used by the alert group list page to
accommodate ordering by
[`-started_at`](https://github.com/grafana/oncall/pull/3502/files#diff-68d8b0b2e9b7affe54e5950215e69df4afcc6f7f5dd7eeceb810afda0dd5e1d3R85)

## Which issue(s) this PR fixes

Related to https://github.com/grafana/support-escalations/issues/8567

## 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)
2023-12-06 13:10:56 +00:00
Matias Bordese
3e1d069859
Do not trigger alert group update log signal before setting alert (#3514)
Do not trigger update log report signal until there is an alert set for
the [recently created alert
group](https://github.com/grafana/oncall/blob/dev/engine/apps/alerts/models/alert.py#L110)
to avoid retries when trying to post an updated report when there isn't
yet a message posted (or an alert to render).
2023-12-06 13:04:13 +00:00
Matias Bordese
e053eb084d
Track alert received timestamp on alert group creation (#3513)
Keep record of the timestamp when the alert group creation task is
triggered, allowing to track the delta time between alert received
datetime and alert group creation timestamp.

Related to https://github.com/grafana/oncall-private/issues/2347
2023-12-06 12:20:03 +00:00
Vadim Stepanov
147503eea8
Return 404 from mobile app gateway viewset (#3518)
# What this PR does

Changes how the `MOBILE_APP_GATEWAY_ENABLED` feature flag
enables/disables the mobile app gateway viewset.

## 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)
2023-12-06 10:57:07 +00:00
Dominik Broj
0f9c20cf0e
Polishing column selector and table view selector (#3491)
# What this PR does
- add tooltips to table view selector
- minor styling fixes

## Which issue(s) this PR fixes
https://github.com/grafana/oncall-private/issues/2355

## 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)
2023-12-06 04:56:02 +00:00
Joey Orlando
382b18b052
Mobile app proxy gateway (#3449)
# What this PR does

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

## 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)
2023-12-05 19:58:05 +00:00
Joey Orlando
a1edc20cbe
Update CHANGELOG.md 2023-12-05 12:14:19 -05:00
Joey Orlando
2bb80b487e
address issue with metrics calculations when redis cluster is used (#3510)
## Which issue(s) this PR fixes

Fixes this issue we started seeing popping up because of a change
introduced in #3496:
```python3
File "/etc/app/apps/metrics_exporter/views.py", line 22, in get
    result = generate_latest(application_metrics_registry).decode("utf-8")
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/prometheus_client/exposition.py", line 198, in generate_latest
    for metric in registry.collect():
  File "/usr/local/lib/python3.11/site-packages/prometheus_client/registry.py", line 97, in collect
    yield from collector.collect()
  File "/etc/app/apps/metrics_exporter/metrics_collectors.py", line 56, in collect
    alert_groups_total, missing_org_ids_1 = self._get_alert_groups_total_metric(org_ids)
                                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/etc/app/apps/metrics_exporter/metrics_collectors.py", line 97, in _get_alert_groups_total_metric
    org_id_from_key = RE_ALERT_GROUPS_TOTAL.match(org_key).groups()[0]
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'groups'
```



```python3
>>> import re
>>> ALERT_GROUPS_TOTAL = "oncall_alert_groups_total"
>>> _RE_BASE_PATTERN = r"{{?{}}}?_(\d+)"
>>> RE_ALERT_GROUPS_TOTAL = re.compile(_RE_BASE_PATTERN.format(ALERT_GROUPS_TOTAL))
>>> org_key = "{oncall_alert_groups_total}_1"
>>> RE_ALERT_GROUPS_TOTAL.match(org_key).groups()[0]
'1'
>>> org_key = "oncall_alert_groups_total_1"
>>> RE_ALERT_GROUPS_TOTAL.match(org_key).groups()[0]
'1'
```

## Checklist

- [x] 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)
2023-12-05 12:12:08 -05:00
Dominik Broj
93fee4228d
Rename integrations table tabs (#3501)
# What this PR does
Rename "Connections" tab to "Monitoring Systems" and "Direct Paging" to
"Manual Direct Paging" on Integrations page

## Which issue(s) this PR fixes
https://github.com/grafana/oncall-private/issues/2302

## 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)
2023-12-05 12:43:48 +00:00
Joey Orlando
52204b3336
Merge branch 'main' into dev 2023-12-05 07:56:06 -05:00
Joey Orlando
61f0c177e8
Update CHANGELOG.md 2023-12-05 07:50:51 -05:00
Dominik Broj
6c3f236db0
add borders to editors (#3490)
# What this PR does
add missing borders to template editors

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

## 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)
2023-12-05 10:23:35 +00:00
Matias Bordese
b73da8e2a4
Minor update to schedules API docs (#3488) 2023-12-04 16:01:56 -03:00
Matias Bordese
45200c33a1
Update beat schedule to use crontab schedule types (#3497)
Update celery beat schedule to use crontab schedule types, since
otherwise the timedelta is relative to the celery start and when we have
a restart we have some bigger than expected gaps between task runs
(alternatively it seems we could also use the `relative` option
described
[here](https://docs.celeryq.dev/en/main/userguide/periodic-tasks.html#available-fields))

Related to https://github.com/grafana/oncall-private/issues/2347
2023-12-04 18:42:12 +00:00
dependabot[bot]
332aa8ca82
Bump @adobe/css-tools from 4.3.1 to 4.3.2 in /grafana-plugin (#3478)
Bumps [@adobe/css-tools](https://github.com/adobe/css-tools) from 4.3.1
to 4.3.2.
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/adobe/css-tools/blob/main/History.md"><code>@​adobe/css-tools</code>'s
changelog</a>.</em></p>
<blockquote>
<h1>4.3.2 / 2023-11-28</h1>
<ul>
<li>Fix redos vulnerability with specific crafted css string -
CVE-2023-48631</li>
<li>Fix Problem parsing with :is() and nested :nth-child() <a
href="https://redirect.github.com/adobe/css-tools/issues/211">#211</a></li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li>See full diff in <a
href="https://github.com/adobe/css-tools/commits">compare view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=@adobe/css-tools&package-manager=npm_and_yarn&previous-version=4.3.1&new-version=4.3.2)](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>
Co-authored-by: Joey Orlando <joey.orlando@grafana.com>
2023-12-04 18:41:32 +00:00
jorgeav
4df8985283
Jinja2 template helper filter datetimeformat_as_timezone (#3426)
# What this PR does
Add an additional jinja2 template helper filter to convert a timezone
aware datetime to a different timezone.

## Which issue(s) this PR fixes
Alert payloads that originate from different time zones may include
timestamps having a local time offset. This filter enables
standardization of timestamp timezones.

## 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>
2023-12-04 13:39:04 -05:00
Matias Bordese
e39baa6bbe
Revert "Refactor gcom api calls when syncing org" (#3498)
Reverts grafana/oncall#3489

Reviewing logs, it seems something broke related to [token
auth](https://ops.grafana-ops.net/explore?schemaVersion=1&panes=%7B%22ffS%22:%7B%22datasource%22:%22OP27Xzxnk%22,%22queries%22:%5B%7B%22refId%22:%22A%22,%22expr%22:%22%7Bcluster%3D~%5C%22dev-.%2A%5C%22,%20namespace%3D%5C%22grafana-com%5C%22,%20job%3D%5C%22grafana-com%2Fgrafana-com-api%5C%22%7D%20%7C~%20%5C%22%2Finstances%2F%5Ba-z0-9%5D%2B.config%3Dtrue%5C%22%20%7C%3D%20%5C%22Grafana%20OnCall%5C%22%22,%22editorMode%22:%22code%22,%22queryType%22:%22range%22,%22datasource%22:%7B%22type%22:%22loki%22,%22uid%22:%22OP27Xzxnk%22%7D%7D%5D,%22range%22:%7B%22from%22:%22now-1h%22,%22to%22:%22now%22%7D%7D%7D&orgId=1).
Reverting for now, will revisit in a later PR.
2023-12-04 18:02:58 +00:00
Joey Orlando
1df1b1eaa0
patch redis cluster multi-key operations (#3496)
# Which issue(s) this PR fixes

Related to https://github.com/grafana/oncall-private/issues/2363

Addresses this issue that arises when using
`cache.get_many`/`cache.set_many` operations with a Redis Cluster:
```python3
File "/usr/local/lib/python3.11/site-packages/redis/cluster.py", line 1006, in determine_slot
    raise RedisClusterException(
redis.exceptions.RedisClusterException: MGET - all keys must map to the same key slot
```

From the Redis Cluster
[docs](https://redis.io/docs/reference/cluster-spec/#hash-tags), this
can be addressed with this 👇 . Basically this will ensure that keys in
multi-key operations will resolve to the same hash slot (read: node):

> Hash tags
> There is an exception for the computation of the hash slot that is
used in order to implement hash tags. Hash tags are a way to ensure that
multiple keys are allocated in the same hash slot. This is used in order
to implement multi-key operations in Redis Cluster.
> 
> To implement hash tags, the hash slot for a key is computed in a
slightly different way in certain conditions. If the key contains a
"{...}" pattern only the substring between { and } is hashed in order to
obtain the hash slot. However since it is possible that there are
multiple occurrences of { or } the algorithm is well specified by the
following rules:
> 
> IF the key contains a { character.
> AND IF there is a } character to the right of {.
> AND IF there are one or more characters between the first occurrence
of { and the first occurrence of }.
> Then instead of hashing the key, only what is between the first
occurrence of { and the following first occurrence of } is hashed.

## Checklist

- [x] 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)
2023-12-04 13:08:57 -05:00
Vadim Stepanov
9796489b8e
Skip empty alert group labels (#3495)
# What this PR does

Makes sure there are no empty alert group label values.

## 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)
2023-12-04 13:46:03 +00:00
Vadim Stepanov
4ccfda58e5
Disallow creating and deleting direct paging integrations (#3475)
# What this PR does

Disallows creating and deleting direct paging integrations via both
internal and public APIs. It also hides the direct paging option in the
UI when creating a new integration.

## Which issue(s) this PR fixes

Related to https://github.com/grafana/oncall-private/issues/2302

## 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: Dominik <dominik.broj@grafana.com>
2023-12-04 13:13:53 +00:00
Matias Bordese
9eb09c0272
Refactor gcom api calls when syncing org (#3489)
Make one API call instead of two.
2023-12-04 13:08:59 +00:00
Innokentii Konstantinov
a3e3d8bc9d
Change labels feature flag to work per oncall org (#3493)
It's needed because anyway labels plugin provisioned per stack, not per
org

---------

Co-authored-by: Yulya Artyukhina <Ferril.darkdiver@gmail.com>
2023-12-04 12:45:07 +00:00
Vadim Stepanov
ea4f692646
Pin markdown2 to 2.4.10 (#3494)
# What this PR does

Pins markdown to 2.4.10 to fix [failing
test](https://github.com/grafana/oncall/actions/runs/7082829248/job/19276914906?pr=3490).

## 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)
2023-12-04 11:54:11 +00:00
Matias Bordese
6e35aadc0c
Add test ensuring integration endpoints work if redis cache is down (#3445) 2023-12-01 17:45:18 +00:00
Joey Orlando
1edeac5f89
Merge pull request #3487 from grafana/helm-release/1.3.70
Merge: Release oncall Helm chart 1.3.70
2023-12-01 12:45:13 -05:00
GitHub Actions
d3384dce4a Release oncall Helm chart 1.3.70 2023-12-01 17:02:16 +00:00
Joey Orlando
e6d5cc62b1
v1.3.70 2023-12-01 12:01:07 -05:00
Joey Orlando
adc4f5905e
Update CHANGELOG.md 2023-12-01 12:00:20 -05:00
Joey Orlando
e63151f724
revert uwsgi to 2.0.21 2023-12-01 11:59:22 -05:00
Joey Orlando
c2a49aaa27
Merge pull request #3485 from grafana/helm-release/1.3.69
Merge: Release oncall Helm chart 1.3.69
2023-12-01 11:31:33 -05:00
GitHub Actions
eff7c0c063 Release oncall Helm chart 1.3.69 2023-12-01 15:36:28 +00:00