Skip to content

Commit 144abaa

Browse files
authored
Merge pull request #776 from grafana/dev
Release new helm chart version 1.0.9 (v1.0.50)
2 parents fee1235 + 6109c7b commit 144abaa

File tree

35 files changed

+1358
-767
lines changed

35 files changed

+1358
-767
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Change Log
22

3+
## v1.0.51 (2022-11-05)
4+
5+
- Bug Fixes
6+
37
## v1.0.50 (2022-11-03)
48

59
- Updates to documentation

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ PYTEST = $(ENV)/bin/pytest
1111
DOCKER_FILE ?= docker-compose-developer.yml
1212

1313
define setup_engine_env
14-
export `grep -v '^#' .env | xargs -0` && cd engine
14+
export `grep -v '^#' .env.dev | xargs -0` && cd engine
1515
endef
1616

1717
$(ENV):

docs/sources/_index.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,4 @@ Grafana OnCall is an open source incident response management tool built to help
2929
- **Massive scalability:** Grafana OnCall is equipped with a full API and Terraform capabilities. Ready for GitOps and large organization configuration.
3030

3131

32-
> **Note:** You can use [Grafana Cloud](https://grafana.com/products/cloud/?plcmt=nav-products-cta1&cta=cloud) to avoid installing, maintaining, and scaling your own instance of Grafana OnCall. The free forever plan includes 30 Grafana OnCall notification. [Create an account to get started](https://grafana.com/auth/sign-up/create-user?pg=oncall&plcmt=hero-btn-1).
33-
3432
{{< section >}}

docs/sources/alert-behavior/_index.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,6 @@ Once Grafana OnCall receives an alert, the following occurs, based on the alert
1818
- Default or customized alert templates are applied to deliver the most useful alert fields with the most valuable information, in a readable format.
1919
- Alerts are grouped based on your alert grouping configurations, combining similar or related alerts to reduce alert noise.
2020
- Alerts automatically resolve if an alert from the monitoring system matches the resolve condition for that alert.
21+
22+
23+
{{< section >}}

docs/sources/get-started/_index.md

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,7 @@ These procedures introduce you to initial Grafana OnCall configuration steps, in
2626

2727
## Before you begin
2828

29-
Grafana OnCall is available for Grafana Cloud as well as Grafana open source users. You must have a Grafana Cloud account or [Open Source Grafana OnCall]({{< relref "../open-source" >}})
30-
31-
For more information, see [Grafana Pricing](https://grafana.com/pricing/) for details.
32-
29+
Grafana OnCall is available for Grafana Cloud as well as Grafana open source users. You must have a Grafana Cloud account or use [Open Source Grafana OnCall]({{< relref "../open-source" >}})
3330

3431
## Install Open Source Grafana OnCall
3532

engine/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM python:3.9-alpine
1+
FROM python:3.9-alpine3.16
22
RUN apk add bash python3-dev build-base linux-headers pcre-dev mariadb-connector-c-dev openssl-dev libffi-dev git
33
RUN pip install uwsgi
44

engine/apps/alerts/models/alert_receive_channel.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
from django.utils import timezone
1515
from django.utils.crypto import get_random_string
1616
from emoji import emojize
17-
from jinja2 import Template
1817

1918
from apps.alerts.grafana_alerting_sync_manager.grafana_alerting_sync import GrafanaAlertingSyncManager
2019
from apps.alerts.integration_options_mixin import IntegrationOptionsMixin
@@ -29,6 +28,7 @@
2928
from common.api_helpers.utils import create_engine_url
3029
from common.exceptions import TeamCanNotBeChangedError, UnableToSendDemoAlert
3130
from common.insight_log import EntityEvent, write_resource_insight_log
31+
from common.jinja_templater import jinja_template_env
3232
from common.public_primary_keys import generate_public_primary_key, increase_public_primary_key_length
3333

3434
logger = logging.getLogger(__name__)
@@ -360,7 +360,7 @@ def is_demo_alert_enabled(self):
360360
def description(self):
361361
if self.integration == AlertReceiveChannel.INTEGRATION_GRAFANA_ALERTING:
362362
contact_points = self.contact_points.all()
363-
rendered_description = Template(self.config.description).render(
363+
rendered_description = jinja_template_env.from_string(self.config.description).render(
364364
is_finished_alerting_setup=self.is_finished_alerting_setup,
365365
grafana_alerting_entities=[
366366
{

engine/apps/alerts/models/custom_button.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77
from django.db import models
88
from django.db.models import F
99
from django.utils import timezone
10-
from jinja2 import Template
1110
from requests.auth import HTTPBasicAuth
1211

12+
from common.jinja_templater import jinja_template_env
1313
from common.public_primary_keys import generate_public_primary_key, increase_public_primary_key_length
1414

1515
logger = logging.getLogger(__name__)
@@ -103,7 +103,7 @@ def build_post_kwargs(self, alert):
103103
if self.forward_whole_payload:
104104
post_kwargs["json"] = alert.raw_request_data
105105
elif self.data:
106-
rendered_data = Template(self.data).render(
106+
rendered_data = jinja_template_env.from_string(self.data).render(
107107
{
108108
"alert_payload": self._escape_alert_payload(alert.raw_request_data),
109109
"alert_group_id": alert.group.public_primary_key,

engine/apps/api/serializers/custom_button.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,14 @@
22
from collections import defaultdict
33

44
from django.core.validators import URLValidator, ValidationError
5-
from jinja2 import Template, TemplateError
5+
from jinja2 import TemplateError
66
from rest_framework import serializers
77
from rest_framework.validators import UniqueTogetherValidator
88

99
from apps.alerts.models import CustomButton
1010
from common.api_helpers.custom_fields import TeamPrimaryKeyRelatedField
1111
from common.api_helpers.utils import CurrentOrganizationDefault, CurrentTeamDefault
12+
from common.jinja_templater import jinja_template_env
1213

1314

1415
class CustomButtonSerializer(serializers.ModelSerializer):
@@ -52,7 +53,7 @@ def validate_data(self, data):
5253
return None
5354

5455
try:
55-
template = Template(data)
56+
template = jinja_template_env.from_string(data)
5657
except TemplateError:
5758
raise serializers.ValidationError("Data has incorrect template")
5859

engine/apps/api/serializers/on_call_shifts.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,12 @@ def _validate_frequency(self, frequency, event_type, rolling_users, interval, by
114114
raise serializers.ValidationError(
115115
{"frequency": ["Cannot set 'frequency' for shifts with type 'override'"]}
116116
)
117-
if frequency != CustomOnCallShift.FREQUENCY_WEEKLY and by_day:
117+
if frequency not in (CustomOnCallShift.FREQUENCY_WEEKLY, CustomOnCallShift.FREQUENCY_DAILY) and by_day:
118118
raise serializers.ValidationError({"by_day": ["Cannot set days value for this frequency type"]})
119+
if frequency == CustomOnCallShift.FREQUENCY_DAILY and by_day and interval > len(by_day):
120+
raise serializers.ValidationError(
121+
{"interval": ["Interval must be less than or equal to the number of selected days"]}
122+
)
119123

120124
def _validate_rotation_start(self, shift_start, rotation_start):
121125
if rotation_start < shift_start:

0 commit comments

Comments
 (0)