Repository navigation
feat(versioning): add versionCommand, a command that decides the release version - #1331
Conversation
There was a problem hiding this comment.
Nothing blocking. The resolved version reaches the tag, the changelog, the manifests and bumped_versions on both the direct path and the cascade path. check, preview, why and graph never execute the command. Nits are inline: the non-semver output is not checked to go past the current version although the docs say it is, and the prerelease channel is not checked.
| _ => { | ||
| let valid = version | ||
| .chars() | ||
| .all(|c| c.is_ascii_alphanumeric() || matches!(c, '.' | '-' | '+' | '_')); | ||
| if !valid { | ||
| bail!("versionCommand must print a bare version, got {output:?} from: {command}"); | ||
| } | ||
| } |
There was a problem hiding this comment.
Nit: for calver, sequential and the other non-semver strategies, nothing checks that the output goes past current, but the docs and schema say "must be a version that goes past the current one". If a calver command prints 2025.1.1 while the current version is 2026.1.1, and that tag no longer exists, the release goes backwards without an error. I'd add a strategy-aware comparison (numeric, dot-separated segments works for every calver and sequential format). The alternative is to limit the doc sentence to semver and zerover.
Also on this function: on a prerelease channel, a stable output such as 2.0.0 is accepted, and the package then ships with is_prerelease: true and a stable version. Either reject that or document it.
| @@ -30,16 +31,19 @@ pub(super) struct CascadeSink<'a> { | |||
|
|
|||
| #[allow(clippy::too_many_arguments)] | |||
There was a problem hiding this comment.
Nit: the function takes 5 arguments now, so this allow no longer suppresses anything and can go.
974eadc to
a038365
Compare
There was a problem hiding this comment.
Re-checked after the rebase onto the refactored run pipeline. Nothing blocking. The resolved version still reaches the tag, the changelog, the manifests and bumped_versions through PackageRun and CascadedRelease, and the read-only commands still pass false. shadow-release now runs the command too, which matches how it runs hooks.
## [7.32.0] - 2026-10-20 ### Features - feat(versioning): add versionCommand, a command that decides the release version (#1331)
Closes #1021
Adds
versionCommand(workspace, with a per-package override). Its stdout is the version a release ships.release(dry run included), after the bump is decided and before any version file, tag or changelog heading is written. Also runs for packages bumped by the dependency cascade.check,preview,whyandimpactnever run it.check --jsonreportsnext_versionandtagasnull, text output says the version is set by the command.vdropped, and rejected if empty, not semver (semver/zerover), not past the current version, or if the tag already exists. Printing the current version skips the package.--force-versionwins over it.next_versionandtagincheck --jsonare now nullable, which only shows when aversionCommandis configured.Schemas, en/fr config docs and the release-algorithm diagram are updated.