What's new
Channels have always been able to send releases down a different lifecycle. Now they can also decide which versions are allowed in the lane - both the release version itself, and the package versions pinned into it.
Release version rules
A channel can carry a version range and a prerelease setting. The version range is defined as a NuGet-style range e.g. [2.0,3.0). A release can only be created in the channel when its version satisfies both. Set a production channel to Stable only and a preview channel to Prereleases only and the two streams stop leaking into each other.
The two parts are independent: the range bounds the version number, and the prerelease setting decides whether tagged versions are allowed at all. The range's endpoints therefore compare on the number alone, so [2.0,4.0) accepts 2.0.0-beta and rejects 4.0.0-beta. This deliberately differs from raw NuGet range semantics, which sort a prerelease below its own release - a channel configured as "2.0 to 4.0, betas only" has to accept 2.0.0-beta.
Prereleases are chosen from a dropdown - Any version, Stable only, Prereleases only, or Matching a pattern... for a custom regular expression over the tag. The mode is derived from the stored pattern rather than being a field of its own, so a channel authored over the API displays as the matching preset.
Because a suggested version has no prerelease tag on its own, a channel can also carry a tag to add to auto-suggested versions: set it to beta and the release form suggests 1.4.0-beta instead of 1.4.0.
Package version rules
Each channel now has an ordered list of package rules: a package filter (a glob over the package ID, e.g. MyApp.*), plus the same version range and prerelease setting. Rules are matched top to bottom and the first matching filter wins, so specific filters go above the catch-all. A package matched by no rule is unconstrained, and each filter may only be used once per channel.
In the release form
Rules apply while you type, not only on submit. The suggested version is seeded from the releases already in the selected channel and nudged to satisfy its rule; package dropdowns only offer versions the channel allows; switching channel re-pins any package whose version is no longer allowed and tells you what it changed; and if no available version of a package satisfies the rule, you get an explicit error and the create button stays disabled.
The channel editor has a try a version against this rule box that reports Allowed or Rejected with the reason before you save.
Upgrading
Every rule field is blank after upgrade, so existing channels are unrestricted and nothing changes until you fill one in. Rules gate release creation - releases that already exist are unaffected if you tighten a channel later. CI gets the same errors as the UI, naming the channel and the reason.
See the Channel Version Rules guide, or the channel endpoints for create and update.
Highlights
- Release version rules - a channel can bound the release version number with a range and decide whether prereleases are allowed; a release can only be created in the channel when its version satisfies both
- A prerelease dropdown - Any version, Stable only, Prereleases only, or a custom pattern over the tag, derived from the stored pattern so API-authored rules display as the matching preset
- Package version rules - an ordered list of glob filters over package IDs, each with its own version range and prerelease setting; first matching filter wins, unmatched packages are unconstrained
- Channel-aware version suggestions - the suggested version is seeded from the releases already in the channel and nudged to satisfy its rule, using the channel's tag for auto-suggested versions
- A release form that follows the rules - package dropdowns show only allowed versions, switching channel re-pins non-compliant packages with a notice, and a package with no compliant version blocks creation with an explicit error
- Try a version before you save - the channel editor reports Allowed or Rejected, with the reason, as you type
- Rule fields on create, update and list channel, and channel rule enforcement documented on create a release
- Existing channels are unrestricted after upgrade - every rule field starts blank