Commit graph

2160 commits

Author SHA1 Message Date
Matias Bordese
b62687295d
Fix teams filter related issue setting maintenance mode (#1885)
Related to https://github.com/grafana/support-escalations/issues/5862
2023-05-05 18:09:25 +00:00
Joey Orlando
bb3521b879
upgrade to python 3.11.3 (#1849)
# What this PR does

Upgrades the backend to Python 3.11.3 (latest stable release) + update
linting step on Drone builds to run **all** the linting steps, not just
the Python ones.

## 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)
- [x] `CHANGELOG.md` updated (or `pr:no changelog` PR label added if not
required)
2023-05-05 15:32:40 +00:00
Ildar Iskhakov
a61b0d8b3d
Use the correct description (#1883)
# 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-05-05 17:52:45 +08:00
Oleg Zaytsev
41f7c23c65
Fix and tidy alertmanager heartbeat template (#1865)
# What this PR does


There was an unnecessary indentation in the `rules:` key which made it
invalid YAML.

Also replaced the mentions to Amixr with Grafana OnCall, used some
`<code>` tags and reworded some sentences.

Also removed the anchor tag from the webhook link: we don't want people
to follow that in their browser, we want them to copy it

## Result screenshot


![image](https://user-images.githubusercontent.com/1511481/236173565-b5201b81-4d69-4d0b-944a-a2106f8fbab3.png)

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

---------

Signed-off-by: Oleg Zaytsev <mail@olegzaytsev.com>
Co-authored-by: Joey Orlando <joey.orlando@grafana.com>
2023-05-05 00:25:05 +00:00
Joey Orlando
620f69e409
"You're Going OnCall" mobile app push notification (#1814)
# What this PR does

https://www.loom.com/share/c5deb35309604cfdab6176c44de7b15e

## 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-05-04 16:59:57 +00:00
Matias Bordese
311e5209f1
Add make a copy action for advanced webhooks (#1852) 2023-05-04 16:50:48 +00:00
Vadim Stepanov
a43a5604ed
Update CHANGELOG.md 2023-05-04 17:48:10 +01:00
Joey Orlando
2879537c30
properly parse grafana cloud feature toggles (#1880)
# What this PR does

## 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) (N/A)
- [x] `CHANGELOG.md` updated (or `pr:no changelog` PR label added if not
required)
2023-05-04 16:38:26 +00:00
Vadim Stepanov
e2901a335b
Pin requests and urllib3 (#1881)
[v1.2.18](https://github.com/grafana/oncall/releases/tag/v1.2.18) has
some issues with parsing responses from Slack due to using
`requests==2.30.0`, so pinning `requests` and `urllib3` to latest stable
versions from
[v1.2.17](https://github.com/grafana/oncall/releases/tag/v1.2.17).
2023-05-04 16:32:34 +00:00
Rares Mardare
02712e9b10
Minor tweaks to Tag component (#1866)
# What this PR does

Minor UI Tweaks after releasing the grouping&templating changes
2023-05-04 10:42:35 +00:00
Ildar Iskhakov
0a02b21886
Add pagination to integrations page (#1872)
# 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-05-04 13:48:46 +08:00
Ildar Iskhakov
fc16d3849b
Add route_template to preview_template endpoint (#1873)
# What this PR does

Add payload field to
api/internal/v1/alert_receive_channels/***/preview_template/ POST
endpoint
```
curl 'http://localhost:3000/api/plugin-proxy/grafana-oncall-app/api/internal/v1/alert_receive_channels/***/preview_template/' \
  -H 'Content-Type: application/json' \
  --data-raw '{"template_name":"route_template","template_body":"{{ payload.foo }}", "payload": {"foo": "bar"}}' \
  --compressed
```
## 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-05-04 13:40:48 +08:00
Ildar Iskhakov
c7c26cb693
Clean commented code (#1875)
# 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-05-04 13:36:51 +08:00
Ildar Iskhakov
c5c3ab1006
Rewrite texts for ~Connectivity~ Notification Warning (#1871)
# What this PR does

This PR rewrites the misleading warning:
<img width="979" alt="Screenshot 2023-05-04 at 9 50 45 AM"
src="https://user-images.githubusercontent.com/2262529/236093917-10f20e6e-f24c-43b6-ab62-44aa3fdd1b86.png">



## 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-05-04 13:34:28 +08:00
Ildar Iskhakov
be35e579ed
Add routes_count and connected_escalations_chains_count to alert_rece… (#1874)
…ive_channels endpoint

# 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-05-04 13:31:48 +08:00
Matias Bordese
7cf0c4f693
Update ical comparison to check only for event components (#1870)
May be related to https://github.com/grafana/oncall/issues/1553.

We got feedback about that happening for Google Calendar imported icals.
Google Calendar exported ics URL was returning different VTIMEZONE
components on different requests, triggering differences in the imported
ical. Updated the comparison to only consider events (while keep
assuming the sequence will reflect if there are any particular event
change).
2023-05-03 20:24:10 +00:00
Vadim Stepanov
ab74cd7655
Update CHANGELOG.md 2023-05-03 17:13:33 +01:00
Matvey Kukuy
bf4efb879a
grafana -> Grafana (#1867) 2023-05-03 15:51:15 +00:00
Yulia Shanyrova
b10b589f72
Main Grouping&Templating PR fro all frontend changes (#1731)
# What this PR does
Main Grouping&Templating PR fro all frontend changes:
Includes:

1. Integration table view
2. Integration form using Drawer component
3. Integration landing page with routes/escalation chains
4. Templates
5. Groupong

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

---------

Co-authored-by: Rares Mardare <rares.mardare@grafana.com>
Co-authored-by: Ildar Iskhakov <ildar.iskhakov@grafana.com>
2023-05-03 17:51:45 +03:00
Vadim Stepanov
d198b932c1
Zendesk inbound integration docs (#1860)
# What this PR does
Add docs & logo for Zendesk integration. Main PR in private repo:
https://github.com/grafana/oncall-private/pull/1772

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

## 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] No changelog (Zendesk integration will be only available in cloud)
2023-05-03 11:38:07 +01:00
Innokentii Konstantinov
cf11e96fe2
Handle invitation button press (#1863)
# What this PR does
Handles case when user press "Go to alert group" button in DM with bot.
2023-05-03 08:19:56 +00:00
Michael Derynck
0d8714dc5c
Update CHANGELOG.md 2023-05-02 15:20:05 -06:00
Matias Bordese
ad39bbf11f
Remove schedule name uniqueness restriction (#1859)
Related to https://github.com/grafana/oncall/issues/1452
2023-05-02 17:16:03 +00:00
Joey Orlando
0d4db59137
Add "Notifications Receiver" RBAC role (#1853)
# What this PR does

Closes #1651 

Plus, add developer instructions on how to run `grafana-enterprise` with
RBAC for OnCall, enabled locally.

## Todo

- [x] add API integration test for new `permission` query param filter

## 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-05-02 12:19:34 +00:00
Vadim Stepanov
50eb1fed5d
Jira inbound integration docs (#1842)
# What this PR does
Add docs & logo for Jira integration. Main PR in private repo:
https://github.com/grafana/oncall-private/pull/1769

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

## 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] No changelog (Jira integration will be only available in cloud)
2023-05-02 09:37:49 +00:00
Ildar Iskhakov
14b692674a
Fix bugs in web title and message templates rendering and visual representation (#1747)
# 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-05-02 16:57:52 +08:00
Ildar Iskhakov
071e3c6b1b
Remove template editor from Slack (#1847)
# What this PR does
<img width="521" alt="Screenshot 2023-04-28 at 5 36 10 PM"
src="https://user-images.githubusercontent.com/2262529/235112636-56fe0b48-1cda-4ba7-8a09-1cfb0ced2222.png">

## 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-05-02 14:06:20 +08:00
Ildar Iskhakov
bb34ba485b
Add filter descriptions (#1845)
# What this PR does
<img width="954" alt="Screenshot 2023-04-28 at 9 33 16 AM"
src="https://user-images.githubusercontent.com/2262529/235033175-6a94ffb2-3a39-4730-b855-5b1c5dff8fda.png">


## 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-05-02 13:50:03 +08:00
Michael Derynck
6a08fdc145
Do not retry start_sync_organization (#1856)
start_sync_organization is scheduled to run every 30 mins. Countdown is
not specified so the default countdown with exponential backoff will
result in retries happening after the next 30 min trigger. If it is in a
state where it is retrying for a long period of time (>30 mins) it will
stack up too many redundant sync_organization_async tasks when it
finally does succeed.
2023-05-02 02:33:26 +00:00
Michael Derynck
fdac018948
Update dev directory .gitignore (#1850) 2023-04-28 15:51:58 +00:00
Vadim Stepanov
e7950139f3
Fix flaky Slack test (#1841)
# What this PR does
Fix [flaky
test](https://github.com/grafana/oncall/actions/runs/4821277510/jobs/8586941639#step:5:706)
`test_get_user_groups_filter_by_handle` using `UniqueFaker` on
`SlackUserGroupFactory.handle` to make handles always unique.

Before:

```shell
>>> len(set([SlackUserGroupFactory().handle for _ in range(100)]))
93
```

After:

```shell
>>> len(set([SlackUserGroupFactory().handle for _ in range(100)]))
100
```


## 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-04-27 17:41:36 +01:00
Michael Derynck
869a186670 Update changelog 2023-04-27 09:48:21 -06:00
Joey Orlando
4967ce8208
update web UI, Slack, and Telegram to allow silencing an acknowledged alert group (#1831)
# What this PR does

https://www.loom.com/share/1a6ef0d00c3b46ca80c120579d512dcc

## Checklist

- [ ] Unit, integration, and e2e (if applicable) tests updated (N/A)
- [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-04-27 14:52:35 +00:00
Ildar Iskhakov
07e3a78949
Use subquery for mine alert groups (#1803)
# 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-04-27 11:20:45 +08:00
Michael Derynck
e8806cedd7
Restore removed parameter (#1832)
team_id was removed from send_webhook_event when other calls were still
adding it. Quick fix to restore it until we decide how to make use of
it.
2023-04-26 22:38:16 +00:00
Michael Derynck
ddb3227ac0 Sign drone build 2023-04-26 15:58:44 -06:00
Michael Derynck
3d74cbf3f5
Webhook 2 improvements and fixes (#1829)
- Rename Firing to Alert Group Created to reduce confusion as to why the
event only first once and not when unresolve or unacknowledge returns
the alert group to the firing state.
- Increase password field length
- Do not filter webhook execution by team, team is just for filtering
ownership now
- Do not log webhook triggers in alert group escalation log if the
webhook does not trigger (Status/response will still be stored)
- Fix formatting for response content and data fields on the Status page
- Add a content length limit for responses being stored (50000
characters)
2023-04-26 15:55:08 -06:00
Matias Bordese
06b6c856d7
Rework schedule related users, add endpoint (#1828)
Related to https://github.com/grafana/oncall/issues/1820.
2023-04-26 20:46:51 +00:00
Joey Orlando
52ff041066
Optimize duplicate queries occurring in AlertGroupFilter (#1809)
# What this PR does

In `AlertGroupFilter` we currently have 11 duplicate queries which add
~1-2secs of unecessary request latency to `GET
/api/internal/v1/alertgroups` calls.
![Screenshot 2023-04-20 at 17 57
49](https://user-images.githubusercontent.com/9406895/233589341-de5e53ca-f10b-4038-ad68-a857d1643bf2.png)



The queries originate from the `queryset` callable arguments on several
of the fields of the `AlertGroupFilter` class. These callables basically
filter down their respective querysets to include only objects that
belong to the currently authenticated user's organization.

The duplicate queries are
- 2 queries to fetch integrations
- 2 queries to fetch escalation chains
- 10 queries to fetch users

At the moment, this PR is still a draft and doesn't work as intended.
It's based off of [a suggestion from this
discussion](https://github.com/carltongibson/django-filter/discussions/1572#discussioncomment-5676042)
in the `django-filter` repo. See [this DjangoCon
talk](https://youtu.be/e52S1SjuUeM?t=841) for more context.

---------

Co-authored-by: Ildar Iskhakov <Ildar.iskhakov@grafana.com>
2023-04-26 06:16:29 +00:00
Tommy
23c7a6f682
Add 2, 3 and 6 hours silence options (#1822)
# What this PR does
This PR adds additional silence options in the UI. Currently we only
have 1 hour, 4 hours and 12 hours silence options. I think it's worth it
to have finer silence options.

## Which issue(s) this PR fixes
No issue ticket but I can create one.

## 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-04-26 02:22:18 +00:00
Matias Bordese
cdb62f2cf6
Enable final schedule exports (#1808)
Update iCal schedule and personal exports to use final schedule events.
2023-04-25 15:40:27 +00:00
Matias Bordese
20ec6f52bc
Add is_legacy column to handle webhook migration (#1813)
Legacy webhooks won't be editable at first. Keep data templates
compatibility.

Possible migration code:
```python
from apps.webhooks.models import Webhook
from apps.alerts.models import CustomButton, EscalationPolicy

custom_buttons = CustomButton.objects.all()
for cb in custom_buttons:
    webhook, _ = Webhook.objects.get_or_create(
        organization=cb.organization,
        team=cb.team,
        name=cb.name,
        is_legacy=True,
        defaults=dict(
            created_at=cb.created_at,
            url=cb.webhook,
            username=cb.user,
            password=cb.password,
            authorization_header=cb.authorization_header,
            trigger_type=Webhook.TRIGGER_ESCALATION_STEP,
            forward_all=cb.forward_whole_payload,
            data=cb.data,
        )
    )
    # migrate related escalation policies
    policies = EscalationPolicy.objects.filter(
        step=EscalationPolicy.STEP_TRIGGER_CUSTOM_BUTTON,
        custom_button_trigger=cb,
    ).update(
        step=EscalationPolicy.STEP_TRIGGER_CUSTOM_WEBHOOK,
        custom_webhook=webhook,
    )

```
2023-04-25 11:22:56 -03:00
Ildar Iskhakov
0a6d513693
Update ci jobs to node:14.17.0-buster from node:14.17.0-stretch (#1812)
# 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-04-25 15:44:08 +08:00
Matias Bordese
9cbcac5054
Add final schedule export refresh note (#1807)
Also include a suggested refresh interval in the generated ical
(Google Calendar will still ignore it, but may be useful for some other
clients).
2023-04-24 12:56:37 -03:00
Joey Orlando
a871fec0a3
Update CHANGELOG.md 2023-04-24 08:25:44 -04:00
Jack Baldry
fb7a4bea13
Use centralized make-docs script from Writers' Toolkit (#1742)
- Adds ability to build multiple projects simultaneously using, for
example, `make docs PROJECTS='grafana grafana-cloud'`.
- Adds `make doc-validator` which runs
[`doc-validator`](https://github.com/grafana/technical-documentation/tree/main/tools/cmd/doc-validator)
on all documentation.

Using a centralized script will help ensure consistency in workflow
across all projects.

Signed-off-by: Jack Baldry <jack.baldry@grafana.com>

---------

Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
2023-04-24 08:52:43 +00:00
Ildar Iskhakov
e6ebec1a17
Reuse web templates in other templates (#1786)
# 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-04-24 07:44:39 +00:00
Ildar Iskhakov
6e61643750
Limit number of alertmanager alerts in alert group to autoresolve (#1779)
# What this PR does

This PR set the limit so that workers won't attempt to autoresolve too
big alertmanager alert groups.

## 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-04-24 05:38:21 +00:00
Matias Bordese
e404d2f4b6
Update shift API to use a default for interval when missing (#1810)
Fixes #1527.
2023-04-21 19:13:09 +00:00
Matvey Kukuy
62d5fc3bf7
Update CHANGELOG.md 2023-04-21 17:23:58 +03:00