Commit graph

1485 commits

Author SHA1 Message Date
Matias Bordese
66dece3880
Handle webhooks update on source integration settings update (#4195)
Also, some refactoring on the way we get the source integration from a
connected webhook.

Related to https://github.com/grafana/oncall-private/issues/2615
2024-04-10 11:37:11 +00:00
Vadim Stepanov
e4fed1e6d9
Fix source integration filter query (#4193)
Related to https://github.com/grafana/oncall-private/issues/2615

## 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-09 15:57:11 +00:00
Matias Bordese
4ac2df19b5
Update xdist load to use loadscope setting (#4187)
Changed xdist dist setting to use `loadscope` value
See
[docs](https://pytest-xdist.readthedocs.io/en/latest/distribution.html#running-tests-across-multiple-cpus)
2024-04-08 19:03:58 +00:00
Matias Bordese
59852de278
Update integration token generation endpoint to include usage details (#4172)
Related to https://github.com/grafana/oncall-private/issues/2615
2024-04-08 14:45:35 +00:00
Matias Bordese
f06c3e7325
Check for backsync updates before triggering connected webhooks (#4149)
Avoid triggering a webhook if it is from a connected integration and the
triggering event was caused by a backsync update.

Related to https://github.com/grafana/oncall-private/issues/2615
2024-04-08 14:25:48 +00:00
Matias Bordese
398b09a85b
Allow getting details from connected integration webhooks (#4153)
Related to https://github.com/grafana/oncall-private/issues/2615
2024-04-08 14:13:17 +00:00
Michael Derynck
6119c60f55
Add test for caching deleted integration, fix test wrap methods (#4173)
# What this PR does
Add test case and fixes test added in #4163 

## Which issue(s) this PR closes

Closes [issue link here]

<!--
*Note*: 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-04-05 20:35:38 +00:00
Michael Derynck
f5855915a2
Improve performance for deleted integration lookups (#4163)
# What this PR does
- Refactor alert receive channel lookup so it is easier to follow
- Remove the additional lookup that was taking place for alert receive
channels that belong to a deleted organization, these can be treated as
deleted for usage purposes even though the alert receive channel itself
does not have `deleted_at` populated
- Organizations that have been moved will still need to be looked up
everytime. This is not optimized in favor of not maintaining a cache of
Organizations. These are not frequent requests and can be optimized
later if necessary.

## Which issue(s) this PR closes

<!--
*Note*: 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-04-05 16:16:30 +00:00
Matias Bordese
dc9dc9a57f
Update backsync method to take source channel as param (#4159)
Update by backsync will now expect the source alert receive channel
triggering the transition (and update the log record using this
information).

Related to https://github.com/grafana/oncall-private/issues/2615
2024-04-05 16:04:13 +00:00
Ravishankar
d00314b7e1
Added Outgoing Web hooks to escalation policy log (#4150)
# What this PR does

Adds the Outgoing web hooks escalation step to the escalation plan log.

## Which issue(s) this PR closes

Closes #4037

<!--
*Note*: 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: Joey Orlando <joey.orlando@grafana.com>
2024-04-05 15:57:48 +00:00
Joey Orlando
8428335f3f
add X-Grafana-User header in proxied mobile app proxy gateway requests (#4170)
# What this PR does

Adds `X-Grafana-User` header in proxied mobile app proxy gateway
requests. This is required by the Grafana Incident backend to be able to
properly resolve the currently authenticated user.

## 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-05 15:45:16 +00:00
Joey Orlando
3f24bfce95
Google Calendar Integration - consider current oncall shifts for autogeneration of shift swap requests (#4160)
# What this PR does

Fixes issue where you create a Google Calendar OOO that overlaps with an
in-progress oncall shift (currently we only consider future/upcoming
shifts).

Related to https://github.com/grafana/oncall-private/issues/2555

## 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-05 13:15:05 +00:00
Michael Derynck
c255ec66d8
Fix bug in ratelimit logic introduced in #4137 (#4162)
# What this PR does
Fix bug introduced in #4137

## Which issue(s) this PR closes

Closes [issue link here]

<!--
*Note*: 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
- [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-04 20:34:18 +00:00
Michael Derynck
d14b1c8e28
Improve performance for rate-limited, banned and deleted integrations (#4137)
# What this PR does
- Remove BanAlertConsumptionBasedOnSettingsMiddleware under high traffic
scenarios this causes too much DB load and the same effect can be
achieved by soft-deleting the integration
- Change lookups for integrations so that non-existent and deleted
integrations are also cached to reduce DB load

## Which issue(s) this PR closes

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

<!--
*Note*: 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-04-04 18:05:34 +00:00
Joey Orlando
c6f5c9b14d
Google Calendar integration improvements (#4147)
# What this PR does

- UI enhancements
- Fix bug when going through the Google OAuth2 disconnection flow. We
should send the `refresh_token` in the `revoke` HTTP request, rather
than the `access_token` (`access_token` expires frequently and can
result in Google sending back HTTP 400.. `refresh_token` is long lived
and can also be sent in the revoke flow)

## Checklist

- [ ] 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: Maxim Mordasov <maxim.mordasov@grafana.com>
2024-04-04 16:03:40 +00:00
Salvatore Giordano
4c79d69c17
Use body instead of subtitle in ios notifications (#4151)
# What this PR does

## Which issue(s) this PR closes

Closes https://github.com/grafana/oncall-mobile-app/issues/364

## 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-04 15:38:43 +00:00
Innokentii Konstantinov
8294ab5639
Add more logs for updating slack user group members (#4146) 2024-04-03 08:28:22 +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
59f727d4f5
Google OAuth2 flow + fetch Google Calendar OOO events (#4067)
# What this PR does

The following is deployed under a feature flag.

**How it works**
1. The user clicks on the "Connect using your Google account" button in
the user profile settings modal
2. The UI makes a call to `GET /api/internal/v1/login/google-oauth2`.
The backend has now been configured to add
`apps.social_auth.backends.GoogleOAuth2` as a "`social_auth` backend".
3. The backend will respond w/ a URL which points to the Google OAuth2
consent screen. The frontend then proceeds by sending the user to this
page. This URL includes the following query parameters (amongst others):
- `redirect_uri` - this will send the user back to
`/api/internal/v1/complete/google-oauth2` (ie. make another API call to
the OnCall backend to finalize the Google OAuth2 flow)
- `state` - this represents an
`apps.auth_token.models.GoogleOAuth2Token` token. This allows us to
identify the OnCall user once they've linked their Google account.
4. Once redirected back to `/api/internal/v1/complete/google-oauth2`,
this will complete the OAuth2 flow. At this point, the backend has
access to several pieces of information about the Google user, including
their `access_token` and `refresh_token`. We persist these (encrypted)
for future use to fetch the user's out-of-office calendar events
5. The response from the API call in 4 above ☝️ is HTTP 302 (redirect)
to `/a/grafana-oncall-app/users/me` (ie. open the user profile settings
modal). At this point the user will see that their account has been
connected and they can further configure the settings

![image](https://github.com/grafana/oncall/assets/9406895/c7673055-8485-4f9a-98df-b4f7347229ce)


## Which issue(s) this PR closes

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

## 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 14:59:03 -04:00
Joey Orlando
a35a8949eb
cleanup orphaned CustomButton escalation policy steps (#4143)
# What this PR does

See [this
conversation](https://raintank-corp.slack.com/archives/C025VMT6SPK/p1711991400490289)
for more context.

Also removes the `EscalationPolicy.custom_button_trigger` field which
was previously marked as deprecated in #2544 and migrated
[here](https://github.com/grafana/oncall/blob/dev/engine/apps/webhooks/migrations/0008_auto_20230712_1613.py#L39-L45)

## 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 15:23:07 +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
Joey Orlando
38a418a0ee
add grafana_incident_enabled to GET /organization internal API response (#4129)
# What this PR does

Needed for some mobile app work.

## 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-03-27 21:46:19 +00:00
Alex Burnett
9118ccfe58
Allow custom values for Self Hosted Clusters (Slugs, Titles, Region) (#4121)
# What this PR does
Allows for environment variables to be set on Grafana OnCall Engine for
Self Hosted users, giving them the ability to set values for Stack Slug,
Org Slug/Title, Region & Cluster Slugs.

This will mean then using the Grafana OnCall App, when adding multiple
OSS Stacks, you can set the correct value of 'stack_slug' so you can
differentiate between the stacks in the App.

## Which issue(s) this PR closes

Closes [#4119](https://github.com/grafana/oncall/issues/4119)

## Checklist

- [x] 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: Joey Orlando <joey.orlando@grafana.com>
2024-03-27 20:23:32 +00:00
Yulya Artyukhina
3c93375244
Update alert group state by backsync (#4089)
# What this PR does
Adds method to update alert group state by backsync
Related to https://github.com/grafana/oncall-private/issues/2542
Should be merged with
https://github.com/grafana/oncall-private/pull/2606

## 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-03-27 12:37:01 +00:00
Vadim Stepanov
b7e2dc14f8
Fix ratelimit bug (#4108)
# What this PR does

Fixes a bug in the ratelimit logic when integration-specific ratelimit
429s are still counted towards the organization-wide ratelimit.

## Which issue(s) this PR closes

Related to https://github.com/grafana/support-escalations/issues/9579

## 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-03-26 17:20:05 +00:00
Vadim Stepanov
5fd35b61b8
fix status_options schema (#4109) 2024-03-25 16:40:57 +00:00
Ildar Iskhakov
3eca7a6a89
Add permalinks field to the alert groups list view in internal api (#4100)
# What this PR does

closes https://github.com/grafana/oncall/issues/4099

## Which issue(s) this PR closes

Closes [issue link here]

<!--
*Note*: 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-03-22 12:31:44 +00:00
Matias Bordese
73cfaf25c0
Enable test_connection for existing integrations reusing data (#4091)
Related to https://github.com/grafana/oncall-private/issues/2542
Make it possible to test connection for an existing integration, without
needing to explicitly pass the password.
2024-03-21 14:04:35 +00:00
Vadim Stepanov
5df15926e9
Tweak connected integration filter (#4090) 2024-03-20 20:11:38 +00:00
Yulya Artyukhina
ed60b67884
Integtation backsync endpoint (#4082)
# What this PR does
Adds endpoint for integration backsync
Related to https://github.com/grafana/oncall-private/issues/2542

## 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-03-20 11:26:33 +00:00
Vadim Stepanov
5074a16861
SNOW external ID (#4076)
# What this PR does

- Adds a new model `AlertGroupExternalID` to keep track of incident IDs
in external systems
- Adds calls to integration config specific functions on alert group
creation and webhook response

## Which issue(s) this PR closes

Related to https://github.com/grafana/oncall-private/issues/2541

## 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-03-20 10:54:27 +00:00
dependabot[bot]
04604caa62
Bump django from 4.2.10 to 4.2.11 in /engine (#4079)
Bumps [django](https://github.com/django/django) from 4.2.10 to 4.2.11.
<details>
<summary>Commits</summary>
<ul>
<li><a
href="61a986f53d"><code>61a986f</code></a>
[4.2.x] Bumped version for 4.2.11 release.</li>
<li><a
href="3c9a2771cc"><code>3c9a277</code></a>
[4.2.x] Fixed CVE-2024-27351 -- Prevented potential ReDoS in
Truncator.words().</li>
<li><a
href="7973951139"><code>7973951</code></a>
[4.2.x] Added release date for 4.2.11 and 3.2.25.</li>
<li><a
href="86d8034972"><code>86d8034</code></a>
[4.2.x] Refs <a
href="https://redirect.github.com/django/django/issues/34900">#34900</a>,
Refs <a
href="https://redirect.github.com/django/django/issues/34118">#34118</a>
-- Updated assertion in test_skip_class_unle...</li>
<li><a
href="cb173bb088"><code>cb173bb</code></a>
[4.2.x] Fixed <a
href="https://redirect.github.com/django/django/issues/35172">#35172</a>
-- Fixed intcomma for string floats.</li>
<li><a
href="227ef29cff"><code>227ef29</code></a>
[4.2.x] Added CVE-2024-24680 to security archive.</li>
<li><a
href="e2f1907642"><code>e2f1907</code></a>
[4.2.x] Post release version bump.</li>
<li>See full diff in <a
href="https://github.com/django/django/compare/4.2.10...4.2.11">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=django&package-manager=pip&previous-version=4.2.10&new-version=4.2.11)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)
You can disable automated security fix PRs for this repo from the
[Security Alerts
page](https://github.com/grafana/oncall/network/alerts).

</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Joey Orlando <joey.orlando@grafana.com>
2024-03-19 21:14:44 +00:00
Matias Bordese
9a1a0e2be5
Update alert receive channel OpenAPI schemas (#4077) 2024-03-19 14:30:54 +00:00
Matias Bordese
432c477ee2
Add integration status_options endpoint listing backsync possible statuses (#4061)
Related to https://github.com/grafana/oncall-private/issues/2542

Requires https://github.com/grafana/oncall/pull/4050
2024-03-18 12:11:40 +00:00
Yulya Artyukhina
477062bb0c
Integration backsync token (#4056)
# What this PR does
Adds auth token for integrations backsync
Related to https://github.com/grafana/oncall-private/issues/2542

## 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-03-18 09:16:54 +00:00
Matias Bordese
65b4a23407
Add test_connection endpoint for alert receive channel backsync setup (#4050)
Related to https://github.com/grafana/oncall-private/issues/2542
2024-03-15 18:01:38 +00:00
Ilya Lukyanov
847d4c9dec
Fix web alert templater with many links (#4068)
# What this PR does

Web templater had a bug with link substitutions: it replaced every link
with 'oncallsubstitutedlink{link_idx}', and then replaced them back.
But if we have more than 10 links in the message, there
would be replacements like 'oncallsubstitutedlink10', which will be
partially replaced by match from 'oncallsubstitutedlink1', yielding
incorrect links in the resulting message. This fixes this behaviour.

## 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-03-15 17:23:24 +00:00
Matias Bordese
eb1228e782
Update universal integrations to reject requests without payload (#4053)
Reject integration requests with a null payload
2024-03-14 15:51:46 +00:00
teslaedison
335d7a8f7f
chore: fix some comments (#4055)
# What this PR does

Fix typos in comments

## Checklist

- [ ] 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.

Signed-off-by: teslaedison <qingchengqiushuang@gmail.com>
Co-authored-by: Joey Orlando <joey.orlando@grafana.com>
2024-03-14 15:36:00 +00:00
Vadim Stepanov
e0e56b9150
Create default webhooks on integration creation (#4052)
## Which issue(s) this PR closes

Related to https://github.com/grafana/oncall-private/issues/2541

<!--
*Note*: 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-03-13 14:41:33 +00:00
Yulya Artyukhina
9b7dce64cd
Delete connection on channel delete (#4048)
# What this PR does
Delete alert receive channel connections on alert receive channel delete
Related to https://github.com/grafana/oncall-private/issues/2540

## 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-03-13 12:25:41 +00:00
Matias Bordese
3a5d00ad60
Add additional settings serializer details for OpenAPI schema generation (#4042)
Related to https://github.com/grafana/oncall-private/issues/2540
2024-03-11 15:47:15 +00:00
Matias Bordese
d27bd6af51
Add support for integration additional settings via custom serializer (#4027)
Related to https://github.com/grafana/oncall-private/issues/2540
2024-03-07 18:35:11 +00:00
Michael Derynck
73dd14d695
Move fcm_relay task from webhook to critical queue (#4034)
# What this PR does
The fcm_relay task was in the wrong queue, moves it to critical.

## Which issue(s) this PR closes

<!--
*Note*: 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-03-07 18:26:25 +00:00
Vadim Stepanov
6d9d58d0db
Add id_ne filter for integrations (internal API) (#4032)
# What this PR does

Adds a new multiple choice `id_ne` (ID not equal) filter to internal API
integrations endpoint.

## Which issue(s) this PR closes

Related to https://github.com/grafana/oncall-private/issues/2540

## 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-03-07 17:53:44 +00:00
Vadim Stepanov
cf1fac8997
Backend support for "connected" integrations (#4030)
# What this PR does

Adds a Django model and internal API for connected integrations. Based
on https://github.com/grafana/oncall/pull/3983

## Which issue(s) this PR closes

Related to https://github.com/grafana/oncall-private/issues/2540

## 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-03-07 17:47:33 +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
5326d945e0
Allow setting integration_filter to null in webhooks internal API (#4011)
Fixes https://github.com/grafana/oncall/issues/4006
2024-03-05 17:11:47 +00:00