Fix duplicate entries and false new repo detection in reports#32
Merged
Conversation
Fixed two bugs in report generation:
1. DUPLICATE ENTRIES: Users appearing twice with 'created repos'
- Root cause: CreateEvent was being converted to ActivityCreatedRepo,
but NewRepos (from comparing owned repos) also created the same entry
- Fix: Skip CreateEvent to ActivityCreatedRepo conversion since NewRepos
already tracks actual repository creations
2. FALSE 'NEW REPO' DETECTION: Old repos showing as newly created
- Root cause: GitHub CreateEvent includes branch/tag creation, not just
repository creation. So creating a branch on datasette (a years-old
repo) would incorrectly show as "datasette created 2 hours ago"
- Fix: Don't convert CreateEvent to ActivityCreatedRepo at all
Changes:
- Modified eventTypeToActivityType() to return empty string for CreateEvent
- Added check to skip events with empty activity type
- Updated test expectations for CreateEvent
- Added TestNoDuplicateRepoCreations to validate the fix
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixed two critical bugs in report generation:
Bug #1: DUPLICATE ENTRIES
Users appearing twice with 'created repos' (e.g., simonw showing up twice)
Root cause: CreateEvent was being converted to ActivityCreatedRepo, but NewRepos (from comparing owned repos) also created the same entry, resulting in double-counting.
Fix: Skip CreateEvent → ActivityCreatedRepo conversion since NewRepos already tracks actual repository creations.
Bug #2: FALSE 'NEW REPO' DETECTION
Old repositories showing as newly created (e.g., datasette showing as "created 2 hours ago")
Root cause: GitHub CreateEvent includes branch/tag creation, not just repository creation. Creating a branch on a years-old repo would incorrectly show the repo as newly created.
Fix: Don't convert CreateEvent to ActivityCreatedRepo at all since it's ambiguous and covered by NewRepos.
Changes
eventTypeToActivityType()to return empty string for CreateEventbuildReportWithLogging()to skip events with empty activity typeTestNoDuplicateRepoCreationsto validate the fixTest Plan