Repository navigation
fix(version): include test commits in changelogs instead of dropping them - #570
Merged
Merged
Conversation
…them test was the only conventional-commit type mapped to null in mapCommitTypeToChangelogType — every other non-feat/fix type (docs, style, refactor, perf, build, ci, chore) already surfaces as "Changed". Dropping test alone violated ReleaseKit's demote-don't-hide invariant, undercounted the standing-PR preview's de-duplicated change count, and in sync/group releases replaced a package's real (test-only) changes with a synthetic "Update version to X" placeholder. Map test to "Changed" like the other code-adjacent types. This is display-only: releasability is decided by the semver bump-rank calc, which is independent of changelog entries, so no test-only change becomes releasable. Closes #569 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011i1KvoyxATU3bz5V5Sf1Xu
Contributor
|
Standing release PR: #555 · v0.41.0 queued (4 packages) · open 4h 56m · ✅ ready to merge Release Preview — v0.40.0 → v0.40.1
These changes will be added to the release PR (#555) when merged: Changelogmonorepo 0.40.0 → 0.40.1
After merge — predicted release
Updated automatically by ReleaseKit |
With test mapped to 'changed', every branch of mapCommitTypeToChangelogType (including default) returns a concrete type, so its `| null` return and the `if (!changelogType) return null` guard at the sole call site are dead. Remove both. parseCommitMessage still returns null for non-conventional bookkeeping commits — that `| null` is unaffected. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011i1KvoyxATU3bz5V5Sf1Xu
Merged
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #569.
Problem
test:was the only conventional-commit type silently deleted from generated changelogs —mapCommitTypeToChangelogType(packages/version/src/changelog/commitParser.ts) returnednullfor it, whiledocs,style,refactor,perf,build,ci, andchoreall already surface as "Changed". That single exclusion:demoteScopesis documented as "Nothing is hidden or dropped" (noise is demoted, not removed).test:PR, never appeared in the v0.41.0 preview.)test:commits came back withentries: []and got a synthetic"Update version to ${version}"line (groupStrategy.ts:358) instead of its real changes.Fix
Map
testto"Changed", alongside the other code-adjacent types. One-line behavioral change plus the spec that pinned the old behavior.Why "Changed" and not a dedicated "Tests" section: Keep a Changelog categories describe the nature of a change (Added/Changed/Fixed/…), not the commit type;
docs/ci/chore/etc. already fold into "Changed"; andtestis low-signal, so it shouldn't be elevated to its own section (the future refinement, if wanted, is demotion likedeps, not promotion).Safety
Display-only. Releasability is decided by the semver bump-rank calc (feat→minor, fix→patch, breaking→major; test/docs/chore→no bump), which is independent of changelog-entry presence — so no test-only change becomes releasable. Verified
pnpm turbo run lint typecheck test(32/32 tasks green).🤖 Generated with Claude Code
Greptile Summary
This PR fixes a single omission in
mapCommitTypeToChangelogType:testcommits previously returnednulland were silently dropped from changelogs, while every other conventional-commit type was already surfaced. The fix mapstestto'changed', removes the now-dead null-check guard, narrows the return type from… | nulltoChangelogEntry['type'], and updates the spec to assert 11 entries instead of 10.packages/version/src/changelog/commitParser.ts: removes thenullshort-circuit path and its guard, mapscase 'test'to'changed', and tightens the return type signature.packages/version/test/unit/changelog/commitParser.spec.ts: updates the fixture assertion count and adds an explicit expectation that atest:commit surfaces astype: 'changed'.Confidence Score: 5/5
Display-only change with no effect on semver bump logic; safe to merge.
The change touches only the changelog rendering path — mapCommitTypeToChangelogType — and explicitly leaves the bump-rank calculation (which governs releasability) untouched. The old null return and its guard are removed consistently: no call site relied on the null path for correctness, and the return-type narrowing matches the new reality. The spec update directly pins the new behaviour. No edge cases are left unaddressed.
No files require special attention.
Important Files Changed
testto 'changed' instead of null, removes the dead null-guard, and narrows the return type — all consistent and correct.test:is categorised as 'changed'; covers the behavioural change adequately.Flowchart
%%{init: {'theme': 'neutral'}}%% flowchart TD A["commit message"] --> B["parseCommitMessage()"] B --> C{"conventional\ncommit?"} C -- No --> D{"meaningful\nnon-conventional?"} D -- Yes --> E["type: 'changed'"] D -- No --> F["return null\n(filtered out)"] C -- Yes --> G["mapCommitTypeToChangelogType(type)"] G --> H{"type?"} H -- "feat" --> I["'added'"] H -- "fix" --> J["'fixed'"] H -- "revert" --> K["'removed'"] H -- "docs, style, refactor,\nperf, build, ci, chore,\ntest, (default)" --> L["'changed'"] I & J & K & L --> M["ChangelogEntry"] style L fill:#d4edda,stroke:#28a745%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%% flowchart TD A["commit message"] --> B["parseCommitMessage()"] B --> C{"conventional\ncommit?"} C -- No --> D{"meaningful\nnon-conventional?"} D -- Yes --> E["type: 'changed'"] D -- No --> F["return null\n(filtered out)"] C -- Yes --> G["mapCommitTypeToChangelogType(type)"] G --> H{"type?"} H -- "feat" --> I["'added'"] H -- "fix" --> J["'fixed'"] H -- "revert" --> K["'removed'"] H -- "docs, style, refactor,\nperf, build, ci, chore,\ntest, (default)" --> L["'changed'"] I & J & K & L --> M["ChangelogEntry"] style L fill:#d4edda,stroke:#28a745Comments Outside Diff (1)
packages/version/src/changelog/commitParser.ts, line 344 (link)testreturns'changed', every branch in the switch returns a non-null value — the| nullin the return type is unreachable. Removing it makes the type accurately reflect the function's actual behaviour and avoids null-checks at call sites.Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
Reviews (2): Last reviewed commit: "refactor(version): drop now-unreachable ..." | Re-trigger Greptile