-
Notifications
You must be signed in to change notification settings - Fork 14
feat: Change to new version of plugin API #1
base: master
Are you sure you want to change the base?
Conversation
Support the new commit-analyzer API. With the new API, we call the plugin once for each commit, and keep track of the changes ourselfs. This also adds support for the 'rskip' release type, which skips the release. This revealed a major problem with the pre.js unit tests (test/specs/pre.js), child process was not actually being mocked, and was simply returning an empty array. With the old system, the mocked commit-analyzer was still called and could still trigger a release (this is actually a flaw with the whole system. With the new system, this is no longer true, so the unit tests fail. I did not fix this both because it's not related to this branch/pull request, and because it would mean a major revamp, which I would need to think about more. Fixes semantic-release#41 Refs semantic-release/commit-analyzer#1, semantic-release/commit-analyzer#2 BREAKING CHANGE: The commit-analyzer is now called multiple times, and with a single commit (passed in as `commit`, vs `commits` as an array). The plugin also no longer has to deal with keeping track of the release type between commits.
@@ -1,26 +1,12 @@ | |||
const { parseRawCommit } = require('conventional-changelog/lib/git') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While doing the rewrite I think it would make sense to switch over to https://github.com/stevemao/conventional-commits-parser
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, I started working on it, but may I ask why?
Also, that doesn't tell us if it broke anything, we have to parse it our selfs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, sorry, didn't know it doesn't contain the BREAKING CHANGE:
parsing 👀.
It makes sense because going forward this will allow us to support more commit message styles.
Given that it's not fully compatible, let's just skip it for this PR.
Looks good so far 👍 |
Change to the new version of the commit analyzer API. Now the parser is called multiple times with only a single commit each time, and semantic-release takes care of keeping track of the version. This drastically simplifies the code. BREAKING CHANGE: Instead of accepting an array of commits with the `commits` option, we now accept a single commit with the `commit` option. Use that instead, and call the plugin multiple times.
Fixed commit message. |
what happened with this? |
@Guria looks like it just needs a few lint corrections. |
Also, could the pull request comment be updated to reference #6 |
Change to the new version of the commit analyzer API. Now the parser is called
multiple times with only a single commit each time, and semantic-release takes
care of keeping track of the version. This drastically simplifies the code.
BREAKING CHANGE:
Instead of accepting an array of commits with the
commits
option, we nowaccept a single commit with the
commit
option. Use that instead, and callthe plugin multiple times.