Skip to main content

Module bump

Module bump 

Source
Expand description

The engine-owned version-bump arithmetic (release-rust-workspace-multicrate facet 2).

shipshape release plan --bump major|minor|patch supplies only a semantic level; the engine computes the new version from the current manifest version — there is no hand-typed literal version (--version was removed in 0.3.0, release-drop-version-flag, and stays removed). This module is the pure, side-effect-free core of that computation: parse a strict X.Y.Z version and apply a BumpLevel. It fails closed on a non-semver manifest version rather than guess, so a malformed version aborts release plan instead of publishing an unintended number.

The bump is strict MAJOR.MINOR.PATCH (three non-negative integers): a pre-release or build-metadata version (1.2.3-rc.1, 1.2.3+build) is refused — bumping such a version is ambiguous, and a release cut publishes a plain release version, so refusing is the safe, unsurprising behaviour.

Structs§

BumpError
Why an engine-owned bump plan could not be built. This covers an invalid source version and plan-time edit-set conflicts such as non-equivalent workspace pins; both refuse before an approval artifact is sealed.

Enums§

BumpEditError
Why a cut-time bump edit could not be applied to a file’s text. Each variant is a fail-closed refusal — the executor aborts the cut rather than commit a wrong edit.

Functions§

bump_version
Compute the next version by applying level to a strict X.Y.Z current version.
finalize_changelog
Finalize a Keep-a-Changelog CHANGELOG: promote the ## [Unreleased] section’s content under a new dated ## [<version>] - <date> header, leaving a fresh empty ## [Unreleased] above it for the next cycle. Returns the new text.
finalize_marker_changelog
Finalize a marker-owned changelog region without allowing the released section or marker comments to enter the release notes. compiled_notes contains any fragment and trailer-derived material gathered by the effectful executor.
package_version
The root [package] version = "…" value, or None when the table or its version line is absent.
rewrite_pin
Rewrite a single intra-workspace =-pin (dependency = "…, version = \"<from>\"") from from to to, returning the new manifest text.
rewrite_workspace_pin
Rewrite an exact internal pin owned by the root [workspace.dependencies] table.
root_manifest_version
The release version source in a root Cargo manifest. A workspace package version is authoritative when present; otherwise a plain single-crate [package] version is used. This is deliberately a shape check, not a best-effort search across tables.
set_package_version
Rewrite the root [package] version = "<from>" line to to, preserving the line’s formatting and failing closed when the sealed source version is absent.
set_workspace_version
Rewrite the [workspace.package] version = "<from>" line to to, returning the new manifest text.
workspace_version
The [workspace.package] version = "…" value, or None when the section or its version line is absent.