# What this PR does
## Which issue(s) this PR fixes
## Checklist
- [x] Unit, integration, and e2e (if applicable) tests updated
- [x] Documentation added (or `pr:no public docs` PR label added if not
required)
- [x] `CHANGELOG.md` updated (or `pr:no changelog` PR label added if not
required)
# What this PR does
## Which issue(s) this PR fixes
## Checklist
- [ ] Unit, integration, and e2e (if applicable) tests updated
- [ ] Documentation added (or `pr:no public docs` PR label added if not
required)
- [ ] `CHANGELOG.md` updated (or `pr:no changelog` PR label added if not
required)
# What this PR does
- swap the order of setting date values to prevent incorrect month
increment
## Which issue(s) this PR fixes
- https://github.com/grafana/support-escalations/issues/9188
## 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)
Enables Grafana Alerting v2 feature. It will enable integration dropdown
in OnCall Contact point in the Alerting UI.
In OSS if user has grafana version which supports this feature it will
work as well. If user has old grafana/oncall - nothing will happen.
---------
Co-authored-by: Ildar Iskhakov <Ildar.iskhakov@grafana.com>
# What this PR does
Add transactions around log record creation and check transaction
on_commit before sending signals passing DB id of alert group log
records. In cases for delete we can then assume any missing IDs on tasks
are from intentionally deleted alert groups and we can stop tasks from
retrying endlessly.
## 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)
# What this PR does
- Handle case where key exists for jsonData but explicitly set to None
- Disable incident if plugin disabled after or in the case it was
removed completely from the Grafana instance
## 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)
# What this PR does
See [this
conversation](https://raintank-corp.slack.com/archives/C04JCU51NF8/p1706722752735009)
for more context.
Additionally, improves logging for this task + adds unit tests.
## 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)
# What this PR does
Related to [this
discussion](https://raintank-corp.slack.com/archives/C04JCU51NF8/p1706550226831949)
Removes the `/oncall` Slack slash command + the concept of
`force_route_id` (as this Slack slash command was the last piece of code
to use this concept
[here](https://github.com/grafana/oncall/blob/dev/engine/apps/slack/scenarios/manual_incident.py#L146))
## TODO before merging
- [x] update the various env's Slack apps to remove the slash command
from the app manifests
## 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)
# What this PR does
Add necessary headers to ChatopsProxyAPIClient for dev environment
testing.
## 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)
# What this PR does
This PR adds support for routing alerts based on labels.
https://www.loom.com/share/4401de6e3c4945d5b8961fe43ee373c9
Additionally:
- improve the typing around the `get_object` method that is inherited by
[`PublicPrimaryKeyMixin.get_object`](https://github.com/grafana/oncall/blob/dev/engine/common/api_helpers/mixins.py#L153)
in most of our models. `PublicPrimaryKeyMixin` is generic, so it can be
more strongly typed when it is being subclassed, which results in better
typing of the `get_object` method in child classes
- I decided to do this because I started looking into this task via the
[`AlertReceiveChannelView.send_demo_alert`
method/endpoint](https://github.com/grafana/oncall/blob/dev/engine/apps/api/views/alert_receive_channel.py#L242).
Within that method, `instance` is not typed because the inherited
`get_object` method is not typed.. I digress 😄
- improve typing around `Alert.create` and
`apps.integrations.tasks.create_alert` functions
- make `Alert.render_group_data` more DRY by extracting some logic out
into `Alert._apply_jinja_template_to_alert_payload_and_labels`
- deduplicate the logic of `value.strip().lower() in ["1", "true",
"ok"]` into a shared function,
`common.jinja_templater.apply_jinja_template.templated_value_is_truthy`
Closes https://github.com/grafana/oncall-private/issues/2490
## Checklist
- [x] Unit, integration, and e2e (if applicable) tests updated
- [x] `CHANGELOG.md` updated (or `pr:no changelog` PR label added if not
required)
- [x] Documentation added (or `pr:no public docs` PR label added if not
required) (will be done in #3762)
# What this PR does
Improve GSelect modelName typing
## Which issue(s) this PR fixes
## Checklist
- [ ] Unit, integration, and e2e (if applicable) tests updated
- [ ] Documentation added (or `pr:no public docs` PR label added if not
required)
- [ ] `CHANGELOG.md` updated (or `pr:no changelog` PR label added if not
required)
Bumps [aiohttp](https://github.com/aio-libs/aiohttp) from 3.9.0 to
3.9.2.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/aio-libs/aiohttp/releases">aiohttp's
releases</a>.</em></p>
<blockquote>
<h2>3.9.2</h2>
<h2>Bug fixes</h2>
<ul>
<li>
<p>Fixed server-side websocket connection leak.</p>
<p><em>Related issues and pull requests on GitHub:</em>
<a
href="https://redirect.github.com/aio-libs/aiohttp/issues/7978">#7978</a>.</p>
</li>
<li>
<p>Fixed <code>web.FileResponse</code> doing blocking I/O in the event
loop.</p>
<p><em>Related issues and pull requests on GitHub:</em>
<a
href="https://redirect.github.com/aio-libs/aiohttp/issues/8012">#8012</a>.</p>
</li>
<li>
<p>Fixed double compress when compression enabled and compressed file
exists in server file responses.</p>
<p><em>Related issues and pull requests on GitHub:</em>
<a
href="https://redirect.github.com/aio-libs/aiohttp/issues/8014">#8014</a>.</p>
</li>
<li>
<p>Added runtime type check for <code>ClientSession</code>
<code>timeout</code> parameter.</p>
<p><em>Related issues and pull requests on GitHub:</em>
<a
href="https://redirect.github.com/aio-libs/aiohttp/issues/8021">#8021</a>.</p>
</li>
<li>
<p>Fixed an unhandled exception in the Python HTTP parser on header
lines starting with a colon -- by :user:<code>pajod</code>.</p>
<p>Invalid request lines with anything but a dot between the HTTP major
and minor version are now rejected.
Invalid header field names containing question mark or slash are now
rejected.
Such requests are incompatible with :rfc:<code>9110#section-5.6.2</code>
and are not known to be of any legitimate use.</p>
<p><em>Related issues and pull requests on GitHub:</em>
<a
href="https://redirect.github.com/aio-libs/aiohttp/issues/8074">#8074</a>.</p>
</li>
<li>
<p>Improved validation of paths for static resources requests to the
server -- by :user:<code>bdraco</code>.</p>
</li>
</ul>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/aio-libs/aiohttp/blob/master/CHANGES.rst">aiohttp's
changelog</a>.</em></p>
<blockquote>
<h1>3.9.2 (2024-01-28)</h1>
<h2>Bug fixes</h2>
<ul>
<li>
<p>Fixed server-side websocket connection leak.</p>
<p><em>Related issues and pull requests on GitHub:</em>
:issue:<code>7978</code>.</p>
</li>
<li>
<p>Fixed <code>web.FileResponse</code> doing blocking I/O in the event
loop.</p>
<p><em>Related issues and pull requests on GitHub:</em>
:issue:<code>8012</code>.</p>
</li>
<li>
<p>Fixed double compress when compression enabled and compressed file
exists in server file responses.</p>
<p><em>Related issues and pull requests on GitHub:</em>
:issue:<code>8014</code>.</p>
</li>
<li>
<p>Added runtime type check for <code>ClientSession</code>
<code>timeout</code> parameter.</p>
<p><em>Related issues and pull requests on GitHub:</em>
:issue:<code>8021</code>.</p>
</li>
<li>
<p>Fixed an unhandled exception in the Python HTTP parser on header
lines starting with a colon -- by :user:<code>pajod</code>.</p>
<p>Invalid request lines with anything but a dot between the HTTP major
and minor version are now rejected.
Invalid header field names containing question mark or slash are now
rejected.
Such requests are incompatible with :rfc:<code>9110#section-5.6.2</code>
and are not known to be of any legitimate use.</p>
<p><em>Related issues and pull requests on GitHub:</em>
:issue:<code>8074</code>.</p>
</li>
</ul>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="24a6d64966"><code>24a6d64</code></a>
Release v3.9.2 (<a
href="https://redirect.github.com/aio-libs/aiohttp/issues/8082">#8082</a>)</li>
<li><a
href="9118a5831e"><code>9118a58</code></a>
[PR <a
href="https://redirect.github.com/aio-libs/aiohttp/issues/8079">#8079</a>/1c335944
backport][3.9] Validate static paths (<a
href="https://redirect.github.com/aio-libs/aiohttp/issues/8080">#8080</a>)</li>
<li><a
href="435ad46e6c"><code>435ad46</code></a>
[PR <a
href="https://redirect.github.com/aio-libs/aiohttp/issues/3955">#3955</a>/8960063e
backport][3.9] Replace all tmpdir fixtures with tmp_path (...</li>
<li><a
href="d33bc21414"><code>d33bc21</code></a>
Improve validation in HTTP parser (<a
href="https://redirect.github.com/aio-libs/aiohttp/issues/8074">#8074</a>)
(<a
href="https://redirect.github.com/aio-libs/aiohttp/issues/8078">#8078</a>)</li>
<li><a
href="0d945d1be0"><code>0d945d1</code></a>
[PR <a
href="https://redirect.github.com/aio-libs/aiohttp/issues/7916">#7916</a>/822fbc74
backport][3.9] Add more information to contributing page (...</li>
<li><a
href="3ec4fa1f0e"><code>3ec4fa1</code></a>
[PR <a
href="https://redirect.github.com/aio-libs/aiohttp/issues/8069">#8069</a>/69bbe874
backport][3.9] 📝 Only show changelog draft for non-release...</li>
<li><a
href="419d715c42"><code>419d715</code></a>
[PR <a
href="https://redirect.github.com/aio-libs/aiohttp/issues/8066">#8066</a>/cba34699
backport][3.9] 💅📝 Restructure the changelog for clarity (#...</li>
<li><a
href="a54dab3b36"><code>a54dab3</code></a>
[PR <a
href="https://redirect.github.com/aio-libs/aiohttp/issues/8049">#8049</a>/a379e634
backport][3.9] Set cause for ClientPayloadError (<a
href="https://redirect.github.com/aio-libs/aiohttp/issues/8050">#8050</a>)</li>
<li><a
href="437ac47fe3"><code>437ac47</code></a>
[PR <a
href="https://redirect.github.com/aio-libs/aiohttp/issues/7995">#7995</a>/43a5bc50
backport][3.9] Fix examples of
<code>fallback_charset_resolver</code>...</li>
<li><a
href="034e5e34ee"><code>034e5e3</code></a>
[PR <a
href="https://redirect.github.com/aio-libs/aiohttp/issues/8042">#8042</a>/4b91b530
backport][3.9] Tightening the runtime type check for ssl (...</li>
<li>Additional commits viewable in <a
href="https://github.com/aio-libs/aiohttp/compare/v3.9.0...v3.9.2">compare
view</a></li>
</ul>
</details>
<br />
[](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>
# What this PR does
## Which issue(s) this PR fixes
## Checklist
- [ ] Unit, integration, and e2e (if applicable) tests updated
- [ ] Documentation added (or `pr:no public docs` PR label added if not
required)
- [ ] `CHANGELOG.md` updated (or `pr:no changelog` PR label added if not
required)
# What this PR does
This PR simplifies alert group/alert creation, so the alert created and
escalation started in the same task.
## Which issue(s) this PR fixes
## Checklist
- [ ] Unit, integration, and e2e (if applicable) tests updated
- [ ] Documentation added (or `pr:no public docs` PR label added if not
required)
- [ ] `CHANGELOG.md` updated (or `pr:no changelog` PR label added if not
required)
# What this PR does
Adds a check to enable labels feature only if plugin provisioned. It's
needed to be protected from reconciliation delays and etc.
## 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)
# What this PR does
Fixes calculating number of oncall users per team for `team` api
endpoint
## 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)
# What this PR does
show autoresolve template for ALL integrations when autoresolve is ON
show modal on edit button click for alertmanager based integrations
<img width="557" alt="Screenshot 2024-01-29 at 13 37 08"
src="https://github.com/grafana/oncall/assets/20116910/64569912-4601-4be1-b51e-b040906a3ffb">
## Which issue(s) this PR fixes
Frontend part of https://github.com/grafana/oncall-private/issues/2260
## Checklist
- [ ] Unit, integration, and e2e (if applicable) tests updated
- [ ] Documentation added (or `pr:no public docs` PR label added if not
required)
- [ ] `CHANGELOG.md` updated (or `pr:no changelog` PR label added if not
required)
---------
Co-authored-by: Vadim Stepanov <vadimkerr@gmail.com>