fix(changelog): make CHANGELOG_OLD.md rotation more resilient#202
Merged
Conversation
Copilot
AI
changed the title
[WIP] Fix footer link rotation issue in iobroker plugin
fix(changelog): preserve "Older entries" footer in README during CHANGELOG_OLD.md rotation
Apr 30, 2026
CHANGELOG_OLD.md rotation more resilient
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.
When rotating old changelog entries from
README.mdintoCHANGELOG_OLD.md, theOlder entries are in [CHANGELOG_OLD.md](CHANGELOG_OLD.md).footer line was being included in the last rotated entry and moved intoCHANGELOG_OLD.md, leaving the README without a footer.Root cause
parseChangelogFileextends each###version entry to the next##/###header. When the footer appears after the last version entry (no subsequent header follows), it's absorbed into that entry's content. On rotation, the entry—footer included—moves toCHANGELOG_OLD.md.Fix
packages/plugin-changelog/src/index.ts— InexecuteCheckStage, after parsing README entries and only whenCHANGELOG_OLD.mdis present, detect the footer pattern at the end of the last parsed entry. If found, strip it from the entry and prepend it toparsed.after, so it flows intochangelog_after(written back to README only, never toCHANGELOG_OLD.md).packages/plugin-changelog/src/index.test.ts— Two new tests: one verifying the footer is moved tochangelog_afterduring the check stage, one verifying post-rotation file contents (footer in README, absent fromCHANGELOG_OLD.md).