test: stop changelog --since test colliding with entry prose - #574
Conversation
The `changelog --since` regression test asserted the filtered output does not contain the literal string "No changelog entries found" as proof that a major.minor-only --since matched real entries. But a changelog entry's own prose can legitimately quote that string — the entry documenting the --since fix itself does — so once that entry lands in a released section the filtered output contains the phrase and the test fails, even though the command worked correctly. Assert on structure instead: the newest version's "## x.y." heading is present in the output. The heading only appears when entries were actually included, and the single-line no-match message has no heading, so this proves the same thing without colliding with entry prose. The `toBe(explicitZeroForm)` equivalence check (the real regression guard) is unchanged. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
pr-reviewer Summary for #65bc5b8✅ No issues found The code review completed successfully with no findings. Review effort: 1/5 (Trivial) SummaryThis PR fixes a self-collision in the The replacement — No findings — this is a clean, well-reasoned fix. Token usage: 16 input, 2,210 output, 194,334 cache read, 17,580 cache write | Usage Guide New pushes are reviewed automatically with a 10-minute cooldown between reviews. To request a review at any time, comment |
Problem
The Version Packages release PR (#554) is failing CI on the
changelog command --sinceregression test, even though the source change that added it (#572) passed. The failure is a self-collision, not a code regression:The test asserts that
nansen changelog --since <major.minor>output does not contain the literal string"No changelog entries found"— using the command's no-match sentinel as proof that entries were matched. But #572's own changelog entry documents the fix with the prose …silently returning "No changelog entries found" for a version missing its patch number….#572 passed because
CHANGELOG.mdon its branch didn't yet contain that entry — the changesets bot only rolls it into the1.43.2section when it generates the Version Packages PR. Once it did,--since 1.43legitimately returns the1.43.2section, whose prose contains the sentinel, and the test trips. This also breaksmainthe moment #554 merges.Fix
Assert on structure instead: the newest version's
## x.y.heading must be present in the filtered output. The heading appears only when entries were actually included, and the single-line no-match message has no heading — so it proves the same thing without colliding with entry prose. ThetoBe(explicitZeroForm)equivalence check (the real regression guard) is unchanged.Verification
CHANGELOG.md; confirmed the old assertion fails and the new one passes against it.Test-only change → no changeset.
🤖 Generated with Claude Code