Skip to main content

Module bump

Module bump 

Source
Expand description

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

ossctl 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 a manifest version could not be bumped: it is not a strict X.Y.Z semver core, so the engine will not guess a new number (fail closed).

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.
rewrite_pin
Rewrite a single intra-workspace =-pin (dependency = "…, version = \"<from>\"") from from to to, returning the new manifest text.
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 — the post-hook validation read (bump_exec).