Repository navigation
feat: commit shipment visibility -- report shipped vs. unconfirmed commits (#107) - #123
Conversation
…it.js Cycle 1 of commit shipment visibility: two new functions resolve the default branch name (symbolic-ref then main/master probe then null) and fetch a Set of SHAs reachable from that branch up to 5xMAX_COMMITS (250) for per-commit shipped/unconfirmed classification in Cycle 2. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ocal script Cycle 2 of commit shipment visibility: calls findDefaultBranch and fetchDefaultBranchShas (5xMAX_COMMITS = 250), then filters metrics by full_sha membership. Adds default_branch, shipped_commits_count, and unconfirmed_commits_count to local_metrics_summary.json. Squash-merged commits appear unconfirmed (SHA ancestry cannot distinguish them from abandoned branches); the comment names this explicitly. Also updates all 5 mockExecSequence helpers in collectLocalMetrics.test.js with out-of-band handlers for symbolic-ref (throw) and rev-parse --verify (throw) so findDefaultBranch returns null in tests predating this cycle. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Cycle 3: adds renderShipmentLine to lib/report-template.js and wires it into renderMastheadDetail. Shows shipped vs. unconfirmed counts against the default branch; notes squash-merged commits appear unconfirmed. Returns empty string when shipped_commits_count is absent for backward compatibility. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Cycle 4: for each analyzed feature branch calls github.rest.pulls.list (state: closed, per_page: 1) and checks merged_at. Adds merged_branches_count and unmerged_branches_count to both the normal and empty-metrics summary paths. Also adds pulls.list stub to makeGithubMock in all four existing workflow test files so they do not break when the new API call runs. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
PR AnalysisSize: small (based on production code) Commit AnalysisTotal Commits: 4
Commit Details99d6b8e Ken Judy (8/31/2026) a159ccb Ken Judy (8/31/2026) 02b4cc6 Ken Judy (8/31/2026) 5046ef7 Ken Judy (8/31/2026) Test CoverageTest-to-Production Ratio: 4.51:1 (no calibrated target for this ratio; reported descriptively) DORA Capability AssessmentArchetype: mixed-signals
Duplicate CodeFound 1 duplicate block(s) across the changed files:
|
Summary
findDefaultBranchandfetchDefaultBranchShastolib/git.js(5×MAX_COMMITS = 250 depth)default_branch,shipped_commits_count,unconfirmed_commits_counttolocal_metrics_summary.jsonrenderShipmentLine,lib/report-template.js)merged_branches_countandunmerged_branches_counttocode-metrics.ymlviagithub.rest.pulls.listper branchSquash-merged commits appear unconfirmed (SHA ancestry cannot distinguish them from abandoned branches); the report names this explicitly.
pr-metrics.ymlis excluded per issue scope: shipment status is irrelevant for a PR not yet merged.Replaces #122 (rebased onto main after #121 merged).
Test plan
npm testpasses (806 tests across 49 suites)__tests__/defaultBranch.test.js— 10 tests forfindDefaultBranchandfetchDefaultBranchShas__tests__/collectLocalMetrics.test.js— 3 new tests for shipment counts in summary__tests__/report-template.test.js— 3 new tests forrenderShipmentLine__tests__/codeMetricsWorkflowShipmentVisibility.test.js— 3 new tests for workflow merged/unmerged counts🤖 Generated with Claude Code