Commit graph

2120 commits

Author SHA1 Message Date
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
atownsend247
18fe390d44
Extend twilio secrets (#1435)
# What this PR does

This allows the use of existing secrets for the twilio configuration,
much like slack already does, as have used that to influence these
changes

## Which issue(s) this PR fixes

## Checklist

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

---------

Co-authored-by: Matvey Kukuy <Matvey-Kuk@users.noreply.github.com>
2023-04-21 17:21:06 +03:00
Joey Orlando
16502205be
add channel__team to internal api serializer select_related (#1805)
Locally I reproduced a slow `GET /api/internal/v1/alertgroups` query
(took 9s - 10s). After adding this line to the alert group serializer
for the internal api it:
- cut the response time in half
- cut the number of executed SQL queries from 52 to 30
2023-04-20 18:30:49 +02:00
Michael Derynck
cef748ed4c
Add users_to_be_notified to new webhooks payload (#1798)
- Change FIRING trigger for webhooks to be sent after escalation
snapshot has been computed
- Extract users from `notify_to_users_queue` and `notify_schedule` from
escalation snapshot to populate `users_to_be_notified` in webhook
payload
2023-04-20 16:13:48 +00:00
Ildar Iskhakov
13e7aaba01
Optimise alert groups private api endpoint (#1802)
# 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-20 21:01:41 +08:00
Ildar Iskhakov
21aaa14076
Return is_based_on_alertmanager for alert_receive_channel in private api (#1782)
# 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-20 05:49:25 +00:00
Matthias Teich
1bd157f7f3
Fix helm hook for migration job (#1789)
# What this PR does
This PR fixes the migration job when using helm hooks.
## Which issue(s) this PR fixes
Currently when enabling the useHooks option in the helm chart there is a
deadlock as the hook is defined as "post-upgrade, post-install". In this
case the database migration will only be executed when all other pods
are ready. This will not happen as the pods are waiting for the database
migration. So we need to use "pre-install, preupgrade" instead of
"post-install,post-upgrade"

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

Co-authored-by: Ildar Iskhakov <Ildar.iskhakov@grafana.com>
2023-04-20 05:39:53 +00:00
Ildar Iskhakov
e891f411a6
Make screenshots bigger in README.md (#1799)
# 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-20 13:26:12 +08:00
Vadim Stepanov
afdf1dc837
v1.2.14 changelog (#1795) 2023-04-19 16:32:40 +01:00
Vadim Stepanov
eee9dcfcfa
Fix team update (#1794)
# What this PR does
Fixes team update endpoint for internal API + adds a unit test for this
scenario.

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

## 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-19 15:22:14 +00:00
Vadim Stepanov
569c85dab6
Schedule quality docs (#1781)
# What this PR does
Add docs for schedule quality report feature.

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

## 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-19 16:11:22 +01:00
Shantanu Alsi
e806ad32f1
Fix documentation links (#1766)
# What this PR does

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

---------

Co-authored-by: Joey Orlando <joey.orlando@grafana.com>
2023-04-19 10:12:16 +01:00
Michael Derynck
aaff20239b
Update CHANGELOG.md 2023-04-18 20:16:50 -06:00
Matias Bordese
0895cdbb8f
Use shift tz for web-created events (#1785)
Fix issue when creating web overrides for TF schedules using a non-UTC
timezone (web UI assumes editable events are UTC-based).
2023-04-19 01:11:07 +00:00
Michael Derynck
a99e9a5686
Add unacknowledge trigger for new webhooks (#1768)
- Add trigger for unacknowledge events in new webhooks
- Improve test coverage to include is_webhook_enabled and
integration_filter logic
2023-04-18 13:03:33 -06:00
Michael Derynck
2af4398e01
Webhooks 2 - Add copy ID to clipboard buttons (#1753)
Add copy to clipboard buttons for integration, route, webhook IDs if
webhooks 2 is enabled.

![Screenshot from 2023-04-14
11-31-13](https://user-images.githubusercontent.com/28077050/232116596-98cef7e1-0727-4fdd-a6e4-ad1fab4c0e4f.png)

![Screenshot from 2023-04-14
11-20-13](https://user-images.githubusercontent.com/28077050/232116613-5b964ae6-ccf8-4cf0-9a39-faa8a92360fe.png)

Updated tooltip:

![Screenshot from 2023-04-14
12-00-08](https://user-images.githubusercontent.com/28077050/232122222-80c58837-f213-421f-85e0-3ff40e193dda.png)
2023-04-18 13:03:13 -06:00
Matias Bordese
017d98efad
Rework schedule ical export (#1783)
Related to #1501. Behind a feature flag, will migrate existing exports
to use the new ical export transparently.
2023-04-18 17:07:11 +00:00
Matias Bordese
6cff9729d8
Update upcoming shift endpoint to return a list (#1784) 2023-04-18 16:42:04 +00:00
Matias Bordese
4149c266bb
Add mine filter to schedules listing (#1743)
Related to #1741 .
2023-04-18 13:16:36 +00:00
Vadim Stepanov
7bd6f0d095
Update PD migrator docs (#1777) 2023-04-18 12:44:00 +00:00
Ildar Iskhakov
16d64485f3
Fix templates bug (#1776)
# 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-18 18:55:53 +08:00
Joey Orlando
f74a0c3479
Merge branch 'main' into dev 2023-04-18 12:28:04 +02:00
Joey Orlando
5f9e79d50f
move alert_group.is_restricted to alert_receive_channel.restricted_at (#1770) 2023-04-18 12:02:56 +02:00
Ildar Iskhakov
cee0fdccd7
Add new field description_short to private and public api (#1698)
# What this PR does
Required for new Integrations page
<img width="674" alt="Screenshot 2023-04-04 at 20 32 03"
src="https://user-images.githubusercontent.com/2262529/229792240-60783f30-00ba-4dfc-bebd-75d6c2c232e3.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)

---------

Co-authored-by: Joey Orlando <joey.orlando@grafana.com>
2023-04-18 04:55:55 +00:00
Ildar Iskhakov
61dced5bd9
Add is_default fields to templates, remove WritableSerialiserMethodFi… (#1759)
…eld, refactor fields

# 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-18 04:44:51 +00:00
Ildar Iskhakov
5da5b8d430
Allow use of dynamic payloads in alert receive channels preview templ… (#1756)
…ate in private api

# 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-18 03:57:40 +00:00
Ildar Iskhakov
7dd726622a
Add endpoints to start and stop maintenance in alert receive channel … (#1755)
…private api

# 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-18 03:31:49 +00:00
Ildar Iskhakov
9d19493561
Added preview and migration API endpoints for route migration from regex into jinja2 (#1715)
# What this PR does
This PR adds new API endpoints for migrating routes from regex format to
jinja2 format. The changes include the following:

* `filtering_term_as_jinja2` field to GET `channels_filters` endpoint
* A POST endpoint
`channel_filters/ABCDEF123/convert_from_regex_to_jinja2/` for migrating
routes to jinja2 format.

These new endpoints will allow users to preview and migrate their
existing regex routes to the more flexible and maintainable jinja2
format.

Check the screenshot where this endpoints will be used
<img width="407" alt="Screenshot 2023-04-14 at 09 50 23"
src="https://user-images.githubusercontent.com/2262529/231920771-20792c7e-d6ef-4681-80e1-c82bb4aa4b8e.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-04-18 02:53:53 +00:00
Ildar Iskhakov
f825fdf1a3
Send demo alert with dynamic payload and get demo payload example on private api (#1700)
# 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-18 02:48:11 +00:00
Joey Orlando
fa1fc5f6ec
Merge pull request #1767 from grafana/jorlando/alert-group-is-restricted-changes
temporarily disable is_restricted column + migration
2023-04-17 19:39:26 +02:00
Joey Orlando
4c299fcd71
temporarily disable is_restricted column + migration 2023-04-17 19:38:42 +02:00
Joey Orlando
e93347e75b
temporarily disable is_restricted column + migration (#1765) 2023-04-17 19:30:31 +02:00
Vadim Stepanov
d99bb7b8bc
PD migrator: ignore 404s on delete + delete ONCALL_DEFAULT_CONTACT_METHOD (#1764) 2023-04-17 13:12:21 +01:00
Matthias Teich
0c42c2a86d
Add option to use helm hook for migration job (#1386)
# What this PR does
This PR adds the option to use helm hooks for the database migration.

## Which issue(s) this PR fixes
Currently oncall always shows as out-of-sync in argo-cd because the name
changes on each hard refresh.
When using a helm hook the job is executed on sync but does not show as
out-of-sync

## Checklist

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

---------

Co-authored-by: Ildar Iskhakov <Ildar.iskhakov@grafana.com>
2023-04-17 10:22:05 +00:00
Innokentii Konstantinov
15e7baad88
Insight logs format fixes (#1763)
# What this PR does
Minot fixes of insight logs formatting
2023-04-17 10:10:47 +00:00
Joey Orlando
75824dc9ad
ignore .http file extensions (#1762) 2023-04-17 10:52:03 +02:00
Innokentii Konstantinov
c68fdf5681
Fix insight_logs exceptions (#1757)
Most of the PR is just renaming ChatOpsType to ChatOpsPlug, core changes
are linked below:

- Fix insight_logs error writing unlink_backend error
https://github.com/grafana/oncall/pull/1757/files#diff-7ae187be84e55ebac962bad0984f7569186cdc83c896132b2ebcbcbb31bbf5dd
- Fix insight_logs error writing updated schedule with installed slack
integration
(https://github.com/grafana/oncall/pull/1757/files#diff-4037b7bbef9fc16d9b541beb3ed46f760916d7cd720847c3123adf7afb5ab4b4L690)
2023-04-17 07:16:18 +00:00
Matias Bordese
4f26ea3a68
Fix responses context when no response (#1754) 2023-04-14 17:30:32 +00:00
Joey Orlando
90e95878e8
Merge pull request #1750 from grafana/dev
v1.2.11
2023-04-14 12:13:09 +02:00
Joey Orlando
de6e8d1226
Update CHANGELOG.md 2023-04-14 12:08:00 +02:00
Joey Orlando
482809996f
fix small bug in IRMBanner rendering logic (#1749) 2023-04-14 12:03:37 +02:00