Skip to content

Commit

Permalink
add constant
Browse files Browse the repository at this point in the history
  • Loading branch information
khvn26 committed Jan 28, 2025
1 parent 8515376 commit 75d0ef3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
1 change: 1 addition & 0 deletions api/features/feature_health/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
FEATURE_HEALTH_EVENT_CREATED_PROVIDER_MESSAGE = "\n\nProvided by %s"
FEATURE_HEALTH_EVENT_CREATED_REASON_MESSAGE = "\n\nReason:\n%s"

UNHEALTHY_TAG_LABEL = "Unhealthy"
UNHEALTHY_TAG_COLOUR = "#FFC0CB"

FEATURE_HEALTH_WEBHOOK_PATH_PREFIX = "/api/v1/feature-health/"
7 changes: 5 additions & 2 deletions api/features/feature_health/services.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@
import structlog

from environments.models import Environment
from features.feature_health.constants import UNHEALTHY_TAG_COLOUR
from features.feature_health.constants import (
UNHEALTHY_TAG_COLOUR,
UNHEALTHY_TAG_LABEL,
)
from features.feature_health.models import (
FeatureHealthEvent,
FeatureHealthEventType,
Expand Down Expand Up @@ -72,7 +75,7 @@ def update_feature_unhealthy_tag(feature: "Feature") -> None:
*FeatureHealthEvent.objects.get_latest_by_feature(feature)
]:
unhealthy_tag, _ = Tag.objects.get_or_create(
label="Unhealthy",
label=UNHEALTHY_TAG_LABEL,
project=feature.project,
defaults={"color": UNHEALTHY_TAG_COLOUR},
is_system_tag=True,
Expand Down

0 comments on commit 75d0ef3

Please sign in to comment.