Skip to content

Commit 86ae715

Browse files
committed
use objectstatus
1 parent 8336672 commit 86ae715

File tree

3 files changed

+7
-12
lines changed

3 files changed

+7
-12
lines changed

src/sentry/workflow_engine/models/detector.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@
1212
from jsonschema import ValidationError
1313

1414
from sentry.backup.scopes import RelocationScope
15+
from sentry.constants import ObjectStatus
1516
from sentry.db.models import DefaultFieldsModel, FlexibleForeignKey, region_silo_model
1617
from sentry.db.models.fields.hybrid_cloud_foreign_key import HybridCloudForeignKey
1718
from sentry.issues import grouptype
1819
from sentry.issues.grouptype import GroupType
1920
from sentry.models.owner_base import OwnerModel
20-
from sentry.workflow_engine.types import WorkflowEngineObjectStatus
2121

2222
from .json_config import JSONConfigBase
2323

@@ -44,8 +44,8 @@ class Detector(DefaultFieldsModel, OwnerModel, JSONConfigBase):
4444

4545
# The detector's status - used for tracking deletion state
4646
status = models.SmallIntegerField(
47-
default=WorkflowEngineObjectStatus.ACTIVE.value,
48-
db_default=WorkflowEngineObjectStatus.ACTIVE.value,
47+
default=ObjectStatus.ACTIVE.value,
48+
db_default=ObjectStatus.ACTIVE.value,
4949
)
5050

5151
# Optionally set a description of the detector, this will be used in notifications

src/sentry/workflow_engine/models/workflow.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,12 @@
77
from django.dispatch import receiver
88

99
from sentry.backup.scopes import RelocationScope
10+
from sentry.constants import ObjectStatus
1011
from sentry.db.models import DefaultFieldsModel, FlexibleForeignKey, region_silo_model, sane_repr
1112
from sentry.db.models.fields.hybrid_cloud_foreign_key import HybridCloudForeignKey
1213
from sentry.models.owner_base import OwnerModel
1314
from sentry.workflow_engine.models.data_condition import DataCondition, is_slow_condition
14-
from sentry.workflow_engine.types import WorkflowEngineObjectStatus, WorkflowEventData
15+
from sentry.workflow_engine.types import WorkflowEventData
1516

1617
from .json_config import JSONConfigBase
1718

@@ -32,8 +33,8 @@ class Workflow(DefaultFieldsModel, OwnerModel, JSONConfigBase):
3233

3334
# The workflow's status - used for tracking deletion state
3435
status = models.SmallIntegerField(
35-
default=WorkflowEngineObjectStatus.ACTIVE.value,
36-
db_default=WorkflowEngineObjectStatus.ACTIVE.value,
36+
default=ObjectStatus.ACTIVE.value,
37+
db_default=ObjectStatus.ACTIVE.value,
3738
)
3839

3940
# Required as the 'when' condition for the workflow, this evalutes states emitted from the detectors

src/sentry/workflow_engine/types.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -142,9 +142,3 @@ class DetectorSettings:
142142
handler: type[DetectorHandler] | None = None
143143
validator: type[BaseDetectorTypeValidator] | None = None
144144
config_schema: dict[str, Any] = field(default_factory=dict)
145-
146-
147-
class WorkflowEngineObjectStatus(IntEnum):
148-
ACTIVE = 0
149-
PENDING_DELETION = 1
150-
DELETION_IN_PROGRESS = 2

0 commit comments

Comments
 (0)