From 109fbc67584777b0fe14f340db8341bda03f574f Mon Sep 17 00:00:00 2001 From: Vanessasaurus Date: Sat, 22 Aug 2020 20:41:57 -0600 Subject: [PATCH] Unique repos (#5) * ensure that we can have multiple repos per event Signed-off-by: vsoch --- README.md | 6 ++++++ scripts/generate-events.py | 6 +++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index f5e48e7..0b3f298 100644 --- a/README.md +++ b/README.md @@ -185,6 +185,12 @@ users) then you can leave out the query, and don't define the users file. ## Questions +## Why do I only see 1 push event for my repository? + +For push and comment events, it might be the case that a user comments or pushes +multiple times on a single repository. To be concise, we only add the first +event of this type seen, per user and per repository. This means that the +events that are generated are generally an underestimate of actual activity. ## How do I customize the interface? diff --git a/scripts/generate-events.py b/scripts/generate-events.py index bdb81fb..eb1fee8 100755 --- a/scripts/generate-events.py +++ b/scripts/generate-events.py @@ -130,13 +130,13 @@ def generate_content(event, user, seen): avatar = event["actor"]["avatar_url"] if user not in seen: - seen[user] = {"PushEvent": False, "IssueCommentEvent": False} + seen[user] = {"PushEvent": [], "IssueCommentEvent": []} # Only allow one push event, comment event, per repository for _type in ["PushEvent", "IssueCommentEvent"]: - if seen[user][_type] is True: + if repo_name in seen[user][_type]: return None - seen[user][_type] = True + seen[user][_type].append(repo_name) # Content for description on the kind of event if event_type == "PushEvent":