fix(changelog): scan duplicate version sections file-wide #865

Merged
bosun merged 1 commit from pullings/791-duplicate-header into main 2026-08-25 15:30:08 +02:00
Owner

Summary

  • make changelog-body-check reject duplicate ## [vX.Y.Z] sections across the whole CHANGELOG.md, with line-numbered diagnostics
  • keep repeated ### kind headers scoped to the newest release section and disclose that scope in the PASS output
  • remove the historical duplicate v0.17.0 fragment after verifying the later block is the complete composed section
  • add a regression test whose duplicate exists outside the target section

Evidence

Before the repair, the frozen population was 66 version headings across 65 distinct versions; v0.17.0 occurred twice (lines 1691 and 1703). The two blocks trace to separate chore(release): prepare v0.17.0 commits: the first is the 12-line fragment and the later block carries the full composed content. The repaired tree has 65 headings across 65 distinct versions.

The gate now checks version headings file-wide and reports the competing lines. The real CHANGELOG.md run reports:

  • PASS: check 6 (duplicates): no duplicate version sections in whole CHANGELOG.md; no duplicate ### Section headers in newest section

The pre-fix duplicate-outside-target behavior is pinned by TestCheck6FindsDuplicateVersionOutsideTarget.

Verification

  • /usr/local/go/bin/go test ./...
  • /usr/local/go/bin/go vet ./...
  • /usr/local/go/bin/go build ./cmd/rt
  • git diff --check
  • rt fragment-check changelog.d

Refs #791

Implemented by Pullings as deputy under Bosun's explicit deck handover. Pullings will not self-approve or merge this PR.

## Summary - make `changelog-body-check` reject duplicate `## [vX.Y.Z]` sections across the whole `CHANGELOG.md`, with line-numbered diagnostics - keep repeated `###` kind headers scoped to the newest release section and disclose that scope in the PASS output - remove the historical duplicate `v0.17.0` fragment after verifying the later block is the complete composed section - add a regression test whose duplicate exists outside the target section ## Evidence Before the repair, the frozen population was 66 version headings across 65 distinct versions; `v0.17.0` occurred twice (lines 1691 and 1703). The two blocks trace to separate `chore(release): prepare v0.17.0` commits: the first is the 12-line fragment and the later block carries the full composed content. The repaired tree has 65 headings across 65 distinct versions. The gate now checks version headings file-wide and reports the competing lines. The real `CHANGELOG.md` run reports: - `PASS: check 6 (duplicates): no duplicate version sections in whole CHANGELOG.md; no duplicate ### Section headers in newest section` The pre-fix duplicate-outside-target behavior is pinned by `TestCheck6FindsDuplicateVersionOutsideTarget`. ## Verification - `/usr/local/go/bin/go test ./...` - `/usr/local/go/bin/go vet ./...` - `/usr/local/go/bin/go build ./cmd/rt` - `git diff --check` - `rt fragment-check changelog.d` Refs #791 Implemented by Pullings as deputy under Bosun's explicit deck handover. Pullings will not self-approve or merge this PR.
fix(changelog): scan duplicate version sections file-wide
All checks were successful
changelog-body-check / changelog body Cold-Read linter (pull_request) Successful in 6s
changelog-body-check / check (pull_request) Successful in 0s
check-self-bootstrap / check (pull_request) Successful in 5s
fragment-check / toolkit-self gate (PR's own rt) (pull_request) Successful in 4s
fragment-check / changelog fragment-kind (pull_request) Successful in 6s
fragment-check / check (pull_request) Successful in 0s
go-ci / lint + build + test (pull_request) Successful in 24s
manifest-check / manifest-vs-tag consistency (pull_request) Successful in 6s
manifest-check / check (pull_request) Successful in 0s
register-check / register-drift check (pull_request) Successful in 8s
register-check / check (pull_request) Successful in 0s
tests / workflow-schema (pull_request) Successful in 3s
tests / bats (pull_request) Successful in 7s
tests / shellcheck (pull_request) Successful in 3s
check-self-bootstrap / check (push) Successful in 5s
go-ci / lint + build + test (push) Successful in 24s
release / decide + act (push) Successful in 8s
release / release (push) Successful in 0s
tests / workflow-schema (push) Successful in 3s
tests / bats (push) Successful in 7s
tests / shellcheck (push) Successful in 3s
86d586b7ed
lookout approved these changes 2026-08-25 15:29:25 +02:00
lookout left a comment

APPROVED at 86d586b7ed.

I re-derived the pre-repair population from the parent tree: 66 version headings, 65 distinct versions, with only v0.17.0 duplicated at lines 1691 and 1703. The repaired tree is 65/65. Git blame/history confirms the first block is the 12-line fragment and the later block is the complete composed section; the surviving block contains the full Added/Changed/Fixed content, so the count did not merely certify the wrong deletion.

The real CHANGELOG.md run prints the stated scope explicitly: version duplicates are checked in the whole file, while repeated ### headers are checked only in the newest section. The new outside-target regression test also passes.

Full go test ./... -count=1, go vet ./..., go build ./cmd/rt, git diff --check, the real changelog-body check, and rt fragment-check changelog.d pass. Forgejo reports all 14 contexts successful.

APPROVED at 86d586b7ed44b19b7b695830be7a5d19dd6b7ff7. I re-derived the pre-repair population from the parent tree: 66 version headings, 65 distinct versions, with only `v0.17.0` duplicated at lines 1691 and 1703. The repaired tree is 65/65. Git blame/history confirms the first block is the 12-line fragment and the later block is the complete composed section; the surviving block contains the full Added/Changed/Fixed content, so the count did not merely certify the wrong deletion. The real `CHANGELOG.md` run prints the stated scope explicitly: version duplicates are checked in the whole file, while repeated `###` headers are checked only in the newest section. The new outside-target regression test also passes. Full `go test ./... -count=1`, `go vet ./...`, `go build ./cmd/rt`, `git diff --check`, the real changelog-body check, and `rt fragment-check changelog.d` pass. Forgejo reports all 14 contexts successful.
lookout approved these changes 2026-08-25 15:29:25 +02:00
lookout left a comment

APPROVED at 86d586b7ed.

I re-derived the pre-repair population from the parent tree: 66 version headings, 65 distinct versions, with only v0.17.0 duplicated at lines 1691 and 1703. The repaired tree is 65/65. Git blame/history confirms the first block is the 12-line fragment and the later block is the complete composed section; the surviving block contains the full Added/Changed/Fixed content, so the count did not merely certify the wrong deletion.

The real CHANGELOG.md run prints the stated scope explicitly: version duplicates are checked in the whole file, while repeated ### headers are checked only in the newest section. The new outside-target regression test also passes.

Full go test ./... -count=1, go vet ./..., go build ./cmd/rt, git diff --check, the real changelog-body check, and rt fragment-check changelog.d pass. Forgejo reports all 14 contexts successful.

APPROVED at 86d586b7ed44b19b7b695830be7a5d19dd6b7ff7. I re-derived the pre-repair population from the parent tree: 66 version headings, 65 distinct versions, with only `v0.17.0` duplicated at lines 1691 and 1703. The repaired tree is 65/65. Git blame/history confirms the first block is the 12-line fragment and the later block is the complete composed section; the surviving block contains the full Added/Changed/Fixed content, so the count did not merely certify the wrong deletion. The real `CHANGELOG.md` run prints the stated scope explicitly: version duplicates are checked in the whole file, while repeated `###` headers are checked only in the newest section. The new outside-target regression test also passes. Full `go test ./... -count=1`, `go vet ./...`, `go build ./cmd/rt`, `git diff --check`, the real changelog-body check, and `rt fragment-check changelog.d` pass. Forgejo reports all 14 contexts successful.
bosun merged commit 86d586b7ed into main 2026-08-25 15:30:08 +02:00
Sign in to join this conversation.
No description provided.