Commit graph

3345 commits

Author SHA1 Message Date
Ildar Iskhakov
393c8e06a7
Merge branch 'main' into dev 2023-11-28 09:59:07 +08:00
Ildar Iskhakov
cb6a907b03
Update CHANGELOG.md 2023-11-28 09:53:50 +08:00
Vadim Stepanov
9e889403f2
Alert group payload labels (#3434)
https://github.com/grafana/oncall/pull/3385 + handle null values
2023-11-27 17:53:54 +00:00
Vadim Stepanov
e09422a07d
Revert "Alert group payload labels" (#3433)
Reverts grafana/oncall#3385
2023-11-27 17:28:34 +00:00
Vadim Stepanov
5fac6aeac5
Alert group payload labels (#3385)
# What this PR does

Adds an ability to extract labels from alert group payload. See
[demo](https://www.loom.com/share/cf2b746eea974547b76f44298e32a54f?sid=67ed1e58-40ed-4136-a201-6482fb7773d3).

## Which issue(s) this PR fixes

https://github.com/grafana/oncall-private/issues/2304

## 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: Maxim Mordasov <maxim.mordasov@grafana.com>
Co-authored-by: Rares Mardare <rares.mardare@grafana.com>
2023-11-27 16:55:31 +00:00
Ildar Iskhakov
2acd85a3e6 Do not check redis during startupprobe 2023-11-27 21:43:26 +08:00
Ildar Iskhakov
2ddb47ea29
Revert "Make alert ingestion cache independent (#3414)" (#3430)
This reverts commit acfba47a81.

# 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-11-27 20:23:57 +08:00
Ildar Iskhakov
aab49f0594
Revert "Add test to ensure integrations work when cache is down" (#3431)
Reverts grafana/oncall#3418
2023-11-27 20:10:26 +08:00
Innokentii Konstantinov
85f9b0f168
Log slack bot_id and bot_user_it (#3429)
Log slack bot id and bot user id to check if we can avoid request to
slack api
2023-11-27 18:36:53 +08:00
Yulya Artyukhina
863af25994
Fix alert group rendering (#3424)
# What this PR does
Fix alert group rendering when some links were broken because of
replacing `-` to `_`.

## Which issue(s) this PR fixes
https://github.com/grafana/support-escalations/issues/8119
https://github.com/grafana/support-escalations/issues/8468

## 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-11-24 15:39:37 +00:00
Matias Bordese
0816825c5d
Add test to ensure integrations work when cache is down (#3418)
Complements https://github.com/grafana/oncall/pull/3414/
2023-11-24 12:02:36 +00:00
Matias Bordese
d730f6b2bf
Trigger distribute task after alert is committed (#3420)
Fix issue triggering task retries because alert is not yet committed to
the DB.
Similar to https://github.com/grafana/oncall/pull/3001.
2023-11-24 12:02:32 +00:00
Michael Derynck
3436344f1d
Allow users with user settings read to list users (#3419)
# What this PR does
Fixed issue where `User Settings Reader` was missing permission to list
users.

## 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-11-23 20:41:27 +00:00
Matias Bordese
55fedb25d6
Rework alert group internal API team filter (#3413)
Related to https://github.com/grafana/oncall-private/issues/2177
2023-11-23 17:28:00 +00:00
Michael Derynck
60ef4348f5
Allow OnCall API to use Grafana Service Accounts (#3189)
# What this PR does
Allows public OnCall API to use Grafana service accounts for
authorization. In cloud requests using a Grafana service account token
also needs to provide headers for `X-Grafana-Org-Slug` and
`X-Grafana-Instance-Slug`

This is **alpha** functionality, it may break or be removed in the
future. Going to use this on one endpoint (resolution notes) before we
consider the implications across all of public API.

## 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-11-23 16:42:27 +00:00
Ildar Iskhakov
95a3ab3b75
Revert "Cache independent ingestion" (#3417)
Reverts grafana/oncall#3415
2023-11-23 21:38:06 +08:00
Maxim Mordasov
8645e55f39
Filters polishing, remove displaying rotation modal for Terraform/API based schedules (#3259)
# What this PR does

Filters fixes and polishing, remove displaying rotation modal for
Terraform/API bases schedules

## Which issue(s) this PR fixes

https://github.com/grafana/oncall/issues/1714
https://github.com/grafana/oncall-private/issues/2246
https://github.com/grafana/oncall/issues/3183

## Checklist

- [ ] 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-11-23 09:53:48 +00:00
Ildar Iskhakov
acfba47a81
Make alert ingestion cache independent (#3414)
# What this PR does

This PR catches redis unavailability exceptions to prevent errors during
alert ingestion in the following places:
StartupProbeView
AlertChannelDefiningMixin
RateLimitMixin

## 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-11-23 16:32:02 +08:00
Ildar Iskhakov
a6912c96af
Merge pull request #3415 from grafana/iskhakov/cache-independent-ingestion
Cache independent ingestion
2023-11-23 16:22:18 +08:00
Ildar Iskhakov
566e8c53ba Ignore typing checks for imported library (https://mypy.readthedocs.io/en/stable/running_mypy.html\#missing-library-stubs-or-py-typed-marker) 2023-11-23 16:14:30 +08:00
Ildar Iskhakov
0d5ef785bf Make alert ingestion cache independent 2023-11-23 11:27:47 +08:00
Matias Bordese
c0a6e69d9f
Remove unused prefetch; prefer indexed query (#3410)
This should help with slowness in webhooks listing page (do not fetch
*all* responses for webhooks, which besides were not used in the
serializer).
2023-11-23 02:08:04 +00:00
Innokentii Konstantinov
9628bdc51f
Webhook labels (#3383)
This PR add labels for webhooks. 
1. Make webhook "labelable" with ability to filter by labels.
2. Add labels to the webhook payload. It contain new field webhook with
it's name, id and labels. Field integration and alert_group has a
corresponding label field as well. See example of a new payload below:
```
{
    "event": {
        "type": "escalation"
    },
    "user": null,
    "alert_group": {
        "id": "IRFN6ZD31N31B",
        "integration_id": "CTWM7U4A2QG97",
        "route_id": "RUE7U7Z46SKGY",
        "alerts_count": 1,
        "state": "firing",
        "created_at": "2023-11-22T08:54:55.178243Z",
        "resolved_at": null,
        "acknowledged_at": null,
        "title": "Incident",
        "permalinks": {
            "slack": null,
            "telegram": null,
            "web": "http://grafana:3000/a/grafana-oncall-app/alert-groups/IRFN6ZD31N31B"
        },
        "labels": {
            "severity": "critical"
        }
    },
    "alert_group_id": "IRFN6ZD31N31B",
    "alert_payload": {
        "message": "This alert was sent by user for demonstration purposes"
    },
    "integration": {
        "id": "CTWM7U4A2QG97",
        "type": "webhook",
        "name": "hi - Webhook",
        "team": null,
        "labels": {
            "hello": "world",
            "severity": "critical"
        }
    },
    "notified_users": [],
    "users_to_be_notified": [],
    "webhook": {
        "id": "WHAXK4BTC7TAEQ",
        "name": "test",
        "labels": {
            "hello": "kesha"
        }
    }
}
```

I feel that there is an opportunity to make code cleaner - remove all
label logic from serializers, views and utils to models or dedicated
LabelerService and introduce Labelable interface with something like
label_verbal, update_labels methods. However, I don't want to tie
webhook labels with a refactoring.

---------

Co-authored-by: Dominik <dominik.broj@grafana.com>
2023-11-22 11:17:41 +00:00
Joey Orlando
04696ec2b5
Merge pull request #3405 from grafana/helm-release/1.3.62
Merge: Release oncall Helm chart 1.3.62
2023-11-21 14:00:53 -05:00
n3x14
92ed22645c
[Docs] add details inbound email integration setup (#3198)
# What this PR does

This PR adds some more depth to the documentation regarding the setup of
the "Inbound Email" integration.
In particular it references the setup requirement in the integration
documentation and also outlines the requirements for the secret syntax
and usage in the process.

## Which issue(s) this PR fixes

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

## 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-11-21 13:54:25 -05:00
GitHub Actions
96284eef8f Release oncall Helm chart 1.3.62 2023-11-21 18:39:50 +00:00
Joey Orlando
24e19c7e36
v1.3.62 2023-11-21 13:37:59 -05:00
Joey Orlando
0000251779
Update CHANGELOG.md 2023-11-21 13:36:28 -05:00
Joey Orlando
f70c439334
add more logging in apps.alerts.tasks.notify_user.perform_notification task (#3403)
# What this PR does

add more logging in `apps.alerts.tasks.notify_user.perform_notification`
task (related to https://github.com/grafana/oncall-private/issues/2318;
won't solve that issue but will help with the investigation)
2023-11-21 13:35:23 -05:00
Matias Bordese
56d1b529e9
Add builtin slack retry on ratelimited error (#3401)
Fixes https://github.com/grafana/oncall-private/issues/2293

Enable Slack client retries on `ratelimited` errors: it will check the
`Retry-After` header before trying again. After 3 attempts it will raise
the error (and we will fallback to the usual error/task retry handling).
2023-11-21 17:32:29 +00:00
Dmitriy Okladin
f194b750aa
helm: fix conditions create svc for detached integrations (#3394)
# What this PR does

Added a condition to the service that checks the variable
detached_integrations.enabled

## Which issue(s) this PR fixes

#3393

---------

Co-authored-by: Joey Orlando <joey.orlando@grafana.com>
Co-authored-by: Joey Orlando <joseph.t.orlando@gmail.com>
2023-11-21 12:22:14 -05:00
Andre Buryndin
ab561db8a7
Fixing helm hooks for install stage (#3136)
# What this PR does

## Issue

At the first run (`helm install ...`) the migration job cannot start the
container because cannot find Postgres/Redis/MySQL credentials and
ServiceAccount.

Workaround: set `.migrate.useHook` value to `false` for the `install`
stage, and after you can switch back to `true`.

This PR completely resolves this issue.

## Checklist

- [x] Unit, integration, and e2e (if applicable) tests updated (doesn't
violate anything)
- [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)
- [x] It is manually tested in the internal environment

---------

Co-authored-by: Joey Orlando <joey.orlando@grafana.com>
Co-authored-by: Joey Orlando <joseph.t.orlando@gmail.com>
2023-11-21 12:21:33 -05:00
Michael Derynck
b3583cd1a0
Add more logging info on alert creation (#3392)
# What this PR does
Add alert receive channel id when logging to make it easier to trace
grouping

## Which issue(s) this PR fixes

## 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: Joey Orlando <joey.orlando@grafana.com>
2023-11-21 16:16:15 +00:00
Joey Orlando
ad5841b2fb
Merge pull request #3400 from grafana/helm-release/1.3.61
Merge: Release oncall Helm chart 1.3.61
2023-11-21 08:20:41 -05:00
GitHub Actions
d197b22f79 Release oncall Helm chart 1.3.61 2023-11-21 12:56:15 +00:00
Vadim Stepanov
d659650050
Merge pull request #3399 from grafana/dev
v1.3.61
2023-11-21 12:53:47 +00:00
Vadim Stepanov
af24a47e18
Update CHANGELOG.md (#3398) 2023-11-21 12:53:12 +00:00
Vadim Stepanov
cb2d4fa76b
Fix deleting integrations with duplicate names (#3397)
# What this PR does

Fixes a bug when it's not possible to delete two or more integrations
having the same name at once.

## Which issue(s) this PR fixes

https://github.com/grafana/oncall-private/issues/2313

## 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-11-21 12:44:21 +00:00
Joey Orlando
34be7ba4a4
Merge pull request #3390 from grafana/helm-release/1.3.60
Merge: Release oncall Helm chart 1.3.60
2023-11-21 07:12:34 -05:00
GitHub Actions
aecb20e6ee Release oncall Helm chart 1.3.60 2023-11-20 22:54:53 +00:00
Joey Orlando
8f169eb700
v1.3.60 2023-11-20 17:54:05 -05:00
Joey Orlando
d2c9e2743c
Update CHANGELOG.md 2023-11-20 17:53:34 -05:00
Matias Bordese
e62fd3b122
Switch to django-redis, update redis deps (#3387)
Moving to django-redis and updating related deps.
django-redis has better support for [sentinel
setup](https://github.com/jazzband/django-redis#use-the-sentinel-connection-factory),
besides improved cache helpers (and being actively maintained).

---------

Co-authored-by: Joey Orlando <joey.orlando@grafana.com>
2023-11-20 20:27:13 +00:00
Joey Orlando
05ec0f97b5
fix issue in /escalate Slack command when selecting a team (#3381)
# Which issue(s) this PR fixes

Closes https://github.com/grafana/support-escalations/issues/8380

## 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-11-20 15:27:01 -05:00
Matias Bordese
3b90c6544b
Avoid msg_too_long errors when posting/updating slack resolution note (#3372) 2023-11-20 12:17:07 +00:00
Joey Orlando
6214ffbd66
fix missing users in rotations when RBAC is enabled (#3380)
# Which issue(s) this PR fixes
1. Enable RBAC
2. Create a schedule rotation layer which includes a user whom is Viewer
+ has role `Notifications Receiver` (this is the RBAC role we use to
filter which users show up in the user dropdown in the rotations modal
when creating a rotation)
3. The user _sorta_ shows up in the schedule but they are listed in
`missing_users`

<img width="1166" alt="Screenshot 2023-11-17 at 10 12 30"
src="https://github.com/grafana/oncall/assets/9406895/ae4d6449-3aff-4087-9b05-64645e84b40a">
<img width="1173" alt="Screenshot 2023-11-17 at 10 15 04"
src="https://github.com/grafana/oncall/assets/9406895/3ac4f0b9-49b3-4a7d-bfcf-39a8c51bbb74">


## 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-11-20 11:31:07 +00:00
Dominik Broj
53ca5331c6
show delete integration btn only if allow_delete is truthy (#3377)
# What this PR does
Show delete integration btn only if `allow_delete` is `true` for it


## 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-11-17 13:38:20 +00:00
Dominik Broj
8f13e312f7
Use chromium only in PRs e2e tests (#3374)
# What this PR does
In PR pipelines install dependencies and run e2e tests only in Chromium.
In daily e2e workflow use Chromium, Firefox and Webkit.

## 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-11-17 13:22:34 +00:00
Dominik Broj
45ae04088f
stabilize e2e tests (#3349)
# What this PR does
Stabilize e2e tests by:
- improve usage of locators
- fix unreliable selectors
- prevent parallelism within the same test file

Additionally:
- configure eslint for e2e tests and fix existing errors/warnings
- bump Playwright version to latest stable

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

## 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-11-17 10:07:12 +00:00
m4r1u2
719765a72d
add podLabels to helm (#3167)
# What this PR does
Add option to add additional pod labels.

## 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)
- [x] It is manually tested in the internal environment

---------

Co-authored-by: Marius Ensrud <marius.ensrud@skatteetaten.no>
Co-authored-by: Joey Orlando <joey.orlando@grafana.com>
Co-authored-by: Joey Orlando <joseph.t.orlando@gmail.com>
Co-authored-by: Ildar Iskhakov <Ildar.iskhakov@grafana.com>
2023-11-17 02:31:27 +00:00