Skip to content

Review depth: normalise comment count by PR size (lines changed) #26

Description

@gkanitz

Parent

#1

Background

The report currently classifies reviews as shallow (0–2 comments) or deep (≥3 comments) using an absolute comment count threshold. This treats a 3-comment review on a 10-line fix the same as a 3-comment review on a 500-line refactor, which understates the engagement on large PRs and overstates it on trivial ones.

What to build

Normalise the shallow/deep split by the size of the reviewed PR: compute a comments-per-100-lines-changed ratio and threshold against that instead of (or in addition to) the absolute count.

Why deferred

Requires storing `additions` + `deletions` from the PR object for every PR the subject reviewed — a schema change to the activity set and an adapter change to fetch the extra field. GitHub exposes this without a diff fetch (it is on the PR object itself), but the scope increase (schema, adapter, tests, renderer) was judged out of proportion for v1. The ≥3 absolute threshold is a good-enough proxy for v1.

Acceptance criteria

  • PR size (additions + deletions) is fetched and stored per reviewed PR (GitHub and GitLab adapters)
  • Shallow/deep threshold is expressed as comments per N lines changed (configurable or well-chosen constant), not absolute count
  • The headline "deep review %" KPI and the stacked timeline chart both use the normalised threshold
  • Existing ≥3 absolute threshold tests are updated or replaced

Blocked by

  • Visualisation / charting issue (graphs overhaul, to be filed)

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions