11from collections .abc import Mapping
2- from enum import Enum , StrEnum
2+ from enum import StrEnum
33from typing import Any
44
55from attr import dataclass
1515from sentry .organizations .services .organization import RpcOrganization
1616
1717
18- class SCMIntegrationInteractionType (Enum ):
18+ class SCMIntegrationInteractionType (StrEnum ):
1919 """
2020 SCM integration features
2121 """
@@ -37,9 +37,6 @@ class SCMIntegrationInteractionType(Enum):
3737 # Tasks
3838 LINK_ALL_REPOS = "LINK_ALL_REPOS"
3939
40- def __str__ (self ) -> str :
41- return self .value .lower ()
42-
4340
4441@dataclass
4542class SCMIntegrationInteractionEvent (IntegrationEventLifecycleMetric ):
@@ -70,15 +67,6 @@ def get_extras(self) -> Mapping[str, Any]:
7067 }
7168
7269
73- class LinkAllReposHaltReason (StrEnum ):
74- """Common reasons why a link all repos task may halt without success/failure."""
75-
76- MISSING_INTEGRATION = "missing_integration"
77- MISSING_ORGANIZATION = "missing_organization"
78- RATE_LIMITED = "rate_limited"
79- REPOSITORY_NOT_CREATED = "repository_not_created"
80-
81-
8270@dataclass
8371class CommitContextIntegrationInteractionEvent (SCMIntegrationInteractionEvent ):
8472 """
@@ -109,3 +97,12 @@ class CommitContextHaltReason(StrEnum):
10997 COMMIT_NOT_IN_DEFAULT_BRANCH = "commit_not_in_default_branch"
11098 MISSING_PR = "missing_pr"
11199 ALREADY_QUEUED = "already_queued"
100+
101+
102+ class LinkAllReposHaltReason (StrEnum ):
103+ """Common reasons why a link all repos task may halt without success/failure."""
104+
105+ MISSING_INTEGRATION = "missing_integration"
106+ MISSING_ORGANIZATION = "missing_organization"
107+ RATE_LIMITED = "rate_limited"
108+ REPOSITORY_NOT_CREATED = "repository_not_created"
0 commit comments