Commit graph

114 commits

Author SHA1 Message Date
Vadim Stepanov
ac7dc97cc3
fix: don't update Slack messages if resolution note text not changed (#5126)
# What this PR does

Reduces the number of `chat.update` Slack API calls when a resolution
note is updated with the same text.

<!--
*Note*: If you want the issue to be auto-closed once the PR is merged,
change "Related to" to "Closes" in the line above.
If you have more than one GitHub issue that this PR closes, be sure to
preface
each issue link with a [closing
keyword](https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/using-keywords-in-issues-and-pull-requests#linking-a-pull-request-to-an-issue).
This ensures that the issue(s) are auto-closed once the PR has been
merged.
-->

## 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] Added the relevant release notes label (see labels prefixed w/
`release:`). These labels dictate how your PR will
    show up in the autogenerated release notes.
2024-10-04 16:47:18 +00:00
Matias Bordese
62ab3f1f62
Revert declared incident model related changes (#5116) 2024-10-02 21:34:20 +00:00
Ildar Iskhakov
784b7e5344
Add latest alert to public api alert groups endpoint (#5059)
# What this PR does

Added last alert information 
and optimized the API call so it makes 10x less queries by:
* prefetching chatops messages (based on @vadimkerr 's
https://github.com/grafana/oncall/pull/4738)
* using `enrich` from private api

Previously: 
<img width="1102" alt="Screenshot 2024-09-24 at 4 47 00 PM"
src="https://github.com/user-attachments/assets/84edb78e-257a-49cd-bc94-083dd8d043d7">
Now:
<img width="1066" alt="Screenshot 2024-09-24 at 4 44 56 PM"
src="https://github.com/user-attachments/assets/e7dfcc40-dce6-4a0d-9677-910aab2b4f17">



## Which issue(s) this PR closes

Related to [issue link here]

<!--
*Note*: If you want the issue to be auto-closed once the PR is merged,
change "Related to" to "Closes" in the line above.
If you have more than one GitHub issue that this PR closes, be sure to
preface
each issue link with a [closing
keyword](https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/using-keywords-in-issues-and-pull-requests#linking-a-pull-request-to-an-issue).
This ensures that the issue(s) are auto-closed once the PR has been
merged.
-->

## Checklist

- [ ] Unit, integration, and e2e (if applicable) tests updated
- [ ] Documentation added (or `pr:no public docs` PR label added if not
required)
- [ ] Added the relevant release notes label (see labels prefixed w/
`release:`). These labels dictate how your PR will
    show up in the autogenerated release notes.

---------

Co-authored-by: Vadim Stepanov <vadimkerr@gmail.com>
2024-10-02 17:09:50 +00:00
Yulya Artyukhina
70b7273078
Add declare incident step and model (#5047)
Related to https://github.com/grafana/oncall-private/issues/2831

## Checklist

- [ ] Unit, integration, and e2e (if applicable) tests updated
- [ ] Documentation added (or `pr:no public docs` PR label added if not
required)
- [ ] Added the relevant release notes label (see labels prefixed w/
`release:`). These labels dictate how your PR will
    show up in the autogenerated release notes.

---------

Co-authored-by: Matias Bordese <mbordese@gmail.com>
Co-authored-by: Dominik <dominik.broj@grafana.com>
2024-10-02 13:38:33 +00:00
Joey Orlando
51c72fcea2
feat: add Grafana IDs to users and teams public API endpoints (#5075)
# What this PR does

- add Grafana IDs to users and teams public API endpoints
- update Schedules public API docs to reflect the fact that [we allow
filtering by
`team_id`](https://github.com/grafana/oncall/blob/dev/engine/apps/public_api/views/schedules.py#L42)

## 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] Added the relevant release notes label (see labels prefixed w/
`release:`). These labels dictate how your PR will
    show up in the autogenerated release notes.
2024-09-24 19:16:22 +00:00
Ravishankar
20d2d5a578
feat: Add silence and unsilence public api endpoint (#5031)
# What this PR does
Exposes alert group silence and unsilence via public api endpoint

## Which issue(s) this PR closes
[#5026](https://github.com/grafana/oncall/issues/5026)

<!--
*Note*: If you want the issue to be auto-closed once the PR is merged,
change "Related to" to "Closes" in the line above.
If you have more than one GitHub issue that this PR closes, be sure to
preface
each issue link with a [closing
keyword](https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/using-keywords-in-issues-and-pull-requests#linking-a-pull-request-to-an-issue).
This ensures that the issue(s) are auto-closed once the PR has been
merged.
-->

## 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] Added the relevant release notes label (see labels prefixed w/
`release:`). These labels dictate how your PR will
    show up in the autogenerated release notes.
2024-09-23 12:33:12 +00:00
Ravishankar
1f209cd2bd
fix: Add rolling users validation for oncall shift API (#5050)
# What this PR does
Adds validation for rolling users param in the shift api

## Which issue(s) this PR closes
Closes [5041](https://github.com/grafana/oncall/issues/5041)

<!--
*Note*: If you want the issue to be auto-closed once the PR is merged,
change "Related to" to "Closes" in the line above.
If you have more than one GitHub issue that this PR closes, be sure to
preface
each issue link with a [closing
keyword](https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/using-keywords-in-issues-and-pull-requests#linking-a-pull-request-to-an-issue).
This ensures that the issue(s) are auto-closed once the PR has been
merged.
-->

## 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] Added the relevant release notes label (see labels prefixed w/
`release:`). These labels dictate how your PR will
    show up in the autogenerated release notes.
2024-09-20 21:06:33 +00:00
Ildar Iskhakov
c7a7a3f81a
Use dataclass methods in custom ratelimits and fix tests (#5036)
# What this PR does

Follow up PR for https://github.com/grafana/oncall/pull/5004
Tests haven’t caught a bug, so the method and the tests are fixed

## Which issue(s) this PR closes

Related to [issue link here]

<!--
*Note*: If you want the issue to be auto-closed once the PR is merged,
change "Related to" to "Closes" in the line above.
If you have more than one GitHub issue that this PR closes, be sure to
preface
each issue link with a [closing
keyword](https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/using-keywords-in-issues-and-pull-requests#linking-a-pull-request-to-an-issue).
This ensures that the issue(s) are auto-closed once the PR has been
merged.
-->

## Checklist

- [ ] Unit, integration, and e2e (if applicable) tests updated
- [ ] Documentation added (or `pr:no public docs` PR label added if not
required)
- [ ] Added the relevant release notes label (see labels prefixed w/
`release:`). These labels dictate how your PR will
    show up in the autogenerated release notes.
2024-09-18 13:32:16 +00:00
Ildar Iskhakov
c718863bd8
Add custom ratelimits per org (#5004)
# What this PR does

This PR refactors Throttling for public API and integrations API and
allows to specify organization ratelimits.


## Which issue(s) this PR closes

Related to [issue link here]

<!--
*Note*: If you want the issue to be auto-closed once the PR is merged,
change "Related to" to "Closes" in the line above.
If you have more than one GitHub issue that this PR closes, be sure to
preface
each issue link with a [closing
keyword](https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/using-keywords-in-issues-and-pull-requests#linking-a-pull-request-to-an-issue).
This ensures that the issue(s) are auto-closed once the PR has been
merged.
-->

## Checklist

- [x] Unit, integration, and e2e (if applicable) tests updated
- [ ] Documentation added (or `pr:no public docs` PR label added if not
required)
- [x] Added the relevant release notes label (see labels prefixed w/
`release:`). These labels dictate how your PR will
    show up in the autogenerated release notes.
2024-09-17 23:16:41 +00:00
Matias Bordese
dbba664a1f
Check for user.is_active during mobile app auth (#4990)
Related to https://github.com/grafana/support-escalations/issues/12253
2024-09-06 12:25:23 +00:00
Michael Derynck
f79445fbcb
Fix pagination behavior when page # exceeds search results (#4817)
# What this PR does
Change pagination to return last available page if the page number
exceeds the pages available instead of returning 404. This came up from
if the user is on a page other than the first and they enter a search
and the number of search results are smaller than what would be needed
to reach the current page number it would give a blank page and 404.

## Which issue(s) this PR closes

Related to [issue link here]

<!--
*Note*: If you want the issue to be auto-closed once the PR is merged,
change "Related to" to "Closes" in the line above.
If you have more than one GitHub issue that this PR closes, be sure to
preface
each issue link with a [closing
keyword](https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/using-keywords-in-issues-and-pull-requests#linking-a-pull-request-to-an-issue).
This ensures that the issue(s) are auto-closed once the PR has been
merged.
-->

## 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] Added the relevant release notes label (see labels prefixed w/
`release:`). These labels dictate how your PR will
    show up in the autogenerated release notes.

---------

Co-authored-by: Rares Mardare <rares.mardare@grafana.com>
2024-08-19 13:59:01 +00:00
Matias Bordese
a416863a28
Update alert groups public API filters support (#4832)
Related to https://github.com/grafana/oncall/issues/4747

- include labels in response
- allow filtering by labels
- allow filtering by started_at
- update docs
2024-08-15 19:58:25 +00:00
Joey Orlando
67fc52d56a
add POST /escalation public API endpoint + add public API docs for teams/organization endpoints (#4815)
# What this PR does

- Adds a `POST /escalation` public endpoint (equivalent to the internal
direct paging API endpoint)
- Adds public API documentation for teams and organization endpoints

<img width="1140" alt="Screenshot 2024-08-15 at 12 49 40"
src="https://github.com/user-attachments/assets/e0e8d6bb-f3ac-4f9e-bdf7-e8926949cc3b">

## Which issue(s) this PR closes

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

## 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] Added the relevant release notes label (see labels prefixed w/
`release:`). These labels dictate how your PR will
    show up in the autogenerated release notes.
2024-08-15 18:31:35 +00:00
Matias Bordese
f6715e072f
Update Makefile dev bootstrap; fix test (#4582)
Update Makefile rule for backend bootstrap dev environment (uv wasn't
finding Python in env).
Also update test to prevent timing/ordering issues.
2024-06-25 14:43:50 +00:00
Matias Bordese
3c58c2f6f8
Make type required when creating an escalation policy step (#4356)
Related to https://github.com/grafana/oncall-private/issues/2689
2024-05-20 13:49:19 +00:00
Ravishankar
6f3f4e3f14
Allow webhook modification by API for advanced webhook (#4175)
# What this PR does

Enables the API to perform updates on the advanced webhooks created via
the UI

## Which issue(s) this PR closes

Closes #3958 

## 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] Added the relevant release notes label (see labels prefixed w/
`release:`). These labels dictate how your PR will
    show up in the autogenerated release notes.
2024-04-23 19:18:12 +00:00
Matias Bordese
b3c1800f87
Add Slack deep link entry to alert group permalinks (#4205)
Related to https://github.com/grafana/oncall/issues/4122
2024-04-12 13:25:48 +00:00
Joey Orlando
33364b63c6
Google Calendar Out of Office events - autogenerated shift swap requests (#4104)
# What this PR does

## Which issue(s) this PR closes

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

## Checklist

- [x] Unit, integration, and e2e (if applicable) tests updated
- [x] Documentation added (or `pr:no public docs` PR label added if not
required) - will be done in
https://github.com/grafana/oncall-private/issues/2591
- [x] Added the relevant release notes label (see labels prefixed w/
`release:`). These labels dictate how your PR will
show up in the autogenerated release notes. - will be done in
https://github.com/grafana/oncall-private/issues/2591

---------

Co-authored-by: Dominik <dominik.broj@grafana.com>
Co-authored-by: Maxim Mordasov <maxim.mordasov@grafana.com>
2024-04-02 20:10:16 +00:00
Joey Orlando
afc688feda
upgrade flake8 to v7 (#4141)
# Which issue(s) this PR closes

Fixes [this
issue](https://github.com/grafana/oncall-private/pull/2620/files#diff-0144920543fd191db13f76c9fb797116e26eda2bdd2b79332b61bfbf5846208eR193-R197)
(https://github.com/PyCQA/pycodestyle/issues/334#issuecomment-2027394413)
in `grafana/oncall-private`

## 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] Added the relevant release notes label (see labels prefixed w/
`release:`). These labels dictate how your PR will
    show up in the autogenerated release notes.
2024-04-02 14:26:19 +00:00
Innokentii Konstantinov
407b85e923
Fix validation of integration name when team is not present in request data (#4132)
This PR fixes validation of integration name when team is not present in
request data. Also it slightly improves code structure of this
validation.
2024-03-29 04:57:27 +00:00
Joey Orlando
c5cd675738
cleanup CustomButton backend code + add ngrok/express outgoing webhook e2e test (#2544)
# What this PR does

- removes unused "custom button" backend code now that we've migrated to
outgoing webhooks
- adds new e2e test for webhooks asserting that an `ngrok`/`express`
webhook handler receives the call as expected + payload is as expected
(related to https://github.com/grafana/oncall/issues/2691) - skipped for
now, the test passes locally but fails on GitHub Actions CI, seems to be
networking related
 
## Checklist

- [x] Unit, integration, and e2e (if applicable) tests updated
- [x] Documentation added (or `pr:no public docs` PR label added if not
required)

---------

Co-authored-by: Michael Derynck <michael.derynck@grafana.com>
2024-03-28 15:37:22 +00:00
Ravishankar
642f8202c8
Add silenced_at field to alert group public API (#3992)
# What this PR does

## Which issue(s) this PR fixes

Closes #3913 

## 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>
2024-03-06 19:20:33 +00:00
Matias Bordese
19b5c6553c
Add is_from_connected_integration field to webhook model (#3951)
Related to https://github.com/grafana/oncall-private/issues/2541.
2024-02-23 15:57:57 +00:00
Matias Bordese
d2917373b7
Migrate webhooks integration_filter to use a m2m field instead (#3946)
Related to https://github.com/grafana/oncall-private/issues/2541
2024-02-23 11:55:44 +00:00
Matias Bordese
d6467e9cb7
Add escalation step to notify all members from a team (#3908)
Based on https://github.com/grafana/oncall/pull/3477

---------

Co-authored-by: xssfox <xss@sprocketfox.io>
2024-02-20 10:02:23 -03:00
Matias Bordese
0007fc69b7
Restrict integration name uniqueness per team (#3863)
Related to https://github.com/grafana/oncall/issues/3858

We still need to improve error messages in the UI, [to be
discussed](https://raintank-corp.slack.com/archives/C04JCU51NF8/p1707486122947369).
2024-02-12 11:40:08 +00:00
Matias Bordese
97cb0f597b
Add acknowledged/resolved by data to alert groups public API (#3833)
Minor improvements to the alert groups public API (helping to get better
reporting information)
2024-02-05 11:02:55 -03:00
Matias Bordese
f5065462c9
Include teams info in users API (#3817) 2024-02-01 17:16:57 -03:00
Matias Bordese
52871b08e6
Fix interval validation when creating shift via public API (#3775)
Related to https://github.com/grafana/support-escalations/issues/9142.
2024-01-31 11:06:54 -03:00
Yulya Artyukhina
e18dafa650
Fix routes and schedules public api endpoints (#3751)
# What this PR does
Add check whether organization has Slack connection on update Slack
related field using public api endpoints
## Which issue(s) this PR fixes
https://github.com/grafana/oncall-private/issues/1611
## 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)
2024-01-25 12:52:55 +00:00
Joey Orlando
006682d0b7
fix PUT /api/v1/escalation_policies/<id> issue related to updating from_time and to_time (#3581)
# Which issue(s) this PR fixes

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

## 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-12-19 09:13:07 -05:00
Vadim Stepanov
4ccfda58e5
Disallow creating and deleting direct paging integrations (#3475)
# What this PR does

Disallows creating and deleting direct paging integrations via both
internal and public APIs. It also hides the direct paging option in the
UI when creating a new integration.

## Which issue(s) this PR fixes

Related to 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)

---------

Co-authored-by: Dominik <dominik.broj@grafana.com>
2023-12-04 13:13:53 +00:00
Joey Orlando
76a88bc0c1
Revert "upgrade to Python 3.12 (#3456)" and "bump uwsgi version to latest #3466" (#3483)
# What this PR does

This reverts commits 7c4b40a046 and
cdb22285db.

See https://github.com/grafana/oncall-private/pull/2361 for more
details.
2023-12-01 09:56:26 -05:00
Joey Orlando
7c4b40a046
upgrade to Python 3.12 (#3456)
# What this PR does

Upgrade to Python 3.12 + fix several invalid test assertions that lead
to test failures in the latest version of `pytest`:
```
AttributeError: 'called_once_with' is not a valid assertion. Use a spec for the mock if 'called_once_with' is meant to be an attribute.. Did you mean: 'assert_called_once_with'?
```

## 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-11-30 13:47:41 +00:00
Matias Bordese
7aa78f5f73
Enable flake8-bugbear, fix issues (#3454)
Enables [flake8-bugbear](https://github.com/PyCQA/flake8-bugbear),
checking for bugs/design problems, and [fixes the issues
found](https://pastebin.com/fEDBz6Ta) (some interesting ones,
particularly with mutable args).

Related to https://github.com/grafana/oncall/pull/3448
2023-11-29 15:04:48 +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
Ravishankar
13318577d4
fix(2989) Return users field data for web overriden shifts via public… (#3303)
# What this PR does 
The `rolling_users` field for the shift of type override created from
web UI is populated in the `users` field of the public GET Shift API
## Which issue(s) this PR fixes
  #2989
## 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-16 10:13:47 -03:00
Ravishankar
152b1b1c58
fix(3093) Return timezone field of the user via public API (#3311)
# What this PR does
Return the `timezone` field for the users GET API call
## Which issue(s) this PR fixes

Closes #3093 

## 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-11-10 11:47:11 -05:00
Nelson
c281484f67
add support for datetime on final_shifts API parameters (#3103)
# What this PR does
- Changes the data type from `DateField` to `DateTimeField` on the
`final_shifts` API endpoint
- Accepts either a date or a datetime for the `start_date` and
`end_date` parameters (e.g. 2021-01-01 or 2021-01-01T01:00)
- Datetime granularity is in line with what is configurable on the
schedule i.e. `YYYY-MM-DD hh:mm`
- removes the rounding logic that modifies the query sent on the
database

## Which issue(s) this PR fixes
#3086 

## 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-10-30 12:00:39 +00:00
Yulya Artyukhina
a3aeb0ecb5
Fix channel filter endpoint (#3192)
# What this PR does
Add filtering term length check for channel filter endpoints

## Which issue(s) this PR fixes

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

## 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-10-25 12:33:05 +00:00
Matias Bordese
a539e3646d
Update shifts public API to improve web shifts support (#3165) 2023-10-19 17:30:12 +00:00
Matias Bordese
5c85ced4a9
Update ical schedule creation/update to trigger final schedule refresh (#3156)
Otherwise iCal schedules only refresh their cached final representation
once a day (via periodic task).
Related to https://github.com/grafana/oncall/issues/3154
2023-10-18 16:41:25 +00:00
Vadim Stepanov
1acb7018d0
Improve alert group deletion API (#3124)
# What this PR does

- Invalidate alert group cache on wipe
- Improve public API docs on alert group deletion
- Add / improve tests

## Which issue(s) this PR fixes

Related to https://github.com/grafana/oncall/issues/3051

## 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-10-05 14:32:40 +01:00
Vadim Stepanov
a727450d49
Public API: Acknowledge & Resolve actions (#3108)
# What this PR does

Makes it possible to acknowledge/unacknowledge and resolve/unresolve
alert groups via public API, and makes sure these actions are reflected
properly in the alert group timeline.

## Demo

```bash
curl --request POST \
     --header "Authorization: TOKEN" \
     http://localhost:8080/api/v1/alert_groups/IQMHLV8INB24N/resolve
```

<img width="651" alt="Screenshot 2023-10-04 at 16 05 27"
src="https://github.com/grafana/oncall/assets/20116910/d4e66868-0132-4b6b-95c7-8424fced7c0b">

## Which issue(s) this PR fixes

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

## 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-10-05 09:46:48 +01:00
Michael Derynck
d604fa1d06
Fix action/webhook API not accepting empty/null user (#3094)
# What this PR does
Fix update calls made by terraform when user field is empty or not
present.
Should have been part of: https://github.com/grafana/oncall/pull/3053

## Which issue(s) this PR fixes
https://github.com/grafana/terraform-provider-grafana/issues/1025

## 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-10-03 14:33:05 +00:00
Michael Derynck
b5a8b8b168
Add webhook presets (#2996)
# What this PR does
Add a system similar to how we select integrations when creating
webhooks so that the user has a description of what webhookds do and
does not have to write complex templates for common webhook use cases.
Presets allow us to create the contents of the webhooks in code and
define which fields are controlled by the preset. Some specifics:

- Newly created webhooks must choose between Simple, Advanced or another
predefined system
- Simple is always an escalation step and will post the entire payload
to the given URL
- Advanced is the same as no preset which is our current view where all
fields are available
- There are no changes for all existing webhooks with empty preset
fields
- Once a webhook is created with a preset the preset cannot be changed
- Fields in the webhook that are populated by code will give a
validation error if they are modified
- In the public API webhooks with presets are returned for viewing but
cannot be created or modified. This restriction is in place because the
Web UI provides the context for which fields to use with a preset. The
public API is for interacting with webhooks where all fields are
defined.

To define a preset create a file with metadata and an override function.
The metadata drives validation and what to display in the UI. There are
two functions one is connected to the pre_save hook of the Webhook model
for persistent changes, the other replaces parameters at execution time
for ephemeral changes. See the simple and advanced presets as an
example. The file must be listed in settings in
`INSTALLED_WEBHOOK_PRESETS` to be enabled at runtime..

## 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-09-27 07:22:52 -06:00
Matias Bordese
9ead70a4ed
Add schedules enable_web_overrides option to public API (#3062)
Related updates (to be merged afterwards):
- https://github.com/grafana/amixr-api-go-client/pull/14
- https://github.com/grafana/terraform-provider-grafana/pull/1056
2023-09-26 14:04:53 -03:00
Michael Derynck
2f1cc43b0e
Fix public actions endpoint to handle empty user field (#3053)
# What this PR does
Fixes a regression that was introduced when actions were remapped to new
webhooks. Validation in the serializer was making the user field no
longer accept blank and None values. This PR makes those values accepted
again.

## Which issue(s) this PR fixes
https://github.com/grafana/terraform-provider-grafana/issues/1025

## 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-26 14:54:41 +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
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