oncall-engine/engine/apps/slack
Yulya Artyukhina adfb496a81
Fix slack channels sync (#2571)
# What this PR does
- Fixes issue with slack channels sync periodic tasks when we get slack
rate limit exception.
- Adds check for active task id to avoid starting multiple tasks for one
slack team.

Collecting channels for slack for some teams causes rate limit
exception, which causes the task to restart and start collecting slack
channels from the beginning. This PR adds new paginated api call and
refactors the slack channel sync task to continue collect data after
rate limit from the step before it was raised using `cursor` value from
the slack response.


## 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>
2023-07-19 07:17:21 +00:00
..
migrations remove SlackActionRecord model/table (#2201) 2023-06-13 10:56:06 +00:00
models re-enable mypy GitHub Actions CI job (#2390) 2023-06-29 14:01:52 +00:00
representatives remove references to AlertGroup.is_archived and AlertGroup.unarchived_objects (#2524) 2023-07-18 11:48:34 +00:00
scenarios remove references to AlertGroup.is_archived and AlertGroup.unarchived_objects (#2524) 2023-07-18 11:48:34 +00:00
slack_client Fix slack channels sync (#2571) 2023-07-19 07:17:21 +00:00
templates/admin World, meet OnCall! 2022-06-03 08:09:47 -06:00
tests Fix slack channels sync (#2571) 2023-07-19 07:17:21 +00:00
__init__.py World, meet OnCall! 2022-06-03 08:09:47 -06:00
admin.py remove SlackActionRecord model/table (#2201) 2023-06-13 10:56:06 +00:00
alert_group_slack_service.py Cleanup ScenarioStep (#1213) 2023-02-21 20:22:11 +01:00
constants.py continue addressing mypy violations (#2170) 2023-06-27 10:23:08 +00:00
slack_formatter.py continue addressing mypy violations (#2170) 2023-06-27 10:23:08 +00:00
tasks.py Fix slack channels sync (#2571) 2023-07-19 07:17:21 +00:00
urls.py World, meet OnCall! 2022-06-03 08:09:47 -06:00
utils.py Fix slack channels sync (#2571) 2023-07-19 07:17:21 +00:00
views.py Update Slack "invite" feature to use direct paging (#2562) 2023-07-18 08:36:11 +00:00