-
Notifications
You must be signed in to change notification settings - Fork 769
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Generalise how package version isn't stabilized for dev/preview stages #5640
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -8,13 +8,21 @@ | |||||||||||
<VersionPrefix>$(MajorVersion).$(MinorVersion).$(PatchVersion)</VersionPrefix> | ||||||||||||
<ValidateBaseline>true</ValidateBaseline> | ||||||||||||
<AssemblyVersion>$(MajorVersion).$(MinorVersion).0.0</AssemblyVersion> | ||||||||||||
<!-- | ||||||||||||
When DotNetFinalVersionKind is set to 'release', this branch will produce stable outputs for 'Shipping' packages | ||||||||||||
--> | ||||||||||||
<DotNetFinalVersionKind /> | ||||||||||||
<DotNetFinalVersionKind>release</DotNetFinalVersionKind> | ||||||||||||
|
||||||||||||
<!-- Enabling this rule will cause build failures on undocumented public APIs. --> | ||||||||||||
<SkipArcadeNoWarnCS1591>true</SkipArcadeNoWarnCS1591> | ||||||||||||
</PropertyGroup> | ||||||||||||
|
||||||||||||
<PropertyGroup> | ||||||||||||
<!-- | ||||||||||||
Makes it such that the package version won't be stabilized even when the rest of the repo is going stable. | ||||||||||||
https://github.com/dotnet/arcade/blob/main/Documentation/CorePackages/Versioning.md#package-version | ||||||||||||
--> | ||||||||||||
<SuppressFinalPackageVersion /> | ||||||||||||
<SuppressFinalPackageVersion Condition="'$(Stage)' == 'dev' or '$(Stage)' == 'preview'">true</SuppressFinalPackageVersion> | ||||||||||||
</PropertyGroup> | ||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Version suffix calculations are performed in Version.BeforeCommonTargets.targets, which too late for the functionality placed in eng/MSBuild/ProjectStaging.targets There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Will Stage be defined this early though? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oh, I see it will because you are creating a Directory.Build.props everywhere to make sure you control the order of imports. While that would work, I'd argue that we are probably defeating the point of the benefit of the change. The initial motivation was to simplify things, and reducing 2 lines in projects (setting the stage, and setting suppressFinalVersion) to a single one, but this is instead now making us having to add new files per project, and it also means that now you need to know to look into this file to see if a package is stable or not and also to know what is the stage. Thoughts? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Probably an even more meta question (sorry for having this discussion in your PR) is: do we even really need package stages? What benefit are we getting out of them? if it is literally just that the description has a few other words as a prefix, then perhaps we should just have stable and unstable packages, and adjust the descriptions of packages accordingly. That way, we can go back to having a single property in the package that marks it's "stableness" There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
The stages drive the test coverage requirements extensions/eng/MSBuild/ProjectStaging.targets Lines 19 to 23 in c08e5ac
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Right but that could easily just be controlled without stages, right? You can basically just change that logic to read whether a package is stable or not via supressfinalpackageversion |
||||||||||||
|
||||||||||||
<!-- | ||||||||||||
|
||||||||||||
These versions should ONLY be updated by automation. | ||||||||||||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<Project> | ||
<!-- In order to get the right package versions for projects that shouldn't stabilize, we need to set this property before | ||
importing the root level Directory.Build.props file. This property should be kept in here, as opposed to moving it to | ||
the project itself. --> | ||
<PropertyGroup> | ||
<Stage>preview</Stage> | ||
</PropertyGroup> | ||
|
||
<Import Project="$([MSBuild]::GetPathOfFileAbove('Directory.Build.props', '$(MSBuildThisFileDirectory)../'))" /> | ||
</Project> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<Project> | ||
<!-- In order to get the right package versions for projects that shouldn't stabilize, we need to set this property before | ||
importing the root level Directory.Build.props file. This property should be kept in here, as opposed to moving it to | ||
the project itself. --> | ||
<PropertyGroup> | ||
<Stage>preview</Stage> | ||
</PropertyGroup> | ||
|
||
<Import Project="$([MSBuild]::GetPathOfFileAbove('Directory.Build.props', '$(MSBuildThisFileDirectory)../'))" /> | ||
</Project> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<Project> | ||
<!-- In order to get the right package versions for projects that shouldn't stabilize, we need to set this property before | ||
importing the root level Directory.Build.props file. This property should be kept in here, as opposed to moving it to | ||
the project itself. --> | ||
<PropertyGroup> | ||
<Stage>preview</Stage> | ||
</PropertyGroup> | ||
|
||
<Import Project="$([MSBuild]::GetPathOfFileAbove('Directory.Build.props', '$(MSBuildThisFileDirectory)../'))" /> | ||
</Project> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<Project> | ||
<!-- In order to get the right package versions for projects that shouldn't stabilize, we need to set this property before | ||
importing the root level Directory.Build.props file. This property should be kept in here, as opposed to moving it to | ||
the project itself. --> | ||
<PropertyGroup> | ||
<Stage>preview</Stage> | ||
</PropertyGroup> | ||
|
||
<Import Project="$([MSBuild]::GetPathOfFileAbove('Directory.Build.props', '$(MSBuildThisFileDirectory)../'))" /> | ||
</Project> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<Project> | ||
<!-- In order to get the right package versions for projects that shouldn't stabilize, we need to set this property before | ||
importing the root level Directory.Build.props file. This property should be kept in here, as opposed to moving it to | ||
the project itself. --> | ||
<PropertyGroup> | ||
<Stage>preview</Stage> | ||
</PropertyGroup> | ||
|
||
<Import Project="$([MSBuild]::GetPathOfFileAbove('Directory.Build.props', '$(MSBuildThisFileDirectory)../'))" /> | ||
</Project> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<Project> | ||
<!-- In order to get the right package versions for projects that shouldn't stabilize, we need to set this property before | ||
importing the root level Directory.Build.props file. This property should be kept in here, as opposed to moving it to | ||
the project itself. --> | ||
<PropertyGroup> | ||
<Stage>dev</Stage> | ||
<StageDevDiagnosticId>EXTEXP0018</StageDevDiagnosticId> | ||
</PropertyGroup> | ||
|
||
<Import Project="$([MSBuild]::GetPathOfFileAbove('Directory.Build.props', '$(MSBuildThisFileDirectory)../'))" /> | ||
</Project> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NIT: No need to unset it here as that is the default already.