Skip to content

Commit

Permalink
feat(issue-search): Add group_first_release_id to GroupAttributes pro…
Browse files Browse the repository at this point in the history
…cessor (#5987)

* Add group_first_release_id to the group_attributes table

* Add group_first_release_id to group_attributes

* Update type to UUID

* Add new fields to test

* style(lint): Auto commit lint changes

* Fix test import and add UUID processor

* style(lint): Auto commit lint changes

* Remove processor from entities/

---------

Co-authored-by: getsantry[bot] <66042841+getsantry[bot]@users.noreply.github.com>
  • Loading branch information
snigdhas and getsantry[bot] authored Jun 11, 2024
1 parent 3e81923 commit 43a99f1
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ schema:
{ name: group_status, type: UInt, args: { size: 8 } },
{ name: group_substatus, type: UInt, args: { size: 8, schema_modifiers: [ nullable ] } },
{ name: group_priority, type: UInt, args: { size: 8, schema_modifiers: [ nullable ] } },
{ name: group_first_release_id, type: UUID, args: { schema_modifiers: [ nullable ] } },
{ name: group_first_seen, type: DateTime },
{ name: group_num_comments, type: UInt, args: { size: 64 } },

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ schema:
{ name: group_status, type: UInt, args: { size: 8 } },
{ name: group_substatus, type: UInt, args: { size: 8, schema_modifiers: [ nullable ] } },
{ name: group_priority, type: UInt, args: { size: 8, schema_modifiers: [ nullable ] } },
{ name: group_first_release_id, type: UUID, args: { schema_modifiers: [ nullable ] } },
{ name: group_first_seen, type: DateTime },
{ name: group_num_comments, type: UInt, args: { size: 64 } },

Expand Down Expand Up @@ -58,6 +59,9 @@ allocation_policies:
query_processors:
- processor: TableRateLimit
- processor: ConsistencyEnforcerProcessor
- processor: UUIDColumnProcessor
args:
columns: [group_first_release_id]

mandatory_condition_checkers:
- condition: ProjectIdEnforcer
Expand Down
1 change: 1 addition & 0 deletions snuba/datasets/processors/group_attributes_processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ def process_message(
"group_status": message["status"],
"group_substatus": message["substatus"],
"group_priority": message.get("priority", None),
"group_first_release_id": message.get("first_release_id", None),
"group_first_seen": datetime.strptime(
message["first_seen"], settings.PAYLOAD_DATETIME_FORMAT
),
Expand Down
7 changes: 7 additions & 0 deletions tests/datasets/test_group_attributes_processor.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import uuid
from datetime import datetime
from typing import Optional

Expand All @@ -14,6 +15,8 @@
from snuba.processor import ProcessedMessage
from snuba.writer import WriterTableRow

RELEASE_ID = uuid.uuid4()


@pytest.fixture
def group_created() -> GroupAttributesSnapshot:
Expand All @@ -23,6 +26,8 @@ def group_created() -> GroupAttributesSnapshot:
"group_id": 1,
"status": 0,
"substatus": 7,
"priority": 25,
"first_release_id": RELEASE_ID,
"first_seen": "2023-02-27T15:40:12.223000Z",
"num_comments": 0,
"assignee_user_id": None,
Expand Down Expand Up @@ -59,6 +64,8 @@ def test_group_created(self, group_created):
"group_id": 1,
"group_status": 0,
"group_substatus": 7,
"group_priority": 25,
"group_first_release_id": RELEASE_ID,
"group_first_seen": datetime.strptime(
group_created["first_seen"], settings.PAYLOAD_DATETIME_FORMAT
),
Expand Down

0 comments on commit 43a99f1

Please sign in to comment.