commit-analyzer icon indicating copy to clipboard operation
commit-analyzer copied to clipboard

Unexpected major release because commit description includes a line starting with "Breaking change"

Open brian-smith-tcril opened this issue 7 months ago • 1 comments

It's possible there isn't a reasonable way to avoid this, but I recently encountered an issue where a commit message triggered a unexpected major release for me.

diff --git a/test/integration.test.js b/test/integration.test.js
index 112bc3a..550f9ee 100644
--- a/test/integration.test.js
+++ b/test/integration.test.js
@@ -25,6 +25,24 @@ test('Parse with "conventional-changelog-angular" by default', async (t) => {
   t.true(t.context.log.calledWith("Analysis of %s commits complete: %s release", 2, "minor"));
 });
 
+test('Parse with "conventional-changelog-angular" by default 2', async (t) => {
+  const commits = [
+    {
+      hash: "456",
+      message: `feat: new feature
+
+      Breaking change for unsupported use case but not a breaking API change
+
+      This isn't being released as major because the breaking change
+      is to an unsupported/undocumented use, but we still want to notify
+      people that might be using it that way.`,
+    },
+  ];
+  const releaseType = await analyzeCommits({}, { cwd, commits, logger: t.context.logger });
+
+  t.is(releaseType, "minor");
+});
+
 test('Accept "preset" option', async (t) => {
   const commits = [
     { hash: "123", message: "Fix: First fix (fixes #123)" },

There may not be a reasonable way to prevent this without breaking intended use, but when combined with https://github.com/semantic-release/semantic-release/issues/3721 this led to quite the predicament.

brian-smith-tcril avatar May 15 '25 18:05 brian-smith-tcril

semantic-release uses https://www.npmjs.com/package/conventional-changelog-angular internally as the default preset. what you describe is likely not specific to semantic-release, but that preset. you might consider confirming if you can confirm the same behavior with it directly and opening an issue against that package, which is not maintained by this team

travi avatar May 16 '25 20:05 travi