feat(activity): implement API fetcher with pagination and event aggregation #295
No reviewers
Labels
No labels
Compat/Breaking
Kind/Bug
Kind/Documentation
Kind/Enhancement
Kind/Feature
Kind/Security
Kind/Testing
Priority
Critical
Priority
High
Priority
Low
Priority
Medium
Reviewed
Confirmed
Reviewed
Duplicate
Reviewed
Invalid
Reviewed
Won't Fix
Status
Abandoned
Status
Blocked
Status
Need More Info
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
thwap/steeper!295
Loading…
Reference in a new issue
No description provided.
Delete branch "phase02-fetcher"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What
Add API fetcher for the activity view, plus the necessary
sinceparameter support across the forge client interface.forge.Client changes
ListUserActivitiesnow acceptssince time.Time— pass zero value for existing behaviorDatefield inListUserActivityFeedsOptions(SDK already supported it)&date=query parameter to raw HTTP callsinceparameter in cache keytime.Time{}(no behavior change)New: fetcher.go
[]*ActivityFeedto[]DailyActivity, categorizing PR opens/closes and issue opens/closes by UTC-normalized dayReferences: #190, #187
Testing
golangci-lint run ./internal/activity/ ./internal/forge/— 0 issuesgo vet ./internal/...— 0 issuesgo test ./internal/activity/ ./internal/forge/ ./internal/tui/— all pass- Add param to forge.Client.ListUserActivities across all implementations (gitea, forgejo, cached, mock) - Gitea: passes Date field in ListUserActivityFeedsOptions - Forgejo: adds &date= query parameter to raw HTTP call - HomeView updated to pass zero time (existing behavior unchanged) - Create fetcher.go with: - FetchActivityEvents(): paginated fetch with PageSize=50, max 500 - AggregateActivityByDay(): categorizes PR opens/closes, issue opens/closes by UTC-normalized day - 5 new tests covering empty, single day, multi-day, unknown types Ref: #190, #187Review
Result: Approved — no blocking issues.
Summary: Adds
internal/activity/fetcher.gowithFetchActivityEvents(paginated API fetch, PageSize=50, max 500) andAggregateActivityByDay(counts PR opens/closes and issue opens/closes per UTC day). Extendsforge.Clientinterface withsince time.Timeparameter across all implementations (Gitea, Forgejo, CachedClient). Updates homeview caller with zero-time for backward compat. ROADMAP2.md updated — Phase 2 top-level items complete.Notable design:
additions/deletionsaggregation not yet implemented (tracked as #193, unchecked in ROADMAP2). Expected — Push events currently ignored by aggregation.Non-blocking:
FetchActivityEventsandAggregateActivityByDayChecklist:
sincepassed through all client layers, aggregation counts correct per OpType