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

issues with changelog modifcation behavior #76

Closed
abmusse opened this issue Oct 11, 2023 · 8 comments
Closed

issues with changelog modifcation behavior #76

abmusse opened this issue Oct 11, 2023 · 8 comments

Comments

@abmusse
Copy link

abmusse commented Oct 11, 2023

I'm currently using release-it with conventional commits with following config:

https://github.com/IBM/nodejs-itoolkit/blob/cea61549fc197f9267af00befa06fa76df67c18c/.release-it.json#L1

I'm cutting a new release and noticed the change log is barren and missing a bunch of commits with:

  • build:
  • ci:

See commits that should be included here:

IBM/nodejs-itoolkit@v1.0.1...master

I'm running the following release-it command:

https://github.com/IBM/nodejs-itoolkit/blob/cea61549fc197f9267af00befa06fa76df67c18c/package.json#L16

So far my CHANGELOG.md has been modified with:

diff --git a/CHANGELOG.md b/CHANGELOG.md
index 2587999..a75884d 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,3 +1,7 @@
+
+
+## [1.0.2](https://github.com/IBM/nodejs-itoolkit/compare/v1.0.1...v1.0.2) (2023-10-10)
+
 # Changelog
 
 ## [1.0.1](https://github.com/IBM/nodejs-itoolkit/compare/v1.0.0...v1.0.1) (2022-10-31)
@@ -225,4 +229,4 @@
 
 ### [0.1.5](https://github.com/IBM/nodejs-itoolkit/compare/0.1.4...0.1.5) (2019-01-08)
 
-### 0.1.4 (2018-09-17)
+### 0.1.4 (2018-09-17)
\ No newline at end of file

There a few issues with the change log

  1. It adds the new release 1.0.2 at the top of the file before the # Changelog header.
  2. The commits are not added under the 1.0.2 header
  3. It also removes the newline at the end of the file.

I would expect the above to not be issues.
Any tips on getting these resolved?

@webpro
Copy link
Contributor

webpro commented Oct 11, 2023

Are you using the latest version of everything? At least do "preset": "conventionalcommits""preset": { "name": "conventionalcommits"}`

@abmusse
Copy link
Author

abmusse commented Oct 11, 2023

Are you using the latest version of everything?

$ npm ls
itoolkit@1.0.1 /home/amusse/repos/nodejs-itoolkit
├── @release-it/conventional-changelog@7.0.2
...
├── release-it@16.1.3

Looks like I'm up to date on @release-it/conventional-changelog@7.0.2. There is a new version of release-it I can install though 16.2.1.

@abmusse
Copy link
Author

abmusse commented Oct 11, 2023

@webpro

After updating the .release-it.json with

       "preset": {
          "name": "conventionalcommits"
        },

The changelog is now:

diff --git a/CHANGELOG.md b/CHANGELOG.md
index 2587999..a09b39f 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,3 +1,7 @@
+
+
+## [1.0.2](https://github.com/IBM/nodejs-itoolkit/compare/
v1.0.1...v1.0.2) (2023-10-11)
+
 # Changelog
 
 ## [1.0.1](https://github.com/IBM/nodejs-itoolkit/compare/
v1.0.0...v1.0.1) (2022-10-31)
@@ -225,4 +229,4 @@
 
 ### [0.1.5](https://github.com/IBM/nodejs-itoolkit/compare
/0.1.4...0.1.5) (2019-01-08)
 
-### 0.1.4 (2018-09-17)
+### 0.1.4 (2018-09-17)
\ No newline at end of file

It appears that it still has the same issues as the original error. I will try updating release-it to the latest version to see if that helps.

UPDATE

updating release-it to the latest version doesn't resolve the issue

@abmusse
Copy link
Author

abmusse commented Oct 11, 2023

I was able to resolve

  1. It adds the new release 1.0.2 at the top of the file before the # Changelog header.

By adding:

"header": "# Changelog"

to .release-it.json. The default for header is just Changelog

Next

  1. The commits are not added under the 1.0.2 header

I also noticed that for the angular preset

  • ci
  • build

Are not considered changes to be included in the changelog.

https://github.com/conventional-changelog/conventional-changelog/tree/master/packages/conventional-changelog-angular#type

Other prefixes are up to your discretion. Suggested prefixes are build, ci, docs ,style, refactor, and test for non-changelog related tasks.

Therefore would need to be manually added as a type if we want to add it to the changelog:

"preset": {
  "name": "angular",
  "types": [
    {
      "type": "build",
      "section": "Build System"
    },
    {
      "type": "ci",
      "section": "Build System"
    }
  ]
},

So looks like the only issue remaining here is:

  1. It also removes the newline at the end of the file.

@abmusse
Copy link
Author

abmusse commented Oct 12, 2023

@webpro

Any ideas why the newline is removed at the end of the file after the changelog is modified?

@fwextensions
Copy link

FWIW, I had a similar problem with the changelog title getting repeated, even though I had the header value set. I was using "header": "# Changelog\n\n", to try to control the spacing after the title. That didn't seem to have any effect on the spacing and duplicated the header. Removing the \n\n got it working.

I also wish it didn't strip the last newline in the file.

@webpro webpro closed this as completed in 545b753 Nov 12, 2023
@webpro
Copy link
Contributor

webpro commented Nov 12, 2023

Sorry for the delay @abmusse, somehow I missed it. Added the EOL in v8.0.1 :)

@abmusse
Copy link
Author

abmusse commented Nov 14, 2023

Awesome! Thanks for getting that resolved!

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

3 participants