Skip to content

Commit

Permalink
Merge pull request #184 from rudderlabs/develop
Browse files Browse the repository at this point in the history
chore: release v2.4.0
  • Loading branch information
itsmihir authored Sep 24, 2024
2 parents a7a4d14 + 95dadfe commit 4d4c2ec
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 11 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM python:3.8.18-slim
FROM python:3.9-slim

ENV PYTHONUNBUFFERED 1
ENV PIP_DISABLE_PIP_VERSION_CHECK=1
Expand Down
10 changes: 7 additions & 3 deletions alerta/models/alert.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import os
import platform
import sys
import logging
from datetime import datetime
from typing import Optional # noqa
from typing import Any, Dict, List, Tuple, Union
Expand Down Expand Up @@ -141,7 +142,8 @@ def parse(cls, json: JSON) -> 'Alert':
if rudder_resource_type is None or rudder_resource_id is None:
rudder_resource_type, rudder_resource_id = get_rudder_resource_from_tags(tags)
if rudder_resource_type is None or rudder_resource_id is None:
raise ValueError('rudder_resource_type or rudder_resource_id missing - couldnt parse them from tags too')
logging.error('rudder_resource_type or rudder_resource_id missing - could not parse them from tags too')
raise ValueError('rudder_resource_type or rudder_resource_id missing - could not parse them from tags too')

return Alert(
id=json.get('id', None),
Expand Down Expand Up @@ -269,7 +271,8 @@ def from_document(cls, doc: Dict[str, Any]) -> 'Alert':
if rudder_resource_type is None or rudder_resource_id is None:
rudder_resource_type, rudder_resource_id = get_rudder_resource_from_tags(tags)
if rudder_resource_type is None or rudder_resource_id is None:
raise ValueError('rudder_resource_type or rudder_resource_id missing - couldnt parse them from tags too')
logging.error('rudder_resource_type or rudder_resource_id missing - could not parse them from tags too')
raise ValueError('rudder_resource_type or rudder_resource_id missing - could not parse them from tags too')
return Alert(
id=doc.get('id', None) or doc.get('_id'),
resource=doc.get('resource', None),
Expand Down Expand Up @@ -328,7 +331,8 @@ def from_record(cls, rec) -> 'Alert':
if rudder_resource_type is None or rudder_resource_id is None:
rudder_resource_type, rudder_resource_id = get_rudder_resource_from_tags(tags)
if rudder_resource_type is None or rudder_resource_id is None:
raise ValueError('rudder_resource_type or rudder_resource_id missing - couldnt parse them from tags too')
logging.error('rudder_resource_type or rudder_resource_id missing - could not parse them from tags too')
raise ValueError('rudder_resource_type or rudder_resource_id missing - could not parse them from tags too')

return Alert(
id=rec.id,
Expand Down
4 changes: 3 additions & 1 deletion alerta/webhooks/prometheus.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import logging
import datetime
from typing import Any, Dict

Expand Down Expand Up @@ -86,7 +87,8 @@ def parse_prometheus(alert: JSON, external_url: str) -> Alert:
if rudder_resource_type is None or rudder_resource_id is None:
rudder_resource_type, rudder_resource_id = get_rudder_resource_from_tags(tags)
if rudder_resource_type is None or rudder_resource_id is None:
raise ValueError('rudder_resource_type or rudder_resource_id missing - couldnt parse them from tags too')
logging.error('rudder_resource_type or rudder_resource_id missing - could not parse them from tags too')
raise ValueError('rudder_resource_type or rudder_resource_id missing - could not parse them from tags too')

return Alert(
resource=resource,
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"version": "2.3.0"
"version": "2.4.0"
}
6 changes: 3 additions & 3 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
mypy==0.910
pre-commit==2.15.0
pylint==2.11.1
pre-commit==3.7.0
pylint==3.1.0
pytest-cov
pytest>=5.4.3
python-dotenv
requests_mock
twine
wheel==0.38.0
setuptools>=70.0.0
2 changes: 1 addition & 1 deletion requirements-docker.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
lxml==4.6.5
pysaml2==6.5.1
python-ldap==3.3.1
gunicorn==20.1.0
gunicorn==22.0.0
gevent==23.9.0
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
bcrypt==3.2.0
blinker==1.6.2
cryptography==42.0.2
cryptography==43.0.1
Flask==2.2.5
Flask-Compress==1.10.1
Flask-Cors==3.0.10
Expand Down

0 comments on commit 4d4c2ec

Please sign in to comment.