DEPRECATED: build: automated changelog
Automated CHANGELOG entries
This MR introduces restrictions on the commit messages in master
. All messages need to comply with the Conventional commits format. This is enforced by custom Danger job copied from gitlab-org/gitlab-ui
At the time of release, we are automatically generating changelog with the conventional-changelog-cli
.
Example of CHANGELOG entries that we'll be generating from now on.
Shortcomings of the current solution
Not fully automated
There is a potential of configuring the semantic-release
toolchain to completely automate the release process. The semantic-release
goes uses the conventional commits and so we are being ready for using it later on.
The main problem is that the semantic-release
doesn't currently support releasing VS Code extensions easily. There is an unofficial plugin raix/semantic-release-vsce but it doesn't seem too well maintained and only supports Microsoft marketplace (no open-vsx).
We might be able to use the exec plugin and write our custom scripts in the future.
The Danger job is not running on forks
Since the Danger job needs GitLab access token (we use gitlab-bot), contributors who are not GitLab team members are not going to be warned that their commit message is not correctly structured. I see this as the main problem. Majority of the contributions are from the wider community.
Pseudo code that we would have to implement as linting
// returns true if the commit history or MR are having valid conventional commit messages
function isHistoryValidConventional() {
const mr = { squash: true, title: 'build: changelog' };
// This way it would work on `master` without an MR
const commits = mr ? commitsFromMergeBase : commitsSinceLastTag.filter(notMerge);
if (!mr.squash) {
return commits.every(isConventional);
}
// by default, GitLab uses first multiline commit message for squash commit message
const firstMultiline = commits.find(isMultiline);
if(firstMultiline){
return isConventional(firstMultiline);
}
return isConventional(mr.title);
}
Changelog entries do not contain issue or MR reference
You can comper the current changelog with the gitlab-ui changelog. In the automatically generated changelog, you have to click on the commit and let GitLab tell you what MR contains the commit.
Closes #198 (closed)