|
@@ -434,6 +434,21 @@ class GroupListTest(APITestCase, SnubaTestCase):
|
|
|
response = self.get_response(environment="garbage")
|
|
|
assert response.status_code == 404
|
|
|
|
|
|
+ def test_project(self):
|
|
|
+ self.store_event(
|
|
|
+ data={
|
|
|
+ "fingerprint": ["put-me-in-group1"],
|
|
|
+ "timestamp": iso_format(self.min_ago),
|
|
|
+ "environment": "production",
|
|
|
+ },
|
|
|
+ project_id=self.project.id,
|
|
|
+ )
|
|
|
+ project = self.project
|
|
|
+
|
|
|
+ self.login_as(user=self.user)
|
|
|
+ response = self.get_success_response(query=f"project:{project.slug}")
|
|
|
+ assert len(response.data) == 1
|
|
|
+
|
|
|
def test_auto_resolved(self):
|
|
|
project = self.project
|
|
|
project.update_option("sentry:resolve_age", 1)
|
|
@@ -538,6 +553,36 @@ class GroupListTest(APITestCase, SnubaTestCase):
|
|
|
response = self.get_success_response(query=short_id, shortIdLookup=1)
|
|
|
assert len(response.data) == 1
|
|
|
|
|
|
+ def test_lookup_by_short_id_alias(self):
|
|
|
+ event_id = "f" * 32
|
|
|
+ group = self.store_event(
|
|
|
+ data={"event_id": event_id, "timestamp": iso_format(before_now(seconds=1))},
|
|
|
+ project_id=self.project.id,
|
|
|
+ ).group
|
|
|
+ short_id = group.qualified_short_id
|
|
|
+
|
|
|
+ self.login_as(user=self.user)
|
|
|
+ response = self.get_success_response(query=f"issue:{short_id}")
|
|
|
+ assert len(response.data) == 1
|
|
|
+
|
|
|
+ def test_lookup_by_multiple_short_id_alias(self):
|
|
|
+ self.login_as(self.user)
|
|
|
+ project = self.project
|
|
|
+ project2 = self.create_project(name="baz", organization=project.organization)
|
|
|
+ event = self.store_event(
|
|
|
+ data={"timestamp": iso_format(before_now(seconds=2))},
|
|
|
+ project_id=project.id,
|
|
|
+ )
|
|
|
+ event2 = self.store_event(
|
|
|
+ data={"timestamp": iso_format(before_now(seconds=1))},
|
|
|
+ project_id=project2.id,
|
|
|
+ )
|
|
|
+ with self.feature("organizations:global-views"):
|
|
|
+ response = self.get_success_response(
|
|
|
+ query=f"issue:[{event.group.qualified_short_id},{event2.group.qualified_short_id}]"
|
|
|
+ )
|
|
|
+ assert len(response.data) == 2
|
|
|
+
|
|
|
def test_lookup_by_short_id_ignores_project_list(self):
|
|
|
organization = self.create_organization()
|
|
|
project = self.create_project(organization=organization)
|