Commit graph

1474 commits

Author SHA1 Message Date
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
Ildar Iskhakov
1101d8461b
Use local arm64 grpcio wheel to make local builds on arm64 faster (#4000)
This is the workaround to make local image build faster on arm64
machines
This commit can be reverted once
https://github.com/grpc/grpc/issues/34998 is resolved
2024-03-05 06:31:58 +00:00
Innokentii Konstantinov
80e93b10cd
Instrument requests lib (#4008)
# What this PR does

Instument requests lib to provide consistent trace_id
2024-03-05 05:22:34 +00:00
Michael Derynck
a466e79bc5
Fix slack declare incident label (#4007)
# What this PR does
Make label consistent with casing in web ui

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

## 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)
2024-03-05 01:26:16 +00:00
Michael Derynck
d938b52d80
Add scheduled task to start cleanup tasks (#3976)
# What this PR does
Add scheduled task to start cleanup tasks. Currently purpose is to run
the task every 12 hours and for all active orgs cleanup empty & deleted
integrations. For deleted orgs we can run this manually. It will also
run if an org moves from active to deleted. It is expected to add more
to cleanup_organization task over time.

## 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)
2024-03-04 19:45:01 +00:00
Michael Derynck
10a74e3c21
Add reset button to disable integration heartbeat (#3959)
# What this PR does
Add a button to reset integration heartbeat into the state before it
received its first request. This has the effect of disabling the
heartbeat until a request starts it up again.

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

## 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-03-04 19:20:00 +00:00
Innokentii Konstantinov
16f2e6ecee
Use uwsgi instrumentation and log request headers (#3997)
# What this PR does
Use uwsgi instead of TracingMiddleware to not to mess up with span
attrs. Also it's an attempt to fix different trace IDs between
cortex-gw, oncall and labels plugin. Last, but not least - add a
middleware to log request headers if OTEL is enabled. It's needed to
debug tracing headers
2024-03-04 09:25:39 +00:00
Innokentii Konstantinov
f6d0441411
Add trace_id to log lines (#3982)
# What this PR does
This PR set up tracing to propagates trace_id to log lines.
There are two different tracers: local one in manage.py - it's used when
app is started via manage.py runserver. In this case spans will be just
written in console. Second traces is confugured in wsgi.py. It will be
used when app is runned via uwsgi and it will export traces via grpc.
Feature is hidden behind the feature flag.
2024-03-04 06:42:43 +00:00
Michael Derynck
2c7ebcf87c
Add task to delete empty deleted integrations from the database (#3941)
# What this PR does
Add task which will cleanup deleted integrations from the database if
they don't have any alert groups. This is to help address an issue where
queries are slowing down due to having a large numbers of ids that do
not contribute to the result.

This will be connected as part of sync organization task once it tests
out ok.

## 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)
2024-02-27 17:34:41 +00:00
Joey Orlando
9c0bc26680
Fix daily e2e tests GitHub Actions cron job (#3923)
# What this PR does

- fixes our e2e tests to work on all tested versions
- updates Grafana versions that we run the daily e2e tests against (bump
`10.0.2` to `10.0.11` + add `10.1.7` tags)
- updates the Slack status message format + change channel from
#irm-amixr-flux to #gops-oncall-dev

<img width="1479" alt="Screenshot 2024-02-24 at 08 30 06"
src="https://github.com/grafana/oncall/assets/9406895/f5cb91f8-12ce-4978-9c37-c72ee8a01e4b">


## NOTE
It looks like we have some e2e tests that fail under the following
circumstances:
- on Firefox or WebKit
- on Grafana 10.2 and 10.3 (once we fix these, we should [update our e2e
tests that run on all PR
builds](https://github.com/grafana/oncall/blob/dev/.github/workflows/linting-and-tests.yml#L325)
to run against `10.3.3` which is the current latest major version
available)

## 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-02-27 09:21:53 -05:00
Vadim Stepanov
7549a688b0
Integration webhooks API (#3954)
# What this PR does

Adds internal API endpoints for
`alert_receive_channels/<id>/webhooks/<webhook_id>`.

## Which issue(s) this PR fixes

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] `CHANGELOG.md` updated (or `pr:no changelog` PR label added if not
required)
2024-02-27 08:12:21 +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