Skip to content

Commit

Permalink
fix: incident reoslve on default value (#3024)
Browse files Browse the repository at this point in the history
  • Loading branch information
shahargl authored Jan 14, 2025
1 parent 613fc25 commit 5846e46
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
9 changes: 8 additions & 1 deletion keep/api/models/alert.py
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,10 @@ class IncidentDto(IncidentDtoIn):
incident_type: str | None
incident_application: str | None

resolve_on: str = ResolveOn.ALL.value
resolve_on: str = Field(
default=ResolveOn.ALL.value,
description="Resolution strategy for the incident",
)

_tenant_id: str = PrivateAttr()
_alerts: Optional[List[AlertDto]] = PrivateAttr(default=None)
Expand Down Expand Up @@ -514,6 +517,10 @@ def from_db_incident(cls, db_incident: "Incident"):
else db_incident.severity
)

# some default value for resolve_on
if not db_incident.resolve_on:
db_incident.resolve_on = ResolveOn.ALL.value

dto = cls(
id=db_incident.id,
user_generated_name=db_incident.user_generated_name,
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "keep"
version = "0.34.4"
version = "0.34.5"
description = "Alerting. for developers, by developers."
authors = ["Keep Alerting LTD"]
packages = [{include = "keep"}]
Expand Down

0 comments on commit 5846e46

Please sign in to comment.