Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions src/sentry/seer/agent/feature_delivery.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
from sentry.seer.autofix.feature.models import (
SINGLE_RUN_FEATURE_ID as AUTOFIX_SINGLE_RUN_FEATURE_ID,
)
from sentry.seer.monitor_cleanup.runs import deliver_monitor_cleanup_result
from sentry.seer.smart_assignment.delivery import deliver_smart_assignment_result

__all__ = ["DELIVERY_HANDLERS", "FeatureDeliveryFn", "FeatureRunStatus"]
Expand All @@ -32,7 +31,6 @@ def __call__(


DELIVERY_HANDLERS: dict[str, FeatureDeliveryFn] = {
"monitor_cleanup": deliver_monitor_cleanup_result,
"night_shift": deliver_agentic_triage_result,
"smart_assignment": deliver_smart_assignment_result,
AUTOFIX_FEATURE_ID: deliver_autofix_feature_result,
Expand Down
37 changes: 0 additions & 37 deletions src/sentry/seer/endpoints/organization_seer_workflow_runs.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
from sentry.db.models.fields.bounded import I64_MAX
from sentry.models.organization import Organization
from sentry.notebooks.access import has_notebooks_access
from sentry.ratelimits.config import RateLimitConfig
from sentry.seer.models.workflow import (
SEER_CONFIGURABLE_WORKFLOW_STRATEGIES,
SeerWorkflowExecutionStatus,
Expand All @@ -35,24 +34,14 @@
SeerWorkflowRunStatus,
SeerWorkflowStrategy,
)
from sentry.seer.monitor_cleanup.runs import create_monitor_cleanup_run
from sentry.seer.workflows.breached_metrics import MetricBreachInputs
from sentry.seer.workflows.definitions import is_scheduled
from sentry.seer_workflow_outputs.models import SeerWorkflowOutputLink
from sentry.types.ratelimit import RateLimit, RateLimitCategory
from sentry.utils.safe import get_path

logger = logging.getLogger(__name__)


class WorkflowRunCreateSerializer(serializers.Serializer):
strategy = serializers.ChoiceField(choices=[SeerWorkflowStrategy.DUPLICATE_MONITORS])


class WorkflowRunCreateResponse(TypedDict):
runId: str


class WorkflowRunListSerializer(serializers.Serializer):
config = serializers.IntegerField(
required=False,
Expand Down Expand Up @@ -166,7 +155,6 @@ class SeerWorkflowRunsResponse(TypedDict):
class OrganizationSeerWorkflowRunsPermission(OrganizationPermission):
scope_map = {
"GET": ["org:read"],
"POST": ["org:read"],
}


Expand All @@ -175,18 +163,9 @@ class OrganizationSeerWorkflowRunsPermission(OrganizationPermission):
class OrganizationSeerWorkflowRunsEndpoint(OrganizationEndpoint):
publish_status = {
"GET": ApiPublishStatus.PRIVATE,
"POST": ApiPublishStatus.PRIVATE,
}
owner = ApiOwner.ML_AI
permission_classes = (OrganizationSeerWorkflowRunsPermission,)
enforce_rate_limit = True
rate_limits = RateLimitConfig(
limit_overrides={
"POST": {
RateLimitCategory.USER: RateLimit(limit=1, window=60),
},
}
)

@extend_schema(
operation_id="List Seer workflow runs",
Expand Down Expand Up @@ -262,22 +241,6 @@ def get(self, request: Request, organization: Organization) -> Response:
),
)

@extend_schema(
operation_id="Start a Seer workflow run",
request=WorkflowRunCreateSerializer,
responses={
202: inline_sentry_response_serializer(
"SeerWorkflowRunCreate", WorkflowRunCreateResponse
),
},
)
def post(self, request: Request, organization: Organization) -> Response:
serializer = WorkflowRunCreateSerializer(data=request.data)
if not serializer.is_valid():
return Response({"detail": serializer.errors}, status=400)
run = create_monitor_cleanup_run(request, organization, source="manual")
return Response({"runId": str(run.id)}, status=202)


def serialize_workflow_runs(
runs: Sequence[SeerWorkflowRun], *, include_investigations: bool
Expand Down
Empty file.
112 changes: 0 additions & 112 deletions src/sentry/seer/monitor_cleanup/results.py

This file was deleted.

86 changes: 0 additions & 86 deletions src/sentry/seer/monitor_cleanup/runs.py

This file was deleted.

Loading
Loading