Skip to content

Commit 47ef3f6

Browse files
committed
Address CodeRabbit review: filter events by period_end, fix ARG002 in stub
1 parent 56e86ee commit 47ef3f6

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

src/ghdcbot/engine/snapshots.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,7 @@ def _collect_snapshot_data(
284284
notifications_data = []
285285
list_notifications = getattr(storage, "list_recent_notifications", None)
286286
if callable(list_notifications):
287-
recent_notifications = list_notifications(limit=1000) # Last 1000 notifications
287+
recent_notifications = list_notifications(1000) # Last 1000 notifications
288288
for notif in recent_notifications:
289289
notifications_data.append({
290290
"dedupe_key": notif.get("dedupe_key"),
@@ -327,6 +327,7 @@ def _collect_snapshot_data(
327327
"payload": event.payload,
328328
}
329329
for event in list_contributions(period_start)
330+
if event.created_at <= period_end
330331
]
331332
files["events.json"] = {
332333
"schema_version": SCHEMA_VERSION,

tests/test_snapshots.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -501,7 +501,7 @@ def test_write_snapshots_raw_events_via_config() -> None:
501501
def test_raw_events_graceful_when_storage_missing_method() -> None:
502502
"""events.json is omitted gracefully if storage lacks list_contributions."""
503503
class MinimalStorage:
504-
def list_recent_notifications(self, limit: int = 1000) -> list[dict]:
504+
def list_recent_notifications(self, _limit: int = 1000) -> list[dict]:
505505
return []
506506
def list_pending_issue_requests(self) -> list[dict]:
507507
return []

0 commit comments

Comments
 (0)