Feature request: Inherit version number but allow unstable suffix in version.json
Currently, when using version.json inheritance in Nerdbank.GitVersioning, to publish an "unstable" prerelease from a stable branch (such as when one particular package is still considered unstable while its peers are already stable), the inherited version number must be hard-coded into both the original and the inheriting version.json. This can easily get out of sync and is error-prone.
Proposed feature:
Allow a version.json file to inherit the base version from an ancestor but append or override the 'prerelease' (unstable) portion without hard-coding the inherited version number. For example:
{
"$schema": "https://raw.githubusercontent.com/dotnet/Nerdbank.GitVersioning/master/version.schema.json",
"inherit": true,
"prerelease": "beta"
}
or some similar property that enables the inheriting version.json to add/change only the prerelease suffix while continuing to inherit the numerics.
Motivation / scenario:
- Facilitate clean handling of release branches and dev branches without synchronized version updates in multiple files.
- Reduce maintenance friction and mistakes in version management workflows.
Desired outcome:
- A way to specify only a prerelease suffix in version.json that augments (does not override) an inherited version, without repeating or hardcoding the version numbers.
- The new
prerelease property should be allowable only on version.json files that inherit, and which do not specify any prerelease suffix within their version property.
- Setting
"prerelease": "" explicitly should have the effect of suppressing a prerelease suffix that might have been otherwise inherited. But merely omitting the prerelease property will have the effect of relying wholly on the version property (if specified) or inheriting whatever the parent version.json file specifies.
- New tests
- Updated documentation
- Updated version.schema.json. The schema should be written such that
prerelease is only allowed when inherit: true is specified. Ideally it also forbids - appearing in the version property at the same time as the prerelease property appears, but only if that doesn't require cloning a huge chunk of schema which will be a maintenance burden.
Feature request: Inherit version number but allow unstable suffix in version.json
Currently, when using version.json inheritance in Nerdbank.GitVersioning, to publish an "unstable" prerelease from a stable branch (such as when one particular package is still considered unstable while its peers are already stable), the inherited version number must be hard-coded into both the original and the inheriting version.json. This can easily get out of sync and is error-prone.
Proposed feature:
Allow a version.json file to inherit the base version from an ancestor but append or override the 'prerelease' (unstable) portion without hard-coding the inherited version number. For example:
{ "$schema": "https://raw.githubusercontent.com/dotnet/Nerdbank.GitVersioning/master/version.schema.json", "inherit": true, "prerelease": "beta" }or some similar property that enables the inheriting version.json to add/change only the prerelease suffix while continuing to inherit the numerics.
Motivation / scenario:
Desired outcome:
prereleaseproperty should be allowable only on version.json files that inherit, and which do not specify any prerelease suffix within theirversionproperty."prerelease": ""explicitly should have the effect of suppressing a prerelease suffix that might have been otherwise inherited. But merely omitting theprereleaseproperty will have the effect of relying wholly on theversionproperty (if specified) or inheriting whatever the parentversion.jsonfile specifies.prereleaseis only allowed wheninherit: trueis specified. Ideally it also forbids-appearing in theversionproperty at the same time as theprereleaseproperty appears, but only if that doesn't require cloning a huge chunk of schema which will be a maintenance burden.