Skip to content

Commit

Permalink
Alerting integration use get for receiver key (#2894)
Browse files Browse the repository at this point in the history
# What this PR does
Fixes an issue where OnCall could not parse Alerting configuration if
there was a route created without a receiver. The case where this comes
up is a notification policy matcher is defined for the purpose of
ignoring certain label values before continuing on to other matching
rules.

## 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)
- [x] `CHANGELOG.md` updated (or `pr:no changelog` PR label added if not
required)
  • Loading branch information
mderynck authored Aug 29, 2023
1 parent 5bc7351 commit 5d4f96e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

- Address bug when a Shift Swap Request is accepted either via the web or mobile UI, and the Slack message is not
updated to reflect the latest state by @joeyorlando ([#2886](https://github.com/grafana/oncall/pull/2886))
- Fix issue where Grafana integration would fail to parse alerting config for routes without receivers @mderynck
([#2894](https://github.com/grafana/oncall/pull/2894))

## v1.3.27 (2023-08-25)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,7 @@ def _recursive_check_contact_point_is_in_routes(self, route_config: dict, receiv
return True
routes = route_config.get("routes", [])
for route in routes:
if route["receiver"] == receiver_name:
if route.get("receiver") == receiver_name:
return True
if route.get("routes"):
if self._recursive_check_contact_point_is_in_routes(route, receiver_name):
Expand Down

0 comments on commit 5d4f96e

Please sign in to comment.