Skip to content

test: stop changelog --since test colliding with entry prose - #574

Merged
kome12 merged 1 commit into
mainfrom
fix/changelog-since-test-sentinel-collision
Sep 4, 2026
Merged

test: stop changelog --since test colliding with entry prose#574
kome12 merged 1 commit into
mainfrom
fix/changelog-since-test-sentinel-collision

Conversation

@kome12

@kome12 kome12 commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

Problem

The Version Packages release PR (#554) is failing CI on the changelog command --since regression test, even though the source change that added it (#572) passed. The failure is a self-collision, not a code regression:

AssertionError: expected '## 1.43.2\n\n### Patch Changes\n\n- […' not to contain 'No changelog entries found'

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.md on its branch didn't yet contain that entry — the changesets bot only rolls it into the 1.43.2 section when it generates the Version Packages PR. Once it did, --since 1.43 legitimately returns the 1.43.2 section, whose prose contains the sentinel, and the test trips. This also breaks main the 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. The toBe(explicitZeroForm) equivalence check (the real regression guard) is unchanged.

Verification

  • Reproduced the exact CI failure locally by swapping in the release-branch CHANGELOG.md; confirmed the old assertion fails and the new one passes against it.
  • Full suite: 2596 passed / 2 skipped. Lint clean.

Test-only change → no changeset.

🤖 Generated with Claude Code

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>
@kome12 kome12 self-assigned this Sep 4, 2026
@nansen-pr-reviewer

Copy link
Copy Markdown

pr-reviewer Summary for #65bc5b8

No issues found

The code review completed successfully with no findings.

Review effort: 1/5 (Trivial)

Summary

This PR fixes a self-collision in the changelog --since regression test: the old not.toContain('No changelog entries found') assertion tripped when a legitimate changelog entry's prose quoted that exact sentinel string.

The replacement — expect(partialForm).toContain(## ${majorMinor}.) — is a sound structural check. A version heading only appears in the output when entries were actually matched; the no-match sentinel is a single line with no heading. The core equivalence guard (toBe(explicitZeroForm)) is untouched. The CHANGELOG regex correctly handles both ## 1.43.1 and ## [1.43.1] heading formats. No changeset is needed or expected for a test-only fix.

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 @nansen-pr-reviewer re-review.

@nansen-pr-reviewer nansen-pr-reviewer Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Auto-approved

This PR was automatically approved because:

  • It contains only test changes

If you have any concerns, please request a manual review.

@kome12
kome12 merged commit a4a6a84 into main Sep 4, 2026
9 checks passed
@kome12
kome12 deleted the fix/changelog-since-test-sentinel-collision branch September 4, 2026 05:58
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.

1 participant