Skip to content

PR Enrichment & Auto-Linking

Commits tell you what changed. Pull requests tell you why, who reviewed it, and how the team collaborated. ShipLens links these two signals together automatically, giving you a fuller picture of engineering output.

Commit-PR Auto-Linking

When ShipLens syncs a repository, it matches commits to their originating pull requests using two strategies:

StrategyHow It WorksCoverage
Merge commit parsingExtracts PR number from merge commit messages (e.g., Merge pull request #42)~80% of PRs
SHA matchingQueries the provider API for PRs containing a specific commit SHACatches squash merges, rebases

Both strategies run during sync. If a commit matches multiple PRs (e.g., cherry-picked across branches), all associations are recorded.

PR Schema

Each synced pull request stores the following:

FieldTypeDescription
providerenumgithub, bitbucket
numberintegerPR number within the repository
titlestringPR title as written by the author
stateenumopen, merged, closed
authorstringLogin of the PR author
reviewerslistLogins of all reviewers (requested + actual)
additionsintegerLines added across all commits
deletionsintegerLines removed across all commits
review_commentsintegerCount of review comments (not general comments)
merged_atdatetimeWhen the PR was merged (nil if not merged)
created_atdatetimeWhen the PR was opened

PR Analysis

Pull requests are analyzed by the LLM in the same way commits are — but with richer context. The PR analysis prompt includes the title, description, file list, and review discussion, producing:

FieldTypeDescription
summarystringWhat this PR accomplishes in plain language
complexity1–5Complexity of the overall change
impact1–5Impact on the system
areas_affectedlistDomains and modules touched

PR analysis uses Claude Haiku by default. Cost: ~$0.002–0.005 per PR.

PR Scoring

PR scoring is a separate engine from commit scoring. This is deliberate — a PR represents a unit of shipped work, while a commit represents a unit of effort. Conflating them would muddy both signals.

The PR scoring engine evaluates:

DimensionWhat It Measures
Size disciplineIs the PR appropriately scoped? (penalizes both trivial and massive PRs)
Review qualityDid reviewers engage meaningfully? (comment count, back-and-forth)
Cycle timeHow long from open to merge?
Description qualityDid the author explain the change? (LLM-assessed)

PR scores are not averaged into contributor scores. They're a separate lens.

Cycle Time Analysis

Cycle time is measured per PR and aggregated per squad:

cycle_time=merged_atcreated_at

ShipLens breaks cycle time into percentiles per squad:

MetricDescription
p50Median cycle time — the "typical" PR
p7575th percentile — where slowdowns start
p9090th percentile — outliers that may indicate blockers

Cycle time trends are tracked week-over-week. A sustained increase in p75 often signals process bottlenecks, unclear ownership, or review bandwidth issues.

PR Size Distribution

PR size is categorized by total lines changed (additions + deletions):

SizeLines ChangedIdeal %
S1–5030–40%
M51–20040–50%
L201–50010–15%
XL500+< 5%

Large PR Warning

Teams where more than 20% of PRs are L or XL consistently may be struggling with incremental delivery. Large PRs are harder to review, more likely to introduce bugs, and slower to merge.

Collaboration Metrics

ShipLens tracks collaboration patterns derived from PR activity:

MetricFormulaWhat It Reveals
Review participationPRs reviewedtotal team PRsIs review load shared or concentrated?
Comment densityreview commentsPRs reviewedDepth of review engagement
Self-merge ratioPRs merged without reviewtotal PRsProcess discipline

These metrics are surfaced at the squad level and in weekly digests.

Provider Sync

GitHub

GitHub PRs are synced via the GitHub REST API during repository sync. The sync fetches:

  • All merged PRs since the last sync point
  • Associated reviews and review comments
  • Commit SHAs for linking

Rate limiting is handled with exponential backoff. GitHub's API returns up to 100 PRs per page.

Bitbucket

Bitbucket PRs are synced via the Bitbucket REST API (v2). The same data is collected, with field mappings adjusted for Bitbucket's schema (e.g., participants instead of reviewers).

Ticket Reference Extraction

PR titles and descriptions are scanned for ticket references using provider-specific patterns:

ProviderPatternExample
Jira[A-Z]{2,}-\d+PROJ-1234
Linear[A-Z]{2,}-\d+ENG-456

Extracted references are stored as structured data, not parsed further. ShipLens does not call Jira or Linear APIs during extraction — it captures the reference for display and future integration.

TIP

Ticket extraction is intentionally lightweight. When full ticket integration is needed (status, story points, sprint data), use the dedicated Jira or Linear integrations rather than parsing PR text.

Built with intelligence, not surveillance.