Commit graph

2456 commits

Author SHA1 Message Date
Ildar Iskhakov
952df67580
Fix integrations options order (#2204)
# 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-06-14 09:33:52 +08:00
Joey Orlando
072d43c3d2
make mobile app available to viewers (#1892)
# What this PR does
closes #2153 

## 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)
2023-06-13 14:54:52 -04:00
Matias Bordese
6d77f598d6
Require users when creating a schedule rotation (#2220) 2023-06-13 16:50:37 +00:00
Matias Bordese
1e0bd4395d
Fix preview cutting overlapping events (#2218)
Also update schedules filter by type to allow multiple option selection
as OR.
2023-06-13 15:27:01 +00:00
Yulia Shanyrova
f0aee6e57d
result showing improving (#2214)
result showing improving
2023-06-13 15:06:32 +00:00
Matias Bordese
6e5d417967
Update shift week_start when translating to UTC (#2124)
This fixes scenario described
[here](https://github.com/grafana/oncall/issues/2118#issuecomment-1580499754).

When a rotation is setup in UTC+1, and the shift starts at 00:00 with
Monday as active day and a weekly frequency, the values are translated
to UTC when submitting to the backend, so the shift data becomes
something like: shift starting at 23:00 on Sunday, but since week_start
is on Monday, the "first event" in the week belongs to the "previous
week". This can be addressed by moving the week_start, so a weekly shift
that was starting on a Monday but in UTC tz starts on Sunday,
"translates" to a UTC week_start on Sunday:


![rotation-example](https://github.com/grafana/oncall/assets/260710/5222d3ce-52b7-41d5-8ecb-d01c7a0139cb)


(this is with the proposed changes; otherwise you get the same issue
linked above where the first event in the week is assigned to the other
user group).

About selected week days changed when editing a rotation, see inline
comment (related to
[this](https://github.com/grafana/oncall/issues/1322#issuecomment-1521787786))
2023-06-13 14:31:50 +00:00
Joey Orlando
edb0b9a3c1
improve issue labeling workflow (#2213)
This is a follow up to commit
[57b62c269c](57b62c269c)
to further automate how we handle newly created issues that are not
properly labeled
2023-06-13 09:50:29 -04:00
Yulya Artyukhina
0271cdb8a6
Save only organizations with integrations in cache (#2190)
Save only organizations with integrations in cache for collecting
metrics
2023-06-13 13:31:14 +00:00
Joey Orlando
57b62c269c
add comment on opened issues to remind
about adding labels if none are present
2023-06-13 15:02:59 +02:00
Joey Orlando
5485072d81
minor update to PR comment layout 2023-06-13 14:25:14 +02:00
Joey Orlando
0e7333a9c3
only consider latest semver tags as latest 2023-06-13 14:22:53 +02:00
Joey Orlando
3c755a3a66
add comment to newly created issues which includes the current latest version (#2205) 2023-06-13 08:16:01 -04:00
Joey Orlando
90e0b21d3e
remove SlackActionRecord model/table (#2201)
# What this PR does

Closes #2169 

## 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)
2023-06-13 10:56:06 +00:00
Innokentii Konstantinov
d3ebc17c39 Disable alertmanager_v2 in web ui 2023-06-13 16:13:02 +08:00
Innokentii Konstantinov
f0f2e7c8c6
Draft AlertManager integration v2 (#2167)
# What this PR does
Introduces AlertManagerV2 integration with better grouping and
autoresolving, not intended for production use yet.

---------

Co-authored-by: Ildar Iskhakov <Ildar.iskhakov@grafana.com>
2023-06-13 07:10:38 +00:00
Raz Amir
40890e26ba
Helm: Allow using existing secrets for redis and mysql (#2156)
# What this PR does
This PR adds the ability to use an existing secret for external Redis
and external MySQL and it follows the same changes that PR #761 did for
RabbitMQ (including the fix that was done for it later in #775)

## 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: Ildar Iskhakov <Ildar.iskhakov@grafana.com>
2023-06-13 05:42:22 +00:00
Ildar Iskhakov
30b8401f03
Add helm tests for rabbitmq and redis (#2165)
# 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-06-13 09:45:07 +08:00
Michael Derynck
fd9904cd2e Sign drone build 2023-06-12 15:32:12 -06:00
Michael Derynck
363a3488a2
Update CHANGELOG.md 2023-06-12 15:19:24 -06:00
Joey Orlando
d8d3416686
fix drone unit tests job 2023-06-12 18:53:03 +02:00
Joey Orlando
9dde1805aa
add mypy static type checker to backend codebase (#2151)
# What this PR does

- Adds [`mypy` static type checking](https://mypy-lang.org/) to our CI
pipeline. Currently there is still a **ton** of errors being returned by
the tool, as we'll need to fix pre-existing errors. I think we can
slowly chip away at these errors in small PRs, doing them all in one
large PR is likely very risky.
- Also, this PR starts chipping away at one of the main type errors that
we have which is accessing the `datetime` class (from the `datetime`
library) or `timedelta` function on the `django.utils.timezone` module.
Basically we should be instead accessing these two objects from the
native `datetime` module. This makes sense because the [`__all__`
attribute](https://github.com/django/django/blob/main/django/utils/timezone.py#L14-L30)
in `django.utils.timezone` does not re-export `datetime` or `timedelta`.
- splits `engine` dependencies out into `requirements.txt` and
`requirements-dev.txt`

## Checklist

- [ ] Unit, integration, and e2e (if applicable) tests updated (N/A)
- [ ] Documentation added (or `pr:no public docs` PR label added if not
required) (N/A)
- [ ] `CHANGELOG.md` updated (or `pr:no changelog` PR label added if not
required) (N/A)
2023-06-12 12:50:33 -04:00
Matvey Kukuy
213c8c6cc7
Adding a note about OSS env vars to enable tg/slack features (#2157)
Mentioning 
```
FEATURE_TELEGRAM_INTEGRATION_ENABLED=True
FEATURE_SLACK_INTEGRATION_ENABLED=True
```
Closing #1735
2023-06-12 16:35:21 +00:00
Rares Mardare
bebce3badd
Use secondary btn, updated copies on MobileApp Send Push (#2159)
# What this PR does

Changes on MobileApp screen
- Switched buttons to `secondary` instead of `destructive`
- Update copy (Send Test Push/Important) + notification copy
2023-06-12 17:29:25 +03:00
Joey Orlando
8c5f6238dc
get rid of need for FEATURE_PROMETHEUS_EXPORTER_ENABLED to be present in ci-test.py settings file (#2161) 2023-06-12 09:43:05 -04:00
Matias Bordese
cc3c18c89c
Add instructions for prometheus exporter setup (#2103) 2023-06-12 13:04:07 +00:00
Joey Orlando
2d721355a4
update changelog 2023-06-12 14:56:53 +02:00
Joey Orlando
7ae4b7a1c6
Merge branch 'main' into dev 2023-06-12 14:55:12 +02:00
Rares Mardare
71a5ae1458
Fix for Filters discarding the query param (#2155)
# What this PR does

Original escalation:
https://github.com/grafana/support-escalations/issues/6237

Now instead of always reading the values from local storage, we first
check for query params instead and then for local storage. On the first
render we skip re-updating the local storage, therefore if you visit
alert groups with `team 1` and `team 2`, while local storage had `team
3`, this will not overwrite the local storage but it **WILL** do so once
the teams value change in the dropdown.
2023-06-12 12:32:24 +00:00
Yulia Shanyrova
1c07bec8fc
Integrations2 filtering small fix (#2148)
Integrations2 filtering small fix
2023-06-12 07:48:36 +00:00
Alexander Cherepanov
d3247447ef
Fix usage of extra envs as map in Helm chart (#2146)
# What this PR does


1. Fixes setting extra envs using:
```yaml
env:
  proxy: http://example.com
  SOME_VAR: some-value
```
It had failed if postgresql setting enabled and in `job-migrate`

2. Fixes an issue if custom database and username set for internal
mariadb, `MYSQL_` envs did not use them
```yaml
mariadb:
  auth:
     database: grafana_oncall
     username: grafana_oncall
```

3. Added `imagePullSecrets: []` to values.yaml. It used in helm chart,
but does not present in the values.yaml
4. More unit tests

## 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: Ildar Iskhakov <Ildar.iskhakov@grafana.com>
2023-06-12 03:34:36 +00:00
Rares Mardare
a3d9b181c3
Templates&grouping tweaks&fixes (#2147)
# What this PR does

Templates&grouping tweaks \ fixes
- responsiveness fixes
- changed new route default template to be comment instead
- some other minor changes
2023-06-09 12:56:21 +03:00
Ildar Iskhakov
1a6e30c249
Upgrade helm dependecies, improve local setup (#2144)
# What this PR does
* Upgrade to the recent Grafana
* Upgrade to the recent bitnami mariadb, rabbitmq charts which support
arm64 now
* Remove deprecated psp policies from grafana chart
* Make startupProbe period smaller to increase installation speed 


## 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-06-09 15:16:51 +08:00
Joey Orlando
47042decb7
don't enforce line-length rule for markdownlint for code-blocks or tables (#2145)
# 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-06-09 06:57:19 +00:00
Innokentii Konstantinov
0b92210e16
Better simple phone provider (#2143)
# 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-06-09 13:21:38 +08:00
pikilisaikiran
a0da31f745
Added nodeSelector for celery deployment and migrate job (#1085)
# What this PR does
Adds nodeSelector for celery deployment and migrate job

## Which issue(s) this PR fixes
Fixes errors while deploying resources in a cluster with Gatekeeper
policy ( that restricts deployments without nodeSelector).

## Checklist

- [x] Tests updated
- [x] Documentation added
- [x] `CHANGELOG.md` updated

---------

Co-authored-by: Joey Orlando <joseph.t.orlando@gmail.com>
Co-authored-by: Joey Orlando <joey.orlando@grafana.com>
2023-06-08 20:53:11 +00:00
Matias Bordese
c1935ef46c
Update alert group view receive channel filter (#2140)
We were noticing some discrepancies in alert groups counts.

From a real example:

```
# queryset is the alert groups initial queryset
>>> qs = queryset.filter(channel_filter__alert_receive_channel=arc)
>>> qs.filter(resolved_at__isnull=False).count()
1318
>>> qs = queryset.filter(channel=arc)
>>> qs.filter(resolved_at__isnull=False).count()
1356
>>> qs.filter(resolved_at__isnull=False, channel_filter__isnull=True).count()
38
```
2023-06-08 19:49:48 +00:00
Ildar Iskhakov
f37c3a90d1
Edit route hint (#2114)
# 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-06-09 00:34:32 +08:00
Matvey Kukuy
6e82e9400f Merge remote-tracking branch 'origin/dev' into dev 2023-06-08 18:48:35 +03:00
Matvey Kukuy
b30769e7b5 Docs fixes 2023-06-08 18:48:23 +03:00
Ildar Iskhakov
f14179b9b0
Fix demo-payload (#2139)
# 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-06-08 23:31:18 +08:00
Yulia Shanyrova
b50b10d491
fix for templates for routes (#2136)
# What this PR does
- Wrong behaviour after saving Route template fix
- Add notification/error when try to save empty template for routes.
2023-06-08 15:20:46 +00:00
Ildar Iskhakov
18763c5073
Fix docs, change team to organization in ratelimits, as previously te… (#2135)
…am was equal to orgamization

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

Co-authored-by: Matvey Kukuy <Matvey-Kuk@users.noreply.github.com>
2023-06-08 13:47:13 +00:00
github-actions[bot]
883ca35725
Merge: Release oncall Helm chart 1.2.41 (#2133)
Merge this PR to `main` branch to start another [github actions
job](https://github.com/grafana/oncall/blob/dev/.github/workflows/helm_release.yml)
that will release the updated version of the chart (version: 1.2.41,
appVersion: v1.2.41) into `grafana/helm-charts` helm repository.

This PR was created automatically by this [github
action](https://github.com/grafana/oncall/blob/dev/.github/workflows/helm_release_pr.yml).

Co-authored-by: GitHub Actions <actions@github.com>
2023-06-08 07:07:24 -04:00
Joey Orlando
4785f147d8
Update CHANGELOG.md 2023-06-08 06:44:16 -04:00
Yulia Shanyrova
7a569dae02
Fixes for search, for last alert payload and some design changes (#2129)
## Which issue(s) this PR fixes
Fixes for search, for last alert payload and some design changes
2023-06-08 08:16:16 +00:00
Innokentii Konstantinov
645199782a Update CHANGELOG.md 2023-06-08 15:37:53 +08:00
Innokentii Konstantinov
00464a3baa
Merge pull request #2127 from grafana/dev
dev to main
2023-06-08 15:34:13 +08:00
Alexander Cherepanov
f67cfd0494
Run containers as a non-root user (#2053)
# What this PR does

Create a custom non-root user and use it to start an app. So uwsgi does
not require to use `setUid` and `setGid` system calls.

It handles errors while starting in Kubernetes with `runAsNonRoot: true`
check.

## Which issue(s) this PR fixes

closes https://github.com/grafana/oncall/issues/445

## 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: Joey Orlando <joey.orlando@grafana.com>
Co-authored-by: Joey Orlando <joseph.t.orlando@gmail.com>
2023-06-08 07:12:00 +00:00
Innokentii Konstantinov
34bdaf8694 Update CHANGELOG.md 2023-06-08 14:55:35 +08:00
Innokentii Konstantinov
c7f8ac3559
Add BaseFailed exceptions for phone_notificator (#2074)
# What this PR does
Introduces BaseFailed exception for phone_notificator.

# Why
We need to somehow distinguish errors we want to be notified - like
network errors or invalid twilio credentials (I will call them "real"
errors) and errors we want to share with user, but don't want to be
paged ( I will call them "fake" errors).
To do that I added "graceful_msg" to all Failed... exceptions. If
details field is present - it mean we can return 400 code with the
message, if not - 500 code. So, "real" errors will raise Failed...
exception, while "fake" will add "graceful_msg".

# TODO
handle exceptions handled here
https://github.com/grafana/oncall/pull/2065
## Checklist

- [ ] 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: Michael Derynck <michael.derynck@grafana.com>
2023-06-08 05:55:41 +00:00