dhoulb / multi-semantic-release

Proof of concept that wraps semantic-release to work with monorepos.
BSD Zero Clause License
203 stars 36 forks source link

generateNotes error after merging pull request #64

Closed reuzel closed 3 years ago

reuzel commented 3 years ago

Hi,

I've just attempted to use the semantic-release workflow capabilities, but that somehow doesn't seem to work, at least not in the Gitlab.com environment...

What I did:

[10:09:17 AM] [@reuzel/coinbot-server] › ✖  Failed step "generateNotes" of plugin "Inline plugin"
[10:09:17 AM] [@reuzel/coinbot-server] › ✖  An error occurred while running semantic-release: TypeError: Cannot read property 'filter' of undefined
    at generateNotes (/builds/reuzel/coinbot/node_modules/.pnpm/@semantic-release+release-notes-generator@9.0.2_semantic-release@17.4.3/node_modules/@semantic-release/release-notes-generator/index.js:46:8)
    at processTicksAndRejections (node:internal/process/task_queues:94:5)
    at async validator (/builds/reuzel/coinbot/node_modules/.pnpm/semantic-release@17.4.3/node_modules/semantic-release/lib/plugins/normalize.js:34:24)
    at async /builds/reuzel/coinbot/node_modules/.pnpm/semantic-release@17.4.3/node_modules/semantic-release/lib/plugins/pipeline.js:37:34
    at async Promise.all (index 0)
    at async next (/builds/reuzel/coinbot/node_modules/.pnpm/p-reduce@2.1.0/node_modules/p-reduce/index.js:16:18) {
  pluginName: 'Inline plugin'
}

Using multi-semantic-release version 2.8.0.

Not sure where I took the wrong turn...

Regards, Joost

reuzel commented 3 years ago

Trying to figure out what happens: the inline plugin generateNotes relies on filtered commits set in the inline plugins analyzeCommits. However, for some packages the analyzeCommits is not called? For these packages, the commits variable is never set, resulting in a undefined value for commits, leading to the error above. Is there some logic somewhere that determines if analyzeCommits is not necessary?

reuzel commented 3 years ago

Diving deeper: https://github.com/semantic-release/semantic-release/blob/master/index.js line 109-110: generateNotes is run and no analysis of commits is done because this is a merge situation and no new version of the package is required... My guess is the fix is to have generateNotes do its own commit filtering...

antongolub commented 3 years ago

:tada: This issue has been resolved in version 2.8.1 :tada:

The release is available on:

Your semantic-release bot :package::rocket: