Skip to content

feat(metric): Merge Strategy detection + mergeCommit ingestion (#75, #76)#77

Merged
trentas merged 2 commits into
mainfrom
feat/merge-strategy-detection
Jun 3, 2026
Merged

feat(metric): Merge Strategy detection + mergeCommit ingestion (#75, #76)#77
trentas merged 2 commits into
mainfrom
feat/merge-strategy-detection

Conversation

@trentas
Copy link
Copy Markdown
Contributor

@trentas trentas commented Jun 3, 2026

Implements #75 (ingestion enabler) and #76 (the metric that consumes it).

#75 — Ingest mergeCommitSha + commit subjects

  • PullRequest gains merge_commit_sha / merge_commit_parent_count; CommitRef gains subject (messageHeadline). Backward-compatible defaults.
  • github_reader: mergeCommit added to the gh --json field lists (cheap {oid} on every path); the light GraphQL enrichment pass now also fetches mergeCommit{oid parents{totalCount}} and per-commit messageHeadline (renamed _fetch_pr_enrichment_graphql). Parent count lands on the GraphQL path; gh-only paths get the sha and fall through to the heuristic.

#76 — Merge Strategy detection per repo + reliability flag

  • New iris/analysis/merge_strategy_detector.py. Per-PR classification, in confidence order:
    1. ground truth — merge_commit_parent_count == 2merge
    2. commit-ref presence in local main — all present → merge; none present → squash (#N) subject stamp / single commit → squash, else → rebase
    3. ambiguous → unknown (excluded from the dominant computation)
  • Aggregated to merge|squash|rebase|mixed|unknown with dominant_share and commit_metrics_reliable (False only for squash/mixed). < 5 classified → unknown (reason logged, never invented).
  • Strictly per-repository — a property of repo config, no author axis anywhere (Principle build(deps): Bump actions/checkout from 4 to 6 #2).

Full chain wired

schema → aggregator → report writer (Merge Strategy section) → narrative finding → i18n (en + pt-br) → TS types → platform UI (repo-detail reliability badge + compare column, desktop & mobile) → ingest route + migration 019 (indexed columns) → docs/METRICS.md (§28 + module map).

Validation

Deploy note

The compare-table column needs migration 019_merge_strategy.sql applied to Supabase before those columns populate. The repo-detail badge reads the JSONB payload and works regardless.

Closes #75
Closes #76

🤖 Generated with Claude Code

)

Ingest (#75): capture mergeCommitSha + commit subjects
- PullRequest gains merge_commit_sha / merge_commit_parent_count; CommitRef
  gains subject (messageHeadline). All backward-compatible.
- github_reader: mergeCommit added to gh field lists; the light GraphQL pass
  now also fetches mergeCommit{oid parents{totalCount}} + per-commit
  messageHeadline (renamed _fetch_pr_enrichment_graphql).

Metric (#76): Merge Strategy detection per repo + reliability flag
- New analysis/merge_strategy_detector.py: per-PR classify (2-parent ground
  truth -> commit_refs presence in main -> squash (#N) subject stamp),
  aggregated to merge|squash|rebase|mixed|unknown with dominant_share and
  commit_metrics_reliable (False only for squash/mixed). Strictly per-repo.
- Wired full chain: schema, aggregator (logs unknown reason), report writer
  Merge Strategy section, narrative finding, i18n (en + pt-br), TS types,
  platform UI (repo-detail reliability badge + compare column desktop/mobile),
  ingest route + migration 019 (indexed columns), docs/METRICS.md.

Tests: tests/test_merge_strategy_detector.py (10 cases) + 8 added to
tests/test_github_reader_state.py.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@vercel
Copy link
Copy Markdown

vercel Bot commented Jun 3, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
clickbus-iris Ready Ready Preview, Comment Jun 3, 2026 8:20pm

Request Review

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@trentas trentas merged commit 8598d01 into main Jun 3, 2026
5 checks passed
@trentas trentas deleted the feat/merge-strategy-detection branch June 3, 2026 20:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants