Skip to content

Commit a1252ee

Browse files
authored
ref(grouping): make BE send grouping info with underscores and not dashes (#97426)
1 parent 42f54d2 commit a1252ee

File tree

2 files changed

+1
-45
lines changed

2 files changed

+1
-45
lines changed

src/sentry/issues/endpoints/event_grouping_info.py

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -48,22 +48,7 @@ def get(self, request: HttpRequest, project, event_id) -> HttpResponse:
4848
)
4949
grouping_config.initial_context["reverse_stacktraces"] = should_reverse_stacktraces
5050

51-
_grouping_info = get_grouping_info(grouping_config, project, event)
52-
53-
# TODO: All of the below is a temporary hack to preserve compatibility between the BE and FE as
54-
# we transition from using dashes in the keys/variant types to using underscores. For now, until
55-
# we change the FE, we switch back to dashes before sending the data.
56-
grouping_info = {}
57-
58-
for key, variant_dict in _grouping_info.items():
59-
new_key = key.replace("_", "-")
60-
new_type = variant_dict.get("type", "").replace("_", "-")
61-
62-
variant_dict["key"] = new_key
63-
if "type" in variant_dict:
64-
variant_dict["type"] = new_type
65-
66-
grouping_info[new_key] = variant_dict
51+
grouping_info = get_grouping_info(grouping_config, project, event)
6752

6853
return HttpResponse(
6954
orjson.dumps(grouping_info, option=orjson.OPT_UTC_Z), content_type="application/json"

tests/sentry/issues/endpoints/test_event_grouping_info.py

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -216,32 +216,3 @@ def test_get_grouping_info_hash_mismatch(
216216
"event_grouping_info.hash_mismatch",
217217
extra={"project_id": self.project.id, "event_id": javascript_event.event_id},
218218
)
219-
220-
def test_variant_keys_and_types_use_dashes_not_underscores(self) -> None:
221-
"""
222-
Test to make sure switching to using underscores on the BE doesn't change what we send
223-
to the FE.
224-
"""
225-
data = load_data(platform="javascript")
226-
data["fingerprint"] = ["dogs are great"]
227-
event = self.store_event(data=data, project_id=self.project.id)
228-
229-
url = reverse(
230-
"sentry-api-0-event-grouping-info",
231-
kwargs={
232-
"organization_id_or_slug": self.organization.slug,
233-
"project_id_or_slug": self.project.slug,
234-
"event_id": event.event_id,
235-
},
236-
)
237-
238-
response = self.client.get(url, format="json")
239-
content = orjson.loads(response.content)
240-
241-
assert response.status_code == 200
242-
243-
assert "custom-fingerprint" in content
244-
assert "custom_fingerprint" not in content
245-
246-
assert content["custom-fingerprint"]["key"] == "custom-fingerprint"
247-
assert content["custom-fingerprint"]["type"] == "custom-fingerprint"

0 commit comments

Comments
 (0)