Skip to content

Fix duplicate entries and false new repo detection in reports#32

Merged
justinabrahms merged 2 commits into
mainfrom
work/silly-platypus
Jan 22, 2026
Merged

Fix duplicate entries and false new repo detection in reports#32
justinabrahms merged 2 commits into
mainfrom
work/silly-platypus

Conversation

@justinabrahms
Copy link
Copy Markdown
Owner

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

  • Modified eventTypeToActivityType() to return empty string for CreateEvent
  • Added check in buildReportWithLogging() to skip events with empty activity type
  • Updated test expectations for CreateEvent
  • Added TestNoDuplicateRepoCreations to validate the fix

Test Plan

  • ✅ All existing tests pass
  • ✅ New test validates no duplicate entries when both NewRepos and CreateEvent exist
  • ✅ Pre-commit and pre-push hooks pass (gofmt, goimports, govet, golangci-lint, tests)

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>
@justinabrahms justinabrahms added the multiclaude PR created by multiclaude worker label Jan 22, 2026
@justinabrahms justinabrahms merged commit a41e2b4 into main Jan 22, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

multiclaude PR created by multiclaude worker

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant