Skip to content

Data model: per-review comment counts and all-time window default #27

Description

@gkanitz

Parent

#1

What to build

Two related data-layer changes that unblock the visual overhaul (#28):

1. Per-review comment counts

The current schema stores reviews_given as a total count and review_comments_written as a separate aggregate. To split reviews into shallow (0–2 inline comments) and deep (≥3 inline comments), the activity set needs to know how many comments were left on each individual review event. Add a comment count to each Review entry in ActivitySet.ReviewsGiven and update both the GitHub and GitLab adapters to populate it. The renderer and report schema must expose this so the chart layer can bucket reviews at render time.

2. All-time window default

The current default is -window-days 365. Reports are most useful when they span the subject's entire tenure at an organisation. Change the default to all-time (no lower bound) and make -window-days an optional override. The window Since field should be zero/unset when no bound is specified; adapters must handle an open-ended lower bound correctly (fetch all pages rather than stopping at a date). The coverage block in the report should display "all time" when no window is set.

Acceptance criteria

  • Review in ActivitySet.ReviewsGiven carries a CommentCount int field populated by both GitHub and GitLab adapters
  • Report JSON exposes per-review comment counts (or a pre-bucketed shallow/deep split) so the renderer can compute deep-review %
  • Running with no -window-days flag fetches all available history (no 365-day cutoff)
  • Coverage block renders "all time" when no window bound is set
  • Existing tests updated; new tests cover the open-ended window path and comment-count population

Parallel-work contract

  • Owns: provider/ (ActivitySet, Review struct, both adapters), report/ schema, -window-days CLI flag default
  • Must not touch: renderer templates, SVG generation, HTML layout
  • Shared files (additive only): report/report.go schema structs

Blocked by

None — can start immediately.

Metadata

Metadata

Assignees

No one assigned

    Labels

    ready-for-agentTriage complete; ready for an agent to pick up

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions