Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ERROR Missing "Unreleased" section in CHANGELOG.md. #13

Closed
timothymarois opened this issue Jan 7, 2021 · 7 comments
Closed

ERROR Missing "Unreleased" section in CHANGELOG.md. #13

timothymarois opened this issue Jan 7, 2021 · 7 comments

Comments

@timothymarois
Copy link

There is no way around this error so far. When this plugin is added, and following instructions on the readme, this error prevents the releases.

ERROR Missing "Unreleased" section in CHANGELOG.md.

Adding the plugin: Removing the plugin and everything works again.

"plugins": {
        "@release-it/keep-a-changelog": {
            "filename": "CHANGELOG.md"
        }
    }
@eMarek
Copy link
Collaborator

eMarek commented Jan 7, 2021

Make sure that you have a CHANGELOG.md file with some content in it:

# Changelog

## [Unreleased]

### Added

- Keep-a-changelog plugin added.

I guess that your changelog file is empty at the moment. I would suggest you to also set strictLatest to false for now.

@timothymarois
Copy link
Author

timothymarois commented Jan 8, 2021

Got it. Thanks for the reply. I'll try that out. Yeah I tried an empty changelog and then one filled by the default settings, after adding this plugin it didnt work on any of them, I think that should be added to the docs on whats needed if it doesnt auto-populate the Unreleased, kind of odd everything else auto-populates but this one requires a manual process.

@timothymarois
Copy link
Author

timothymarois commented Jan 8, 2021

Just tried based on the changelog you sent, and it replaced unreleased too

# Changelog

## [1.0.11] - 2021-01-08

### Added

- Keep-a-changelog plugin added.

and now when I run it again, it fails with the same error message.

Re-opening because this package isn't self-explanatory

I also noticed that strictLatest : false made no difference.

Edit:

Tried replacing the template to use https://raw.githubusercontent.com/release-it/release-it/master/templates/keepachangelog.hbs, and there was no change. At the moment, this keep a changelog is unusable in any form.

@timothymarois timothymarois reopened this Jan 8, 2021
@timothymarois
Copy link
Author

Here is the .release-it.json

{
    "github": {
        "release": true,
        "releaseName": "v${version}"
    },
    "git": {
        "changelog": "npx auto-changelog --stdout --commit-limit false --unreleased --template https://raw.githubusercontent.com/release-it/release-it/master/templates/changelog-compact.hbs",
        "commitMessage": "v${version} release",
        "requireCleanWorkingDir": false,
        "addUntrackedFiles": false,
        "commit": true,
        "push": true,
        "tagAnnotation": "Release v${version}",
        "tagName": "v${version}"
    },
    "npm" : {
        "publish" : false
    },
    "hooks": {
        "after:bump": "npx auto-changelog -p"
    },
    "plugins": {
        "@release-it/keep-a-changelog": {
            "filename": "CHANGELOG.md",
            "strictLatest" : false
        }
    }
}

and again, the template change had absolutely no effect.

@eMarek
Copy link
Collaborator

eMarek commented Jan 9, 2021

Developers maintain their change log file differently. Some of them generate it from git history. This is how Auto-changelog works as far as I understand. I can't really confirm because I haven't tried it.

But some developers maintain their change logs manually by entering changes under "unreleased" section in CHANGELOG.md alongside with pull/merge requests. When releasing time comes, change log file is already prepared. You just need to change this line ## [Unreleased] into ## [2.1.5] - 2021-01-8 and you are good to go. This plugin makes this step for you automatically.

If this line ## [Unreleased] is missing in the CHANGELOG.md file, then you will get ERROR Missing "Unreleased" section in CHANGELOG.md..

@eMarek eMarek closed this as completed Jan 9, 2021
@eMarek eMarek reopened this Jan 9, 2021
@eMarek
Copy link
Collaborator

eMarek commented Jan 9, 2021

Sorry, I closed the ticket by mistake. :)

Anyway, I am trying to say that you are combining both approaches. I highly doubt that these two are compatible looking from release-it package perspective.

Take a moment and also read the origins of this plugin here: release-it/release-it#662

@timothymarois
Copy link
Author

I see. so if I understand. the keep a changelog is so that I can manually add my own changes such as added, changed, fixed etc, and this just replaces [Unreleased] to the version # when I release it? If so, that makes sense. I was just unaware, I thought this was a combined approach, but it makes sense now.

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

No branches or pull requests

2 participants