Announcing Cocogitto 5.3.0
2023-01-20For those who don't know, Cocogitto is a Conventional Commit and SemVer swiss army knife. You can create Conventional Commits with the CLI, automatically release new version, enforce the specifications with the GitHub bot and action etc.
Changelog
Changelog for the upcomming 5.3.0 version (generated by Cocogitto)
Bug Fixes
- ignore merge commits based on parent counts - (f8b5da6) - @oknozor
- signing for chore commits - (18b9643) - @DaRacci
Documentation
- add cargo-smart-release to the list of similar projects - (3a04e72) - @oknozor
- report one binary following
coco
deprecation - (3ad6d28) - @lucatrv
Features
- (cli) add subcommand for generating manpages - (fe6bcfe) - @tranzystorek-io
- monorepo support (#240) - (d8eed3d) - @oknozor
- NuShell completions - (3a356cc) - @DaRacci
- add from_latest_tag to settings - (a154782) - @stephenc
Miscellaneous Chores
- bump dependencies and fix rustc-serialize cve - (fc0e129) - @oknozor
- bump clap version to 4.0 - (dbef47b) - @tranzystorek-io
Refactoring
- simplify project structure for binaries - (941fb10) - @tranzystorek-io
Tests
Thanks
❤️ Kudos to @stephenc, @DaRacci, @lucatrv, @tranzystorek-io who contributed to the upcomming Cocogitto release !
Mono-repository support
It's been a while since I last worked on it. And it was mainly in maintenance mode. But lately I have been working on Gill, an activity pub based git platform. It's not ready for production yet, but it is already a big project with a dozen crates in the cargo workspace.
Unfortunately I was not able to use Cocogitto for this project because of its mono-repository nature. The least I could do for a project so closely related to git is to correctly manage versioning, so finally decided to tackle mono-repo support in Cocogitto.
Global version
Without further ado here is a sample of the first repository changelog generated by Cocogitto:
As you can see the automatic bump performed by Cocogitto generated a global changelog and created a tag for each updated crate on the workspace. There were no previous tag on the repository so a new version was created for each crate. Subsequent bumps will generate a new version only for crates modified since the previous release.
The mono-repository bump also generate a global project tag. It's calculated based on the generated package tags or on the global commits.
Per package version
The bump also generated a new changelog for each updated crate:
How to
Mono-repo support is just a matter of configuration.
If you have used Cocogitto before, all you need to do is to update your cog.toml
to declare your monorepo packages.
Here is a sample of Gill's configuration
pre_bump_hooks = [
"SQLX_OFFLINE=true cargo test",
"SQLX_OFFLINE=true cargo clippy",
"cargo fmt --all",
"SQLX_OFFLINE=true cargo build --release",
]
post_bump_hooks = [
"git push",
"git push origin --tags",
]
pre_package_bump_hooks = [
"cargo set-version {{version}}"
]
[packages]
gill-app = { path = "crates/gill-app" }
gill-authorize-derive = { path = "crates/gill-authorize-derive", public_api = false }
gill-db = { path = "crates/gill-db", public_api = false }
gill-git = { path = "crates/gill-git", public_api = false }
gill-git-server = { path = "crates/gill-git-server" }
gill-markdown = { path = "crates/gill-markdown", public_api = false }
gill-settings = { path = "crates/gill-settings" }
gill-syntax = { path = "crates/gill-syntax" }
gill-web-markdown = { path = "crates/gill-web-markdown" }
syntect-plugin = { path = "crates/syntect-plugin", public_api = false }
Differences with standard bump
- Run per package hooks with are define using
pre_package_bump_hooks
,post_package_bump_hooks
. - Package hooks run with the package path as current directory.
- They can be overridden per package. For instance if all packages are build with
cargo
except for anpm
frontend. you just need to override the hooks for that package. - package declared with
public_api = false
will be bumped but will not affect the calculated global version.