Commit graph

3028 commits

Author SHA1 Message Date
Vadim Stepanov
6caacf4048
Handle Slack ratelimit on alert group deletion (#3038)
# What this PR does

- gracefully retry
`apps.alerts.tasks.delete_alert_group.delete_alert_group` when hitting
Slack ratelimits
- remove Slack messages from the DB as soon as they are deleted from
Slack, so the tasks are not retrying perpetually

## 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-09-19 08:41:47 +00:00
Matias Bordese
78849d2e43
Fix returned shift PK in current user events endpoint (#3036) 2023-09-18 17:49:21 +00:00
github-actions[bot]
69fcb58408
Update make docs procedure (#3033)
Co-authored-by: grafanabot <bot@grafana.com>
Co-authored-by: Jack Baldry <jack.baldry@grafana.com>
2023-09-18 09:39:26 +00:00
Linhua Tan
0c7281a255
Fix Slack access token length issue (#3016)
# What this PR does

fix the following error caused by too short varchar length of database
fields `access_token` and `bot_access_token` in table
`slack_slackteamidentity`

```
2023-09-12 18:34:07.448 | django.db.utils.DataError: value too long for type character varying(100) |  
-- | -- | --
  |   | 2023-09-12 18:34:07.448 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |  
  |   | 2023-09-12 18:34:07.448 | return self.cursor.execute(sql, params) |  
  |   | 2023-09-12 18:34:07.448 | File "/usr/local/lib/python3.11/site-packages/django/db/backends/utils.py", line 84, in _execute |  
  |   | 2023-09-12 18:34:07.448 | raise dj_exc_value.with_traceback(traceback) from exc_value |  
  |   | 2023-09-12 18:34:07.448 | File "/usr/local/lib/python3.11/site-packages/django/db/utils.py", line 90, in __exit__ |  
  |   | 2023-09-12 18:34:07.448 | with self.db.wrap_database_errors: |  
  |   | 2023-09-12 18:34:07.447 | File "/usr/local/lib/python3.11/site-packages/django/db/backends/utils.py", line 79, in _execute |  
  |   | 2023-09-12 18:34:07.447 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |  
  |   | 2023-09-12 18:34:07.447 | return executor(sql, params, many, context) |  
  |   | 2023-09-12 18:34:07.447 | File "/usr/local/lib/python3.11/site-packages/django/db/backends/utils.py", line 75, in _execute_with_wrappers |  
  |   | 2023-09-12 18:34:07.447 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |  
  |   | 2023-09-12 18:34:07.447 | return self._execute_with_wrappers(sql, params, many=False, executor=self._execute) |  
  |   | 2023-09-12 18:34:07.447 | File "/usr/local/lib/python3.11/site-packages/django/db/backends/utils.py", line 66, in execute |  
  |   | 2023-09-12 18:34:07.447 | cursor.execute(sql, params) |  
  |   | 2023-09-12 18:34:07.447 | File "/usr/local/lib/python3.11/site-packages/django/db/models/sql/compiler.py", line 1175, in execute_sql |  
  |   | 2023-09-12 18:34:07.447 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |  
  |   | 2023-09-12 18:34:07.447 | cursor = super().execute_sql(result_type) |  
  |   | 2023-09-12 18:34:07.447 | File "/usr/local/lib/python3.11/site-packages/django/db/models/sql/compiler.py", line 1559, in execute_sql |  
  |   | 2023-09-12 18:34:07.447 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |  
  |   | 2023-09-12 18:34:07.447 | return query.get_compiler(self.db).execute_sql(CURSOR) |  
  |   | 2023-09-12 18:34:07.447 | File "/usr/local/lib/python3.11/site-packages/django/db/models/query.py", line 802, in _update |  
  |   | 2023-09-12 18:34:07.447 | ^^^^^^^^^^^^^^^^^^^^^^^^ |  
  |   | 2023-09-12 18:34:07.447 | return filtered._update(values) > 0 |  
  |   | 2023-09-12 18:34:07.447 | File "/usr/local/lib/python3.11/site-packages/django/db/models/base.py", line 912, in _do_update |  
  |   | 2023-09-12 18:34:07.447 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |  
  |   | 2023-09-12 18:34:07.447 | updated = self._do_update(base_qs, using, pk_val, values, update_fields, |  
  |   | 2023-09-12 18:34:07.447 | File "/usr/local/lib/python3.11/site-packages/django/db/models/base.py", line 858, in _save_table |  
  |   | 2023-09-12 18:34:07.447 | ^^^^^^^^^^^^^^^^^ |  
  |   | 2023-09-12 18:34:07.447 | updated = self._save_table( |  
  |   | 2023-09-12 18:34:07.447 | File "/usr/local/lib/python3.11/site-packages/django/db/models/base.py", line 776, in save_base |  
  |   | 2023-09-12 18:34:07.447 | self.save_base(using=using, force_insert=force_insert, |  
  |   | 2023-09-12 18:34:07.447 | File "/usr/local/lib/python3.11/site-packages/django/db/models/base.py", line 739, in save |  
  |   | 2023-09-12 18:34:07.447 | self.save() |  
  |   | 2023-09-12 18:34:07.447 | File "/etc/app/apps/slack/models/slack_team_identity.py", line 72, in update_oauth_fields |  
  |   | 2023-09-12 18:34:07.447 | slack_team_identity.update_oauth_fields(user, organization, response) |  
  |   | 2023-09-12 18:34:07.447 | File "/etc/app/apps/social_auth/pipeline.py", line 102, in populate_slack_identities |  
  |   | 2023-09-12 18:34:07.447 | ^^^^^^^^^^^^^^^^^^ |  
  |   | 2023-09-12 18:34:07.447 | result = func(*args, **out) or {} |  
  |   | 2023-09-12 18:34:07.447 | File "/usr/local/lib/python3.11/site-packages/social_core/backends/base.py", line 118, in run_pipeline |  
  |   | 2023-09-12 18:34:07.447 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |  
  |   | 2023-09-12 18:34:07.447 | out = self.run_pipeline(pipeline, pipeline_index, *args, **kwargs) |  
  |   | 2023-09-12 18:34:07.447 | File "/usr/local/lib/python3.11/site-packages/social_core/backends/base.py", line 86, in pipeline |  
  |   | 2023-09-12 18:34:07.447 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |  
  |   | 2023-09-12 18:34:07.447 | return self.pipeline(pipeline, *args, **kwargs) |  
  |   | 2023-09-12 18:34:07.447 | File "/usr/local/lib/python3.11/site-packages/social_core/backends/base.py", line 83, in authenticate |  
  |   | 2023-09-12 18:34:07.447 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |  
  |   | 2023-09-12 18:34:07.447 | user = backend.authenticate(request, **credentials) |  
  |   | 2023-09-12 18:34:07.447 | File "/usr/local/lib/python3.11/site-packages/django/contrib/auth/__init__.py", line 76, in authenticate |  
  |   | 2023-09-12 18:34:07.447 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |  
  |   | 2023-09-12 18:34:07.447 | return func(*func_args, **func_kwargs) |  
  |   | 2023-09-12 18:34:07.447 | File "/usr/local/lib/python3.11/site-packages/django/views/decorators/debug.py", line 42, in sensitive_variables_wrapper |  
  |   | 2023-09-12 18:34:07.447 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |  
  |   | 2023-09-12 18:34:07.447 | return authenticate(*args, **kwargs) |  
  |   | 2023-09-12 18:34:07.447 | File "/usr/local/lib/python3.11/site-packages/social_django/strategy.py", line 105, in authenticate |  
  |   | 2023-09-12 18:34:07.447 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |  
  |   | 2023-09-12 18:34:07.447 | return self.strategy.authenticate(*args, **kwargs) |  
  |   | 2023-09-12 18:34:07.447 | File "/etc/app/apps/social_auth/backends.py", line 100, in do_auth |  
  |   | 2023-09-12 18:34:07.447 | ^^^^^^^^^^^^^^^^^^^^^ |  
  |   | 2023-09-12 18:34:07.447 | return func(*args, **kwargs) |  
  |   | 2023-09-12 18:34:07.447 | File "/usr/local/lib/python3.11/site-packages/social_core/utils.py", line 253, in wrapper |  
  |   | 2023-09-12 18:34:07.447 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |  
  |   | 2023-09-12 18:34:07.447 | return self.do_auth(access_token, response=response, *args, **kwargs) |  
  |   | 2023-09-12 18:34:07.447 | File "/etc/app/apps/social_auth/backends.py", line 88, in auth_complete |  
  |   | 2023-09-12 18:34:07.447 | ^^^^^^^^^^^^^^^^^^^^^ |  
  |   | 2023-09-12 18:34:07.447 | return func(*args, **kwargs) |  
  |   | 2023-09-12 18:34:07.447 | File "/usr/local/lib/python3.11/site-packages/social_core/utils.py", line 253, in wrapper |  
  |   | 2023-09-12 18:34:07.447 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |  
  |   | 2023-09-12 18:34:07.447 | return self.auth_complete(*args, **kwargs) |  
  |   | 2023-09-12 18:34:07.447 | File "/usr/local/lib/python3.11/site-packages/social_core/backends/base.py", line 39, in complete |  
  |   | 2023-09-12 18:34:07.447 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |  
  |   | 2023-09-12 18:34:07.447 | user = backend.complete(user=user, *args, **kwargs) |  
  |   | 2023-09-12 18:34:07.447 | File "/usr/local/lib/python3.11/site-packages/social_core/actions.py", line 49, in do_complete |  
  |   | 2023-09-12 18:34:07.447 | ^^^^^^^^^^^^ |  
  |   | 2023-09-12 18:34:07.447 | result = do_complete( |  
  |   | 2023-09-12 18:34:07.447 | File "/etc/app/apps/api/views/auth.py", line 52, in overridden_complete_slack_auth |  
  |   | 2023-09-12 18:34:07.447 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |  
  |   | 2023-09-12 18:34:07.447 | return func(request, backend, *args, **kwargs) |  
  |   | 2023-09-12 18:34:07.447 | File "/usr/local/lib/python3.11/site-packages/social_django/utils.py", line 46, in wrapper |  
  |   | 2023-09-12 18:34:07.447 | ^^^^^^^^^^^^^^^^^^^^^^^^^^ |  
  |   | 2023-09-12 18:34:07.447 | return view_func(*args, **kwargs) |  
  |   | 2023-09-12 18:34:07.447 | File "/usr/local/lib/python3.11/site-packages/django/views/decorators/csrf.py", line 54, in wrapped_view |  
  |   | 2023-09-12 18:34:07.447 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |  
  |   | 2023-09-12 18:34:07.447 | response = view_func(request, *args, **kwargs) |  
  |   | 2023-09-12 18:34:07.447 | File "/usr/local/lib/python3.11/site-packages/django/views/decorators/cache.py", line 44, in _wrapped_view_func |  
  |   | 2023-09-12 18:34:07.447 | ^^^^^^^^^^^^^^^^^^^^^ |  
  |   | 2023-09-12 18:34:07.447 | return func(*args, **kwargs) |  
  |   | 2023-09-12 18:34:07.447 | File "/usr/local/lib/python3.11/site-packages/rest_framework/decorators.py", line 50, in handler |  
  |   | 2023-09-12 18:34:07.447 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |  
  |   | 2023-09-12 18:34:07.447 | response = handler(request, *args, **kwargs) |  
  |   | 2023-09-12 18:34:07.447 | File "/usr/local/lib/python3.11/site-packages/rest_framework/views.py", line 506, in dispatch |  
  |   | 2023-09-12 18:34:07.447 | raise exc |  
  |   | 2023-09-12 18:34:07.447 | File "/usr/local/lib/python3.11/site-packages/rest_framework/views.py", line 480, in raise_uncaught_exception |  
  |   | 2023-09-12 18:34:07.447 | self.raise_uncaught_exception(exc) |  
  |   | 2023-09-12 18:34:07.447 | File "/usr/local/lib/python3.11/site-packages/rest_framework/views.py", line 469, in handle_exception |  
  |   | 2023-09-12 18:34:07.447 | ^^^^^^^^^^^^^^^^^^^^^^^^^^ |  
  |   | 2023-09-12 18:34:07.447 | response = self.handle_exception(exc) |  
  |   | 2023-09-12 18:34:07.447 | File "/usr/local/lib/python3.11/site-packages/rest_framework/views.py", line 509, in dispatch |  
  |   | 2023-09-12 18:34:07.447 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |  
  |   | 2023-09-12 18:34:07.447 | return self.dispatch(request, *args, **kwargs) |  
  |   | 2023-09-12 18:34:07.447 | File "/usr/local/lib/python3.11/site-packages/django/views/generic/base.py", line 70, in view |  
  |   | 2023-09-12 18:34:07.447 | ^^^^^^^^^^^^^^^^^^^^^^^^^^ |  
  |   | 2023-09-12 18:34:07.447 | return view_func(*args, **kwargs) |  
  |   | 2023-09-12 18:34:07.447 | File "/usr/local/lib/python3.11/site-packages/django/views/decorators/csrf.py", line 54, in wrapped_view |  
  |   | 2023-09-12 18:34:07.447 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |  
  |   | 2023-09-12 18:34:07.447 | response = wrapped_callback(request, *callback_args, **callback_kwargs) |  
  |   | 2023-09-12 18:34:07.447 | File "/usr/local/lib/python3.11/site-packages/django/core/handlers/base.py", line 181, in _get_response |  
  |   | 2023-09-12 18:34:07.447 | ^^^^^^^^^^^^^^^^^^^^^ |  
  |   | 2023-09-12 18:34:07.447 | response = get_response(request) |  
  |   | 2023-09-12 18:34:07.447 | File "/usr/local/lib/python3.11/site-packages/django/core/handlers/exception.py", line 47, in inner |  
  |   | 2023-09-12 18:34:07.447 | Traceback (most recent call last): |  
  |   | 2023-09-12 18:34:07.447 |   |  
  |   | 2023-09-12 18:34:07.447 | The above exception was the direct cause of the following exception: |  
  |   | 2023-09-12 18:34:07.447 |   |  
  |   | 2023-09-12 18:34:07.447 |   |  
  |   | 2023-09-12 18:34:07.447 | psycopg2.errors.StringDataRightTruncation: value too long for type character varying(100) |  
  |   | 2023-09-12 18:34:07.447 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |  
  |   | 2023-09-12 18:34:07.447 | return self.cursor.execute(sql, params) |  
  |   | 2023-09-12 18:34:07.447 | File "/usr/local/lib/python3.11/site-packages/django/db/backends/utils.py", line 84, in _execute |  
  |   | 2023-09-12 18:34:07.447 | Traceback (most recent call last): |  
  |   | 2023-09-12 18:34:07.447 | 2023-09-12 10:34:07 source=engine:app google_trace_id=50a15245db9b828e0ab33e8d115dd10a/3838538413005063100 logger=django.request Internal Server Error: /api/internal/v1/complete/slack-install-free/
```

---------

Co-authored-by: Vadim Stepanov <vadimkerr@gmail.com>
2023-09-13 11:53:17 +01:00
Vadim Stepanov
8729d8f3da
formatting fixes (#3019) 2023-09-13 11:49:18 +01:00
Ildar Iskhakov
2d9b4cf1a3
Update README.md (#3007)
# 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-09-13 11:09:39 +08:00
Vadim Stepanov
bd0009fcea
Fix "Replied message not found" Telegram bug (#3013)
# What this PR does

Fixes https://github.com/grafana/oncall-private/issues/2154

## 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-09-12 15:55:13 +00:00
Matias Bordese
7c52c11543
Add render_for_web information to alert group incident API (#3005)
Include alert group render_for_web details in the API response.

Related to https://github.com/grafana/oncall-private/issues/2159
2023-09-12 12:02:42 +00:00
Vadim Stepanov
74de4ecba6
v1.3.37 changelog (#3009) 2023-09-12 11:18:28 +01:00
Vadim Stepanov
8b2212c7dc
Improve Slack error handling (#3000)
# What this PR does

- Rename `SlackClientWithErrorHandling` to just `SlackClient`
- Add more error classes + improve the way errors are raised based on
the Slack error code
- Add API call retries on Slack server errors (e.g. when Slack returns
`5xx` errors)
- Refactor some methods working with Slack API + add tests

## Which issue(s) this PR fixes

- https://github.com/grafana/oncall-private/issues/1837
- https://github.com/grafana/oncall-private/issues/1840
- https://github.com/grafana/oncall-private/issues/1842

## 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-09-12 09:49:16 +00:00
Matias Bordese
14c32a74bf
Trigger alert group signal after transaction commit (#3001)
See
https://docs.djangoproject.com/en/4.2/topics/db/transactions/#performing-actions-after-commit

Related to https://github.com/grafana/oncall-private/issues/2015
2023-09-11 14:28:37 +00:00
Matias Bordese
9c3979a712
Update escalation policies public API to handle new webhooks (#2999)
Support new webhooks when creating or updating.
Return existing information if still using previous custom button
actions.

Fixed  #2998
2023-09-11 10:50:18 -03:00
Matias Bordese
971384b50e
Update internal alert group details API docs (#2995)
Related to https://github.com/grafana/oncall/issues/2982
2023-09-11 13:25:00 +00:00
Joey Orlando
4b0bb86ce4
Notify user when their shift swap request is taken (#2992)
# What this PR does

Closes #2868

**Slack thread message**
<img width="442" alt="Screenshot 2023-09-07 at 15 47 30"
src="https://github.com/grafana/oncall/assets/9406895/f8f39341-4d18-4a43-88be-066993275fcd">

**Push notification**
Clicking on the push notification goes to the SSR detail view

<img width="423" alt="Screenshot 2023-09-07 at 15 48 59"
src="https://github.com/grafana/oncall/assets/9406895/5bb0fbf3-3e55-47e3-bf24-9cb5690dc17c">


## 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-09-07 14:59:54 +00:00
Vadim Stepanov
b944a2206f
v1.3.36 changelog 2023-09-07 14:07:05 +01:00
Matias Bordese
bf4d948449
Update slack schedule shift change notification (#2949)
Related to https://github.com/grafana/oncall/issues/2916

Updated notification:

![slack-shift-notification](https://github.com/grafana/oncall/assets/260710/825fda59-6636-44c1-9740-8976e7c109a7)
2023-09-07 13:00:12 +00:00
Matias Bordese
afc3b193f6
Update insight logs for shift swaps requests (#2987) 2023-09-07 11:49:33 +00:00
Bob Cotton
6c8344a82d
Use Tilt for local development (#1396)
# What this PR does

PR adds Tilt for local development

## Which issue(s) this PR fixes

## Checklist

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

---------

Co-authored-by: Joey Orlando <joseph.t.orlando@gmail.com>
Co-authored-by: Ildar Iskhakov <Ildar.iskhakov@grafana.com>
Co-authored-by: Michael Derynck <michael.derynck@grafana.com>
Co-authored-by: Joey Orlando <joey.orlando@grafana.com>
2023-09-07 19:38:19 +08:00
Vadim Stepanov
0d7352a17b
Fix handling Slack rate limits (#2991)
## Which issue(s) this PR fixes

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

## 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-09-07 11:25:29 +00:00
Vadim Stepanov
d90cf0f593
Fix Slack integration leftovers after disconnecting (#2986)
# What this PR does

Improve Slack disconnect cleanup:
- Reset Slack user group for schedules
- Reset Slack user identity for deleted users

## Which issue(s) this PR fixes

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

## 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-09-07 08:42:30 +00:00
Vadim Stepanov
31759fdf80
Don't update Slack user groups for deleted organizations (#2985)
# What this PR does

Make sure that Slack user groups are not getting updated for deleted
orgs.
Without this change, there could be issues with backends in multiple
clusters trying to update a single Slack user group after migrating an
org to another cluster (organizations get soft deleted from the original
cluster after migration).

## Which issue(s) this PR fixes

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

## 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-09-06 16:02:01 +00:00
Vadim Stepanov
017b22b905
Enable email notification step by default on Helm (#2975)
# What this PR does

Set `oncall.smtp.enabled` to `true` by default to enable email
notifications on Helm deployments.
Email notifications are enabled by default on docker-compose deployments
already: see [this feature
flag](df6f6183ec/engine/settings/base.py (L63)).

## Which issue(s) this PR fixes

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

## 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-09-06 15:23:53 +01:00
Matias Bordese
5b052afb36
Handle slack resolution note errors consistently (#2976) 2023-09-06 12:15:28 +00:00
Rares Mardare
cc8d6ad0e2
Allow creation of contact points for existing integrations (#2959)
## Which issue(s) this PR fixes

#2909
2023-09-05 17:32:02 +03:00
Joey Orlando
415e25c8c1
Update CHANGELOG.md 2023-09-05 14:34:08 +02:00
Joey Orlando
0d30a9ee67
Merge branch 'dev' of github.com:grafana/oncall into dev 2023-09-05 14:32:34 +02:00
Joey Orlando
3f9d392be9
address another slack-sdk issue 2023-09-05 14:32:28 +02:00
Joey Orlando
293eff2325
fix slack-sdk issue (#2969)
<img width="1488" alt="Screenshot 2023-09-05 at 12 59 16"
src="https://github.com/grafana/oncall/assets/9406895/61518425-da47-4363-8400-fc46b043f64f">


[logs](https://ops.grafana-ops.net/explore?panes=%7B%22FZ0%22:%7B%22datasource%22:%22000000193%22,%22queries%22:%5B%7B%22refId%22:%22A%22,%22expr%22:%22%7Bcluster%3D~%5C%22%28prod-us-central-0%7Cprod-eu-west-0%7Cops-us-east-0%29%5C%22,%20namespace%3D~%5C%22amixr-%28staging%7Cprod%29%5C%22%7D%20%7C%3D%20%60KeyError%28%27cursor%27%60%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-6h%22,%22to%22:%22now%22%7D%7D%7D&schemaVersion=1&orgId=1)
2023-09-05 13:06:22 +02:00
Yulya Artyukhina
6ff61ad172
Fix escalation step "Notify if num alerts in time window" (#2965)
# What this PR does
Fix escalation step "Notify if num alerts in time window" when
escalation policy was deleted during the escalation

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

## 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-09-05 10:32:59 +00:00
Joey Orlando
395977d934
fix issue with slack_sdk call update (#2966)
# What this PR does

## 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-09-05 12:25:11 +02:00
Joey Orlando
8e1962e89a
Update CHANGELOG.md 2023-09-05 11:32:24 +02:00
Joey Orlando
a9155130df
update slack_sdk dependency to latest version (#2947)
# What this PR does

- update `slackclient` dependency to latest version. The version we were
using was 5 years old 😲
- first followed the v2 migration guide
[here](https://github.com/slackapi/python-slack-sdk/wiki/Migrating-to-2.x)
followed by the v3 migration guide
[here](https://slack.dev/python-slack-sdk/v3-migration/). The main
changes were:
    - The PyPI project was renamed from `slackclient` to `slack_sdk`
- it is discouraged/harder to call `api_call` and encouraged to call the
helper methods (ex. `chat_postMessage`;
[note](https://github.com/slackapi/python-slack-sdk/wiki/Migrating-to-2.x#web-client-api-changes)
in migration guide docs)
- In 1.x, a failed api call would return the error payload to you and
have you handle the error. In 2.x, a failed api call will throw an
exception. To handle this in your code, you will have to wrap api calls
with a try except block. Since we overload `WebClient.api_call` this was
an easy change and only required a one line change
- remove `apps.slack.slack_client.slack_server.SlackClientServer` class.
The new version of `slack_sdk` handles the case that we needed to
overload for in the first place.
- merged `apps/slack/slack_client/slack_client.py` and
`apps/slack/slack_client/exceptions.py` into `apps/slack/client.py`

## 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-09-05 11:31:59 +02:00
Matias Bordese
0dea5661c4
Reject file uploads when posting to an integration endpoint (#2958)
Related to https://github.com/grafana/oncall-private/issues/2145

---------

Co-authored-by: Joey Orlando <joey.orlando@grafana.com>
2023-09-05 10:01:50 +02:00
Yulya Artyukhina
ecb4ba0057
Add endpoint for getting schedules events for current user (#2928)
# What this PR does

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

## 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-09-05 07:22:08 +00:00
Vadim Stepanov
a2851d3f81
Refactor AlertGroup.slack_message (#2957)
# What this PR does

Refactors the foreign key relationship between `AlertGroup` and
`SlackMessage` models (see
https://github.com/grafana/oncall-private/issues/1867 for more info).

## Which issue(s) this PR fixes

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

## 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-09-04 18:03:18 +00:00
Matias Bordese
38a3326c56
Remove IRM plan references from plugin (#2848)
Co-authored-by: Joey Orlando <joey.orlando@grafana.com>
2023-09-04 12:15:13 +00:00
Yulya Artyukhina
44edd50551
Update CHANGELOG.md 2023-09-04 14:07:38 +02:00
github-actions[bot]
4a53df0c9b
Update make docs procedure (#2952)
Co-authored-by: grafanabot <bot@grafana.com>
Co-authored-by: Jack Baldry <jack.baldry@grafana.com>
2023-09-04 11:47:17 +00:00
Yulya Artyukhina
cc92c53f84
Fix build escalation snapshot (#2954)
# What this PR does
Fix escalation snapshot building if last notified user in escalation
step "Notify users one by one (round-robin)" was deleted
 
## Which issue(s) this PR fixes
https://github.com/grafana/oncall-private/issues/2148

## 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-09-04 11:10:28 +00:00
Vadim Stepanov
f7bdcf3d36
Fix SlackMessage._alert_group issue (#2945)
# What this PR does

Fixes  https://github.com/grafana/oncall-private/issues/2091

## 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-09-01 14:47:10 +00:00
Rares Mardare
88c5338ea1
Fix cloud plugin install not refreshing (#2932)
# What this PR does

## Which issue(s) this PR fixes

#2874

## 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-09-01 17:40:31 +03:00
Joey Orlando
5c189c8059
add create_slack_connector_async_v2 celery task to CELERY_TASK_ROUTES + remove deprecated celery tasks (#2946)
# What this PR does
- add `common.oncall_gateway.tasks.create_slack_connector_async_v2`
celery task to `CELERY_TASK_ROUTES`
- remove two deprecated tasks in `common.oncall_gateway.tasks`

## 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-09-01 13:40:58 +00:00
Yulya Artyukhina
e472b03e1d
Remove deprecated alerting integration tasks (#2944)
# What this PR does
These celery tasks have not been used for more than one week (since
[v1.3.25](https://github.com/grafana/oncall/releases/tag/v1.3.25) which
released an improvement for Grafana Alerting integration)

## 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)
2023-09-01 13:11:02 +00:00
Joey Orlando
619cb42a3a
Remove apps.mobile_app.tasks.notify_user_async celery task (#2942)
# What this PR does

This task was renamed in a v1.3.30. It is no longer referenced and there
are no pending tasks in production queues:
![Screenshot 2023-09-01 at 09 35
45](https://github.com/grafana/oncall/assets/9406895/0f7149bd-efe3-401e-ac94-a664af67472a)



## 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)
2023-09-01 11:54:37 +00:00
Yulya Artyukhina
361d45dd02
Clean up check escalation finished task (#2943)
# What this PR does
Clean up check escalation finished task, update description

## 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)
2023-09-01 10:48:47 +00:00
Maxim Mordasov
585bbe486a
Add swift swaps requests visualisation to schedule (#2881)
# What this PR does

Add swift swaps requests visualisation to schedule

## Which issue(s) this PR fixes

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

## 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-09-01 10:18:16 +00:00
Joey Orlando
1d089aa7a3
fix IntegrityErrors occuring when creating ResolutionNoteSlackMessage objects (#2933)
# What this PR does

## Which issue(s) this PR fixes

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

## 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-09-01 08:14:59 +00:00
Joey Orlando
73da83274a
Update Shift Swap Request Slack message formatting (#2918)
# What this PR does

Updates Shift Swap Request Slack message formatting to be consistent
with UI mockups:

**New Request**
![Screenshot 2023-08-30 at 12 18
54](https://github.com/grafana/oncall/assets/9406895/712a13e2-b768-4be6-b066-c5daa98446eb)

**Accepted**
![Screenshot 2023-08-30 at 12 19
41](https://github.com/grafana/oncall/assets/9406895/84d14adf-bb48-4ba8-bee2-eb7931ef2d55)


**Deleted**
![Screenshot 2023-08-30 at 12 19
01](https://github.com/grafana/oncall/assets/9406895/9bda06c8-5ce7-405b-9303-b160eac4d635)


## 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-09-01 07:53:27 +02:00
Simon Crute
15e02c7f30
Remove duplicate line (#2934)
remove duplicate line in first example.

# 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-08-31 13:15:27 -06:00
Michael Derynck
56c0c023ad
Test celery tasks have queue assignment (#2922)
# What this PR does

- Add a test to ensure celery tasks are assigned to a queue
- Move CELERY_TASK_ROUTES out of settings into its own file for easier
reuse and reference.

## 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-08-31 18:42:08 +00:00