Skip to content

Commit

Permalink
Unique repos (#5)
Browse files Browse the repository at this point in the history
* ensure that we can have multiple repos per event
Signed-off-by: vsoch <[email protected]>
  • Loading branch information
vsoch authored Aug 23, 2020
1 parent 36ed4da commit 109fbc6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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?
Expand Down
6 changes: 3 additions & 3 deletions scripts/generate-events.py
Original file line number Diff line number Diff line change
Expand Up @@ -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":
Expand Down

0 comments on commit 109fbc6

Please sign in to comment.