Skip to content

cargo-smart-release v0.4.0

Compare
Choose a tag to compare
@Byron Byron released this 15 Oct 09:20
· 7301 commits to main since this release
59ffbd9

This major release adds changelog support to automatically generate scaffolding to be filled in by hand. The feature is driven by
conventional commit messages which are used sparingly to mark important changes only.
Furthermore, it will deduce the require version bump, i.e. patch, minor or major, automatically by looking at the commit history
and interpreting 'conventional commit' messages. This means that from time to time one would sprinkle in a specifically formatted
commit message to leave enough information to determine the correct release version and create changelog scaffolding.

If you have 10 minutes, the following video gives the whirlwind tour through the new features (and note that all issues discovered there
have been fixed :)
).

12 minute introduction video

If you have 30 minutes, there is also a long version of the video.

And there is another one showing cargo smart-release releasing gitoxide 0.9.0, along with some explanation on how it works.

8 minute video releasing gitoxide

Changelog Support in cargo smart-release

When using cargo smart-release in dry-run mode (default), additional information regarding changelog will be printed.
This informs you a release would be attempted, or if manual adjustments to the changelogs would be required, for example as
they are fully generated with statistical information only.

If there is no issue with the initial changelogs, passing the --execute flag will write the changelogs after
providing them to you for preview (using bat) for a last chance to abort the operation. Otherwise the publishing
will proceed, which includes the creation of tag objects containing the relevant section of the changelog, along with
a GitHub release which is annotated with the same section (only if the repository is hosted on GitHub).

If there are issues to be corrected, there will be suggestions to run cargo changelog --write --only <crate-name>
one by one, or the release operation will have left a single commit with all changelogs written out.
In any case, it's recommended to re-write the changelog after editing to assure it is indeed stable and won't change each time
the generator is run.

For more information, run cargo smart-release -h.

The cargo changelog Sub-Command

This new sub-command sports the same dependency resolution as smart-release itself, operates in dry-run mode by default
to preview changelogs that would be written. Use the --write flag to actually write changes to disk.

It's primary use is to conveniently generate changelogs from time to time to add the final polish by hand before
actually releasing them along with the crate with smart-release.

For more information, run cargo changelog -h.

Other BREAKING Changes

  • renamed --skip-* flags to --no-* for consistency
  • rename --skip-dependencies to --no-dependencies to be more inline with existing terminology of other flags.
  • rename short name for --execute to -e from -n for consistency

Other Changes

  • --no-dependencies now has --only as alias

Bug Fixes

  • Previously it might have been possible to see that it won't use a 'new' crate version as it's already in the manifest, even if these are the same. This is now fixed.

Commit Statistics

  • 280 commits contributed to the release over the course of 36 calendar days.
  • 19 commits where understood as conventional.
  • 6 unique issues were worked on: #192, #197, #198, #200, #213, #67

Thanks Clippy

Clippy helped 27 times to make code idiomatic.

Commit Details

view details
  • #192
    • smart-release: assure the current package version is actually breaking (fb750b6)
    • smart-release: better verbosity handling when comparing to crates-index (f6f2d1b)
    • smart-release(feat): turn off safety bump with its own flag (a040f7d)
    • smart-release(refactor): (443f000)
  • #197
    • smart-release: improved safety bump log message (9b78c34)
    • smart-release: commit message reveals safety bumps (b1a3904)
    • smart-release: released crates only receive minor bumps… (ecf38b8)
    • smart-release(chore): update changelog (342b443)
    • smart-release(test): way more tests to nail current log output (0d30094)
    • smart-release: dependency upgrade works (a56bd7b)
    • smart-release: calculate new version of dependent (c50704a)
    • smart-release(fix): don't claim "conservative" updates for major version change (681d743)
    • smart-release: assure we can find non-sequential connections (798b650)
    • smart-release: all logic to calculate dependent version bumps (7ca029c)
    • smart-release: an algorithm to collect dependencies by 'growing' (73794a4)
    • smart-release: foundation for bumping versions (d1145d1)
  • #198
    • Polish README a little more (455c45d)
    • First version of updated README (45dcc68)
    • Finish changelog (e341b22)
    • Enforce an empty line after user sections (79f0093)
    • Respect release-level removed-id list even when inserting sections (2970fff)
    • rename short name for --execute to -e from -n for consistency (19fc134)
    • --no-dependencies now has --only as alias (e668bf2)
    • Write more of the smart-release changelog to learn --no-dependencies needs an alias (65468c8)
    • Show how many more changelogs are going to be previewed… (94a6788)
    • Start writing the 0.4 changelog (5f18bc9)
    • Only use src/ directory for top-level crate change tracking… (f26b581)
    • refactor (78c4ad5)
    • Don't show previews in dry-run mode; provide help on how to fix this before release (cdb8db4)
    • Fix naughty issue that isn't even reproducible… (95cb79c)
    • Correctly parse back single-word conventional messages (bfa0777)
    • Fix logic to determine if breaking changes are already handled by package version (cb06e9d)
    • greatly simplify dry-run preview for clear visuals (2990028)
    • Update expectations for log messages (494e8e5)
    • Use correct title for github release to match name of tag (90f39ad)
    • Fix logic to determine if links should be used… (dcc5c1c)
    • Fix logic to determine if there are conventional headlines to fix - ignore non-breaking (f80b7fc)
    • Fix commit subject line when release would stop due changelog (2cdc852)
    • Fix github release invocation (6f0fdbf)
    • less surprising location of the 'prepare release' message (0dd739b)
    • Much better preview titles (b70f815)
    • Use --file-name flag to shorten displayed path (6e6dcda)
    • Fix crate name and version for --version flag (4cc0213)
    • clap second pass with arg headlines and better help messages (624076f)
    • First pass of using clap instead of argh (836837c)
    • Use fmt::Display instead of io::Write when creating markdown docs… (fb946b6)
    • even cleaner release text, just with detail tags… (52a6cc8)
    • less verbose gh tool logging in dry-run mode (75ebf0b)
    • try to do github releases for multi-crate releases, too (552ae4f)
    • improve commit message titles and simplify tag-name logic (4aa68bd)
    • refactor (a6d3bb1)
    • First sketch of running gh tool to create releases (bf7f020)
    • support for ssh->https github urls; more robustness in general (ab7ea71)
    • Add flag to allow disabling github releases (5f6c4de)
    • sketch incorporation of github CLI support (5aa6ef9)
    • git::remote_url() is now optional (e16603b)
    • Inform about the difference between tag objects and references in verbose logs (98a9f10)
    • rename ObjectAccessExt::tag(…) to *::tag_reference(…), add easy::Object::try_to_tag() (e59f901)
    • add easy::ext::ObjectAccessExt::tag(…) to create tag objects (80b8331)
    • Allow to skip writing section titles and html tags (7b29406)
    • Allow to turn off changelog links (b33e737)
    • pass release section text to function soon creating a tag object (a4ac96c)
    • precise change tracking for changelogs (d038c06)
    • Fix stop-release-for-changelog logic and fix all affected changelogs (52b38bc)
    • less verbose changelog and smart-release sub-commands related to changelogs (c096805)
    • Adjust all changelogs to fulfil requirements for publishing (04b9ca0)
    • Handle changelogs with upcoming version section if they were left for editing (0f5f47d)
    • refactor (6d30e2c)
    • Automatically stop releases if changelogs are fully generated, and a flag to disable that (7161340)
    • Check for changelog sections which are purely generated and warn about those (a9b8321)
    • See how it deals with major versions and auto-bumping in journey tests (b450bf3)
    • more consistent log messages pertaining crate names (b32d8d6)
    • first working version of version auto-bumping based on changelog (5ca7b1d)
    • issue links for category headlines (425d3df)
    • prepare for arrival of 'auto' bump mode (306035c)
    • Fix git-url re-export to respect feature flags (ec4e3ca)
    • deduplicate conventional message ids (e695eda)
    • regenerate all changelogs to get links (0c81769)
    • link up github issue ids in statistics (661cd39)
    • format links for commit ids (9426db5)
    • pass actual repository url down from commands (4e03515)
    • Make git_url::Url available under git_repository::Url (0ebfeb6)
    • Foundation for rendering links if needed (ba4ce96)
    • Rename title for "Fixed" to "Bug Fixes" (e766b01)
    • Mention actual issues that where worked on (a517e39)
    • Also parse 'style' if there are breaking changes (bc9d85a)
    • Allow 'refactor' and 'other' in conventional messages if they have breaking changes (4eebaac)
    • Support writing whole bodies in conventional messages… (c1f3c9d)
    • Support for paragraphs in conventional items (7f52823)
    • respect release-wide ignore list to allow removing entire conventional headlines (145103d)
    • Only write headlines that we can parse back… (d44369a)
    • handle all possible changelog headlines and add roundtrip tests (fda5ccf)
    • First basic parsing of conventional user and generated messages (56cd4ac)
    • parsing of removed conventional messages from changelogs (c593252)
    • first basic merging of conventional messages… (9af3248)
    • Trivially emulate gits way of handling commit dates… (f58b30a)
    • Also consider changes of changelogs themselves… (8a2042c)
    • Adjust date of upcoming version as well (fab4649)
    • assure git-conventional is treated like user generated content for statistics (1fd5acb)
    • merge doesn't consider user generated sections, only the ones it would want to add (ebbebdd)
    • Quick and dirty writing of conventional messages… (adfbd0d)
    • basic generation of git-conventional information (77b0feb)
    • Sketch out data structure for git-conventional segments (2713c02)
    • refactor (bcdec5e)
    • smart-release with --changelog-without option… (ae8780e)
    • changelog command learns the --without
      option (509550f)
    • Easy removal of statistical sections, by just removing them… (91efd68)
    • Rebuild all changelogs to assure properly ordered headlines (4a9a05f)
    • reorder headlines according to version ordering… (2ff0c20)
    • Sort all commits by time, descending… (f536bad)
    • greatly reduce changelog size now that the traversal fix is applied (a0bc98c)
    • Use most relevant parent tree for change comparison… (5b9dd14)
    • Use hashmap based lookup for trees… (48a0c76)
    • refactor and improve path filtering to find relevant commits… (01b2466)
    • The first headline level controls all the other ones (715ea54)
    • adapt to git-hash refactor (925d668)
    • Fixup remaining changelogs… (2f75db2)
    • Generate changelogs with details (e1861ca)
    • Only use short hashes for logs, without detecting ambiguity for now (772525c)
    • boost allowed package sizes… (1b21d71)
    • Stable smart-release journey tests… (fc79188)
    • Update all changelogs with details (58ab2ae)
    • Put commit details to the end of generated segments (054d207)
    • Use message commit id instead of body… (9b46f32)
    • fix md formatting on github (262c000)
    • create details headline based on log message (04bbcbb)
    • Add details behind a fold, but… (3360b2e)
    • Use the notion of 'changes after merge' only to drive previews… (634267c)
    • Update changelogs (c857d61)
    • refactor (7a83103)
    • Also provide a duration in days for preparing a release as part of statistics (bd12cac)
    • Fix tests (6c98afc)
    • refactor (65fa0a4)
    • More commit statistics (0840e7e)
    • Basic commit statistics with round-trip, more actual information to come (6d097ae)
    • refactor… (ce0dda2)
    • More robust parsing of read-only sections (a3954f4)
    • treat clippy as generated statistical section… (1cff425)
    • Add new section type and write it out: clippy (6fca2ac)
    • introduce notion of essential sections in a changelog… (be891e2)
    • Preview changelog support for smart-release as well (b9e6de1)
    • Detect changes after merge; add flag for controlling changelog preview (6beb734)
    • A lot of logic to handle messaging around changelog generation and halting… (28f6e18)
    • Unconditional changelog creation in smart-release (48b5228)
    • rename --skip-* flags to --no-* for consistency (3c0a638)
    • fix windows tests by transforming line endings (e276d77)
    • Avoid adding newlines which make writing unstable (6b5c394)
    • Fix section headline level (9d6f263)
    • Write first version of changlogs thus far… (719b6bd)
    • Implement --write actually (69d36ff)
    • Parse more user generated section content, adapt existing changelogs to work correctly (2f43a54)
    • a test case showing that headlines are currently ignored, and links too (2a57b75)
    • don't try to run tests in binaries that have none… (d453fe5)
    • It's already getting there, even though a few parts are completely missing (ee4aa08)
    • only parse into 'unknown' catch all in special cases… (c0296c4)
    • first basic parsing of unknown parts as segments in sections (f265982)
    • quick and dirty switch to getting access to a range of parsed input… (f5902f2)
    • setup test for old method of parsing unknown text… (996c39d)
    • refactor tests: unit to integration level (4326322)
    • Don't add a date to unreleased versions (ba4d024)
    • Actually integrated generated changelog with existing ones… (aa095e2)
    • inform about 'bat's absence (c82c5bc)
    • rename --no-bat to --no-preview… (1087dd8)
    • basic merging now works (6c6c200)
    • sketch for finding insertion points and merging sections (2a49033)
    • Sketch merging logic… (1932e2c)
    • prepare test for basic merging… (0a14ced)
    • nicer 'thanks clippy' message (4344216)
    • Show with simple example how the round-tripping works, neat (9510d9b)
    • collect unknown text so things don't get lost entirely… (60040c9)
    • parse back what we write out, perfectly… (5cab315)
    • fix journey test (3006e59)
    • Write new changelogs with bat if available (cca8e52)
    • Use cargo diet to reduce package size (cc5709e)
    • Write markdown changelog to lock file (400046e)
    • refactor (b05ce15)
    • Basic serialization of ChangeLog (205b569)
    • support for generated headers (bcc4323)
    • refactor (1ebb736)
    • Use 'to_*' when converting easy::Object to specific object kind (1cb41f8)
    • transform history segments into changelog parts (348b05c)
    • layout structure for ChangeLog generation from history items (40e9075)
    • more general commit history (39522ec)
    • Invert meaning of changelog's --dependencies flag… (51eb8cb)
    • rename --skip-dependencies to --no-dependencies… (77ed17c)
    • Remove strong-weak typing for conventional type (b71c579)
    • Fix panic related to incorrect handling of character boundaries (9e92cff)
    • Parse message fully (and own it) to allow markdown generation (b8107e5)
    • tests for conventional and unconventional description parsing (faade3f)
    • Make use of fixed git-conventional (b7b92b6)
    • update git-conventional dependency (2d369e8)
    • first test and sketch for stripping of additional title values (55b7fe8)
    • Basic message parsing, either conventional or not, without additions (b3b6a2d)
    • Sketch Message fields from which change logs can be built (b167d39)
    • Fix build (d0a956f)
    • More message parsing tests, now with legit failure… (625be8d)
    • Sketch data for parsed messages (32dd280)
    • smart-release: add git-conventional (0c355ed)
    • smart-release: consider nom for custom parsing, but… (5fc3326)
    • smart-release: refactor (17322fa)
    • smart-release: refactor (ac0696b)
    • smart-release: refactor (87ebacc)
    • smart-release: a seemingly slow version of path lookup, but… (41afad3)
    • smart-release: fast filter by single-component path (ae7def4)
    • smart-release: prepare for fast lookup of paths (fbf267e)
    • configure caches with env vars using apply_environment() (d422b9a)
    • refactor (e7c061b)
    • set package cache via RepositoryAccessExt (66292fd)
    • object-cache to allow for a speed boost… (06996e0)
    • smart-release: actually build the segment vec, without pruning for now (422701b)
    • smart-release: build commit history for later use in changelog generation (daec716)
    • smart-release: sketch history acquisition (debe009)
    • add 'Head::peeled()' method (56e39fa)
    • smart-release: some performance logging (1954b46)
    • smart-release: build ref lookup table (9062a47)
    • loose reference iteration with non-dir prefixes… (293bfc0)
    • Add 'references().all().peeled().'… (6502412)
    • smart-release: filter refs correctly, but… (2b4a615)
    • smart-release: find tag references by name… (72e1752)
    • git-ref(docs): improve changelog format (90e6128)
    • smart-release: sketch first step of info generation (ff894e5)
    • smart-release: changelog gets crates to work on (78d31d9)
    • smart-release: handle unborn heads (0e02831)
    • smart-release: fmt (d66c5ae)
    • smart-release: refactor (d4ffb4f)
    • smart-release: refactor (9fc15f9)
    • smart-release: refactor (9e430df)
    • smart-release: initial test for changelog (a33dd5d)
    • smart-release: very basic support for changelog command… (1a683a9)
    • smart-release: add 'cargo changelog' sub-command binary (3677b78)
    • smart-release(test): add changelog to most tests (cdf4199)
  • #200
    • parse issue numbers from description and clean it up (95c0a51)
  • #213
    • fix version logic to handle breaking version updates correctly (67ed644)
  • #67
    • split data::output::count::objects into files (8fe4612)
  • Uncategorized
    • thanks clippy (2113d79)
    • thanks clippy (7c78dcf)
    • thanks clippy (fc9da4c)
    • thanks clippy (41ed695)
    • thanks clippy (2b62956)
    • Adjusting changelogs prior to release of git-hash v0.7.0, git-features v0.16.5, git-actor v0.5.3, git-validate v0.5.3, git-object v0.14.1, git-diff v0.10.0, git-tempfile v1.0.3, git-lock v1.0.1, git-traverse v0.9.0, git-pack v0.12.0, git-odb v0.22.0, git-packetline v0.11.0, git-url v0.3.4, git-transport v0.12.0, git-protocol v0.11.0, git-ref v0.8.0, git-repository v0.10.0, cargo-smart-release v0.4.0, safety bump 3 crates (a474395)
    • thanks clippy (87d2f49)
    • thanks clippy (a1ebd80)
    • thanks clippy (ca0d943)
    • thanks clippy (8b3d9ea)
    • thanks clippy (ce48e18)
    • thanks clippy (af9d137)
    • Update changelogs just for fun (21541b3)
    • thanks clippy (bf514a2)
    • thanks clippy (ead04f2)
    • thanks clippy (e4f1c09)
    • thanks clippy (b856da4)
    • thanks clippy (31498bb)
    • thanks clippy (c55f909)
    • thanks clippy (b200ee8)
    • thanks clippy (4b3407d)
    • thanks clippy (1dece2b)
    • thanks clippy (a89d08c)
    • Merge branch 'main' into changelog-generation (c956f33)
    • don't claim to change manifest version if it's the same one (11eebdc)
    • thanks clippy (68ea77d)
    • thanks clippy (7899ef1)
    • thanks clippy (2b55427)
    • thanks clippy (a554b9d)
    • Bump git-repository v0.10.0 (5a10dde)
    • thanks clippy (d15fded)
    • [repository #164] fix build (1db5542)
    • Release git-repository v0.9.1 (262c122)
    • [smart-release] auto-detect changes in production crates as well (24bc1bd)
    • [smart-release #195] update test output to match CI… (f864386)
    • [smart-release #195] better error for untracked files. (f5266f9)
    • [smart-release #195] assure dependent packages are not packages to be published (6792ebc)
    • [smart-release #195] refactor (f354b61)
    • [smart-release #195] refactor (968b6e1)
    • [smart-release #195] don't tout changes that aren't really there… (5931012)
    • [smart-release #195] another test to validate log output (6148ebf)
    • [smart-release #195] a test that in theory should trigger the desired behaviour (fd50208)
    • [smart-release #194] basic journey test setup (d5d90a6)
    • thanks clippy (8fedb68)
    • [smart-release #194] conservative pre-release version updates (f23442d)
    • Bump git-repository v0.9.0 (b797fc1)