Skip to content

Commit

Permalink
fix(aci): Use camel case for detector index endpoint (#84266)
Browse files Browse the repository at this point in the history
Quick fix to use camel case instead of snake case here
  • Loading branch information
ceorourke authored Jan 29, 2025
1 parent 8192905 commit e3b70b9
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ def post(self, request, project):
:param object data_source: Configuration for the data source
:param array data_conditions: List of conditions to trigger the detector
"""
group_type = request.data.get("group_type")
group_type = request.data.get("groupType")
if not group_type:
raise ValidationError({"groupType": ["This field is required."]})

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,17 +54,17 @@ def setUp(self):
super().setUp()
self.valid_data = {
"name": "Test Detector",
"group_type": MetricAlertFire.slug,
"data_source": {
"query_type": SnubaQuery.Type.ERROR.value,
"groupType": MetricAlertFire.slug,
"dataSource": {
"queryType": SnubaQuery.Type.ERROR.value,
"dataset": Dataset.Events.name.lower(),
"query": "test query",
"aggregate": "count()",
"time_window": 60,
"timeWindow": 60,
"environment": self.environment.name,
"event_types": [SnubaQueryEventType.EventType.ERROR.value],
"eventTypes": [SnubaQueryEventType.EventType.ERROR.value],
},
"data_conditions": [
"dataConditions": [
{
"type": Condition.GREATER,
"comparison": 100,
Expand All @@ -75,7 +75,7 @@ def setUp(self):

def test_missing_group_type(self):
data = {**self.valid_data}
del data["group_type"]
del data["groupType"]
response = self.get_error_response(
self.organization.slug,
self.project.slug,
Expand All @@ -85,7 +85,7 @@ def test_missing_group_type(self):
assert response.data == {"groupType": ["This field is required."]}

def test_invalid_group_type(self):
data = {**self.valid_data, "group_type": "invalid_type"}
data = {**self.valid_data, "groupType": "invalid_type"}
response = self.get_error_response(
self.organization.slug,
self.project.slug,
Expand All @@ -97,7 +97,7 @@ def test_invalid_group_type(self):
def test_incompatible_group_type(self):
with mock.patch("sentry.issues.grouptype.registry.get_by_slug") as mock_get:
mock_get.return_value = mock.Mock(detector_validator=None)
data = {**self.valid_data, "group_type": "incompatible_type"}
data = {**self.valid_data, "groupType": "incompatible_type"}
response = self.get_error_response(
self.organization.slug,
self.project.slug,
Expand Down

0 comments on commit e3b70b9

Please sign in to comment.