semantic-release / semantic-release/commit-analyzer
Unexpected major release because commit description includes a line starting with "Breaking change"
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 448
- Forks
- 82
- Avg merge
- 17h 41m
- Merged PRs (30d)
- 4
Description
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.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with test/integration.test.js and the analyzeCommits call shown in the issue. Reproduce the supplied commit message and inspect how its description is classified. Done means the case is covered by a regression test, returns a minor release, and the existing integration tests still pass.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- release
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100