Repository navigation
Never stabilize Components.Media and Components.Testing packages - #68061
Conversation
These two packages are not shipping a stable version as part of .NET 11.0, so they must not produce an 11.0.0 (RTM) or 11.0.0-rc.N (branded RC) package when the repo does a stabilized build. Set SuppressFinalPackageVersion=true on both projects so Arcade keeps the dated prerelease suffix, and pin PreReleaseVersionLabel/Iteration to new PreviewOnlyPackage* properties in eng/Versions.props. Pinning the label is required for two reasons: Arcade builds the version suffix from that label (so RTM would otherwise yield 11.0.0-rtm.N.<date>.<rev>), and it skips the suffix logic entirely when the label is empty. The properties are listed in TreatAsLocalProperty so they also win over command-line global properties. Co-authored-by: Copilot App <[email protected]> Copilot-Session: b6b0bbb5-1c56-452c-95ce-03ec29c9d610
There was a problem hiding this comment.
Pull request overview
This PR ensures Microsoft.AspNetCore.Components.Media and Microsoft.AspNetCore.Components.Testing never produce stabilized (RC/RTM) package versions on .NET 11 release branches by opting them out of Arcade version stabilization while keeping assembly/file versions unchanged.
Changes:
- Adds repo-level “preview-only package” version label/iteration properties in
eng/Versions.props. - Updates the Media and Testing
.csprojfiles to:- set
SuppressFinalPackageVersion=true - override
PreReleaseVersionLabel/PreReleaseVersionIterationto the new preview-only properties - use
TreatAsLocalPropertyso project values win over official-build global properties.
- set
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| eng/Versions.props | Introduces shared properties for packages that must remain preview-only across RC/RTM builds. |
| src/Components/Media/src/Microsoft.AspNetCore.Components.Media.csproj | Opts the Media package out of stabilization and pins prerelease label/iteration via repo-level properties. |
| src/Components/Testing/src/Microsoft.AspNetCore.Components.Testing.csproj | Applies the same stabilization opt-out + label/iteration override behavior for the Testing package. |
| <Description>Media components for Blazor applications, including Image, Video, and FileDownload.</Description> | ||
| <GenerateDocumentationFile>true</GenerateDocumentationFile> | ||
| <Nullable>enable</Nullable> | ||
| <!-- |
There was a problem hiding this comment.
In the past, e.g, for Swagger.Grpc package, we used to only simply have:
<VersionPrefix>$(ExperimentalVersionPrefix)</VersionPrefix>
Do we need the additional complication here over just setting VersionPrefix?
There was a problem hiding this comment.
Note that for Swagger.Grpc, the produced experimental versions didn't have any pre-release labels, but the version number itself was 0.x.y and that's how we indicated it being experimental. That probably arguably wasn't ideal from SemVer point of view though
There was a problem hiding this comment.
We want to keep the current version. We will remove this commit altogether once we branch for 12.0
wtgodbe
left a comment
There was a problem hiding this comment.
What's the motivation here? rc1 and rc2 shipping packages normally still get non-stable versions - we only go stable once we hit RTM. Will these still go to nuget? Having non-stable versioned packages on nuget would cause problems for any stable package who depends on them. Why not just mark them as non-shipping?
Overview
Microsoft.AspNetCore.Components.MediaandMicrosoft.AspNetCore.Components.Testingare not shipping a stable version as part of .NET 11.0, so they must never produce an11.0.0(RTM) or11.0.0-rc.N(branded RC) package, even when the release branch does a stabilized build. This change opts both packages out of version stabilization in Arcade so they keep producing dated prerelease versions like11.0.0-preview.7.26378.1in every build kind. Three files change:eng/Versions.propsplus the twosrcproject files. No product code changes, andVersionPrefixis untouched, so assembly and file versions stay11.0.0.0.Design
The contract is a pair of new repo-level properties in
eng/Versions.propsthat own the label used by packages that intentionally never stabilize, so the label does not drift when the release branch flipsPreReleaseVersionLabeltorcorrtm:Two design decisions are worth calling out, because the obvious simpler versions of this change do not work.
SuppressFinalPackageVersionalone is not enough. Arcade's escape hatch restores the dated suffix, but that suffix is built fromPreReleaseVersionLabel, which the release branch sets tortmat GA. Without the label override the package version becomes11.0.0-rtm.7.26378.1, which is prerelease but reads like an RTM build. Worse, if the branch ever setsPreReleaseVersionLabelto empty (Arcade's release-only path), the entire suffix block is skipped,SuppressFinalPackageVersionis never consulted, and the version collapses to11.0.737801. Pinning a non-empty label defends against both.The properties must live in the project body, not in
Directory.Build.targets. Arcade computes the version inVersion.BeforeCommonTargets.targets, which is imported after the project body but beforeDirectory.Build.targets, so anything set in the repo's targets file is too late to be observed.Implementation
Both projects get the same three properties.
Mediais the representative case:src/Components/Testing/src/Microsoft.AspNetCore.Components.Testing.csprojtakes the identicalTreatAsLocalPropertyattribute and the identical three-property block; nothing else differs between the two, so it is not repeated here. TheTestingpackage also packsTesting/genandTesting/tasksas content, but both of those already setIsPackable=false, so only the two packages above are affected.This is safe to do per-project because neither package is part of the shared framework. Neither appears in
eng/SharedFramework.Local.props, they are listed only ineng/ShippingAssemblies.props,eng/ProjectReferences.propsandeng/TrimmableProjects.props, and nothing in the repo takes a versioned dependency on them, so decoupling their package version from the product version has no ripple effect.eng/Publishing.propsdoes not filter packages by version either, so a prerelease-versioned shipping package still gets signed and published normally.Outcome
Verified by MSBuild property evaluation against
Microsoft.AspNetCore.Components.QuickGridas an unmodified control, using-p:OfficialBuildId=20260728.1:DotNetFinalVersionKind=release, labelrtm)11.0.0-preview.7.26378.111.0.0DotNetFinalVersionKind=prerelease, labelrc, iteration 1)11.0.0-preview.7.26378.111.0.0-rc.1.final11.0.0-preview.7.26378.111.0.0-preview.7.26378.1PreReleaseVersionLabel(Arcade's release-only path)11.0.0-preview.7.26378.111.0.737801OfficialBuildId)11.0.0-dev11.0.0-devA real
-t:Packof the Media project under the RTM simulation producedMicrosoft.AspNetCore.Components.Media.11.0.0-preview.7.26378.1.nupkgwhileMicrosoft.AspNetCore.App.Internal.Assets.11.0.0.nupkgpacked stable in the same run, confirming the opt-out is scoped to the intended project. Packing the Testing project end to end was not possible locally because it transitively builds ANCM, which requires fullMSBuild.exe; its version was confirmed through evaluation instead.Two related decisions are deliberately left out of this change and still need a call: whether these packages keep
IsShippingPackage=trueand get published to nuget.org at GA, and whether their APIs stay inPublicAPI.Unshipped.txtthrough the RTM shipped-API sweep so we do not take stable-API compat obligations on packages that never shipped stable.