Closed TimKnight-DWP closed 8 months ago
Awesome, thanks for the report, and the (upcoming) fix! Much appreciated!
@TimothyJones something has broken the tests, in that they currently operate on the real package.json and CHANGELOG.md, so those get wiped clear at some point in the test run and everything else fails, going to try figure out what/where that has happened. And progress from there 😬
If I run npm run test:unit
using node 18.16.0, everything works as expected
If I run npm run test:unit
using node 20.9.0, it all goes sideways
Will raise a separate issue for that
I cannot reproduce this bug natively using commit-and-tag-version - CLOSING may reopen if I find new data
For reference, this is likely coming about due to custom rules and post-event hooks within .versionrc.js
on a specific repo, if it needs a specific fix here I'll come back, but suspect it's a local thing
Had FrontMatter defined in the "header"
header:
"---\nstatus: new\n---\n\n# Changelog\n\nAll notable changes to this product will be documented in this file.\n\n<!-- markdownlint-disable titlecase-rule -->",
within .versionrc.js
Which means it would have cut the FrontMatter out of the Changelog as per my code change and appended that and then the Header (containing Frontmatter as defined in versionrc), hence the duplication.
Probably a workaround prior to solving the bug fix.
No change required to commit-and-tag-version
This is how the tool should work, it should respect both any Frontmatter applied and any header
content in versionrc.js
- shouldn't try and code for edge-cases as which to prioritise the actual front matter as extracted or whats defined in the header
as they may differ
Describe the bug Depending on the format of the frontmatter on the CHANGELOG, commit-and-tag-version does not handle it correctly
Current behavior Frontmatter is repeatedly duplicated at the top of the CHANGELOG
Expected behavior Frontmatter is retained and not duplicated
Environment
commit-and-tag-version
version(s): latestPossible Solution
It'll be within the logic I added to: https://github.com/absolute-version/commit-and-tag-version/blob/master/lib/lifecycles/changelog.js#L25
Additional context Raising this bug so everyone can have insight on it, I will synch my fork and work on a fix asap