Skip to content
Merged
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
4 changes: 4 additions & 0 deletions src/sentry/issues/endpoints/group_hashes.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,10 @@

from sentry.api.api_publish_status import ApiPublishStatus
from sentry.api.base import region_silo_endpoint
from sentry.api.helpers.deprecation import deprecated
from sentry.api.paginator import GenericOffsetPaginator
from sentry.api.serializers import EventSerializer, SimpleEventSerializer, serialize
from sentry.constants import CELL_API_DEPRECATION_DATE
from sentry.issues.endpoints.bases.group import GroupEndpoint
from sentry.models.group import Group
from sentry.models.grouphash import GroupHash
Expand All @@ -34,6 +36,7 @@ class GroupHashesEndpoint(GroupEndpoint):
"GET": ApiPublishStatus.PRIVATE,
}

@deprecated(CELL_API_DEPRECATION_DATE, url_names=["sentry-api-0-group-hashes"])
def get(self, request: Request, group: Group) -> Response:
"""
List an Issue's Hashes
Expand Down Expand Up @@ -71,6 +74,7 @@ def get(self, request: Request, group: Group) -> Response:
paginator=GenericOffsetPaginator(data_fn=data_fn),
)

@deprecated(CELL_API_DEPRECATION_DATE, url_names=["sentry-api-0-group-hashes"])
def put(self, request: Request, group: Group) -> Response:
"""
Perform an unmerge by reassigning events with hash values corresponding to the given
Expand Down
12 changes: 6 additions & 6 deletions tests/sentry/issues/endpoints/test_group_hashes.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def test_only_return_latest_event(self) -> None:

assert new_event.group_id == old_event.group_id

url = f"/api/0/issues/{new_event.group_id}/hashes/"
url = f"/api/0/organizations/{self.organization.slug}/issues/{new_event.group_id}/hashes/"
response = self.client.get(url, format="json")

assert response.status_code == 200, response.content
Expand Down Expand Up @@ -78,7 +78,7 @@ def test_return_multiple_hashes(self) -> None:

eventstream.end_merge(state)

url = f"/api/0/issues/{event1.group_id}/hashes/"
url = f"/api/0/organizations/{self.organization.slug}/issues/{event1.group_id}/hashes/"
response = self.client.get(url, format="json")

assert response.status_code == 200, response.content
Expand Down Expand Up @@ -147,7 +147,7 @@ def test_return_multiple_hashes_with_seer_match(self) -> None:
metadata2.seer_matched_grouphash = grouphash1
metadata2.save()

url = f"/api/0/issues/{event1.group_id}/hashes/"
url = f"/api/0/organizations/{self.organization.slug}/issues/{event1.group_id}/hashes/"
response = self.client.get(url, format="json")

assert response.status_code == 200, response.content
Expand Down Expand Up @@ -178,7 +178,7 @@ def test_unmerge(self) -> None:

url = "?".join(
[
f"/api/0/issues/{group.id}/hashes/",
f"/api/0/organizations/{self.organization.slug}/issues/{group.id}/hashes/",
urlencode({"id": [h.hash for h in hashes]}, True),
]
)
Expand Down Expand Up @@ -210,7 +210,7 @@ def test_unmerge_put_member(self) -> None:

url = "?".join(
[
f"/api/0/issues/{group.id}/hashes/",
f"/api/0/organizations/{self.organization.slug}/issues/{group.id}/hashes/",
urlencode({"id": [h.hash for h in hashes]}, True),
]
)
Expand All @@ -237,7 +237,7 @@ def test_unmerge_conflict(self) -> None:

url = "?".join(
[
f"/api/0/issues/{group.id}/hashes/",
f"/api/0/organizations/{self.organization.slug}/issues/{group.id}/hashes/",
urlencode({"id": [h.hash for h in hashes]}, True),
]
)
Expand Down
Loading