feat(activity): aggregate contributions from push events by day #297

Merged
fuzzy merged 1 commit from phase02-aggregation into main 2026-07-07 09:11:02 +00:00
Owner

What

Complete Phase 2 event aggregation by adding push/commit event counting to AggregateActivityByDay.

Changes

  • pushCommitCount() — parses the Content JSON from push/commit_repo activity events. Uses the Len field if present (total commits in push), falls back to len(Commits). Returns 0 if unparseable.
  • AggregateActivityByDay now handles push and commit_repo op types, adding commit count as Additions metric.
  • Dates normalized to UTC via f.Created.UTC().

Completed

  • #191 PR opens/closes — done in previous PR
  • #192 Issue opens/closes — done in previous PR
  • #193 Push event additions — this PR
  • #194 UTC normalization — done in previous PR

Phase 2 is now fully finished. Next: Phase 3 (sparkline rendering).

Testing

  • 8 new subtests: pushCommitCount (empty, invalid JSON, no commits, Len field, commits array, Len zero with commits), push aggregation with content, empty content ignored
  • golangci-lint run ./internal/activity/ — 0 issues
  • go test ./internal/activity/ — all pass
## What Complete Phase 2 event aggregation by adding push/commit event counting to `AggregateActivityByDay`. ### Changes - **pushCommitCount()** — parses the `Content` JSON from `push`/`commit_repo` activity events. Uses the `Len` field if present (total commits in push), falls back to `len(Commits)`. Returns 0 if unparseable. - **AggregateActivityByDay** now handles `push` and `commit_repo` op types, adding commit count as `Additions` metric. - Dates normalized to UTC via `f.Created.UTC()`. ### Completed - #191 PR opens/closes — done in previous PR - #192 Issue opens/closes — done in previous PR - #193 Push event additions — **this PR** - #194 UTC normalization — done in previous PR **Phase 2 is now fully finished.** Next: Phase 3 (sparkline rendering). ## Testing - [x] 8 new subtests: pushCommitCount (empty, invalid JSON, no commits, Len field, commits array, Len zero with commits), push aggregation with content, empty content ignored - [x] `golangci-lint run ./internal/activity/` — 0 issues - [x] `go test ./internal/activity/` — all pass
feat(activity): aggregate contributions from push events by day
All checks were successful
Test and Release / lint (pull_request) Successful in 11m0s
Test and Release / test (pull_request) Successful in 14m58s
78f3876c19
- pushCommitCount(): parse push/commit_repo Content JSON for Len
  field or commits array length
- AggregateActivityByDay now handles push/commit_repo events,
  adding commit count as additions metric
- 8 new subtests: pushCommitCount parsing (6 cases), push aggregation
  with content, empty/missing content ignored
- Dates normalized to UTC throughout

Ref: #195, #191, #192, #193, #194
fuzzy added this to the Steeper project 2026-07-07 08:58:15 +00:00
the.auditor left a comment

Review

Result: Approved — no blocking issues.

Summary: Completes Phase 2 event aggregation. Adds pushCommitCount() helper extracting commit counts from push/commit_repo Content JSON (Len field preferred, Commits array fallback, 0 on parse error). AggregateActivityByDay now handles push/commit_repo op types, adding commit count as Additions. ROADMAP2.md updated — Phase 2 fully complete.

Notes: Deletions field remains 0 (not available from activity feed push payload). pushCommitCount is unexported with a doc comment — no godoc gap.

Checklist:

  • Correctness: Len > Commits fallback correct, zero-commit pushes excluded, all op types handled
  • Completeness: Closes #193 — push event contributions now aggregated
  • Test coverage: 8 new subtests (6 pushCommitCount edge cases, push aggregation, empty content)
  • Error handling: Malformed JSON returns 0, zero-commit pushes don't create bogus day entries
  • Maintainability: Minimal, self-contained change
## Review **Result: Approved** — no blocking issues. **Summary:** Completes Phase 2 event aggregation. Adds `pushCommitCount()` helper extracting commit counts from push/commit_repo Content JSON (Len field preferred, Commits array fallback, 0 on parse error). `AggregateActivityByDay` now handles `push`/`commit_repo` op types, adding commit count as `Additions`. ROADMAP2.md updated — Phase 2 fully complete. **Notes:** `Deletions` field remains 0 (not available from activity feed push payload). `pushCommitCount` is unexported with a doc comment — no godoc gap. **Checklist:** - Correctness: ✅ Len > Commits fallback correct, zero-commit pushes excluded, all op types handled - Completeness: ✅ Closes #193 — push event contributions now aggregated - Test coverage: ✅ 8 new subtests (6 pushCommitCount edge cases, push aggregation, empty content) - Error handling: ✅ Malformed JSON returns 0, zero-commit pushes don't create bogus day entries - Maintainability: ✅ Minimal, self-contained change
fuzzy scheduled this pull request to auto merge when all checks succeed 2026-07-07 08:59:20 +00:00
fuzzy merged commit 78f3876c19 into main 2026-07-07 09:11:02 +00:00
fuzzy deleted branch phase02-aggregation 2026-07-07 09:11:02 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
thwap/steeper!297
No description provided.