Skip to content

feat: dedupe monorepo gems sharing identical changelog (#12)#15

Merged
justi merged 1 commit into
mainfrom
feat/issue-12-monorepo-dedup
May 9, 2026
Merged

feat: dedupe monorepo gems sharing identical changelog (#12)#15
justi merged 1 commit into
mainfrom
feat/issue-12-monorepo-dedup

Conversation

@justi
Copy link
Copy Markdown
Owner

@justi justi commented May 9, 2026

Summary

  • Add _dedup_monorepo_deltas — pre-reflow awk pass that groups gems with byte-identical post-cutoff content under one comma-joined H3
  • Reflow regex now accepts name1, name2: ... style headers
  • Dedup is byte-level conservative: different bullets or version transitions stay split
  • update_count computed before dedup, so the reported gem count is unaffected

Closes #12.

Test plan

  • tests/test_save.sh extended: 9 new cases covering grouping, divergence (different bullets), and count integrity
  • Full bash suite green: 12 test files, 169 cases, 0 regressions

Before / after

For a project with sentry-rails and sentry-ruby (both 5.23.0 → 6.5.0, identical bullets from monorepo):

-### sentry-rails
-
-**5.23.0 (last seen) → 6.5.0 (current, 2026-03-16)**
-
-- 6.5.0: Add OTLP collector_url; ...
-
-### sentry-ruby
-
-**5.23.0 (last seen) → 6.5.0 (current, 2026-03-16)**
-
-- 6.5.0: Add OTLP collector_url; ...
+### sentry-rails, sentry-ruby
+
+**5.23.0 (last seen) → 6.5.0 (current, 2026-03-16)**
+
+- 6.5.0: Add OTLP collector_url; ...

A typical Rails app saves ~3K tokens on the sentry-* family alone.

Notes

  • Conservative criteria: only merges when (version transition string AND all bullets) match exactly. Won't false-positive on, e.g., rails meta-gem expansion since sub-gems differ on either dimension.
  • No version bump in this PR.

🤖 Generated with Claude Code

Two gems published from a unified-CHANGELOG monorepo (sentry-rails +
sentry-ruby from getsentry/sentry-ruby is the canonical case) emitted
byte-identical bullet content under separate `### gem` headers, wasting
LLM context tokens.

Add `_dedup_monorepo_deltas` — a pure awk pass that runs before the
markdown reflow. When two delta blocks have identical (header_rest,
bullets), it merges them under one comma-joined header. The reflow
regex now accepts `name1, name2: ...` style headers.

Dedup is byte-level conservative — different bullets or different
version transitions stay separate. Update count is computed pre-dedup
so the reported gem count is unchanged.

Closes #12

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@justi justi merged commit 7d97fc1 into main May 9, 2026
2 checks passed
@justi justi deleted the feat/issue-12-monorepo-dedup branch May 9, 2026 10:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[enhancement] Deduplicate monorepo gems sharing identical CHANGELOG

1 participant