Skip to content
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

Controlling version number (with a prerelease) when building #27527

Closed
hounddog22030 opened this issue Mar 1, 2022 · 8 comments · Fixed by #32597
Closed

Controlling version number (with a prerelease) when building #27527

hounddog22030 opened this issue Mar 1, 2022 · 8 comments · Fixed by #32597
Assignees
Labels
area-docs closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. customer-reported punted-for-7.0 Originally planned for the EF Core 7.0 (EF7) release, but moved out due to resource constraints. type-enhancement

Comments

@hounddog22030
Copy link

If I make a fork and build EF Core, I see that I should use build.sh/cmd.

Is there a method to build -pack with a pre-release version number, e.g. 6.0.2-with-my-new-feature?

@hounddog22030
Copy link
Author

I edited Version.props as below:

  <PropertyGroup Label="Version settings">
    <VersionPrefix>6.0.3</VersionPrefix>
    <PreReleaseVersionLabel>rollback</PreReleaseVersionLabel>
    <PreReleaseVersionIteration>1</PreReleaseVersionIteration>
    <IncludeSourceRevisionInInformationalVersion>False</IncludeSourceRevisionInInformationalVersion>
    <IsServicingBuild Condition="'$(PreReleaseVersionLabel)' == 'servicing'">true</IsServicingBuild>
    <!--
        When StabilizePackageVersion is set to 'true', this branch will produce stable outputs for 'Shipping' packages
    -->
    <StabilizePackageVersion Condition="'$(StabilizePackageVersion)' == ''">false</StabilizePackageVersion>
    <DotNetFinalVersionKind Condition="'$(StabilizePackageVersion)' == 'true'">release</DotNetFinalVersionKind>
  </PropertyGroup>

specifically editing PreReleaseVersionLabel and PreReleaseVersionIteration.

When I build, I get

efcore/artifacts/packages/Debug/Shipping/Microsoft.EntityFrameworkCore.Tools.6.0.3-dev.nupkg

I would have expected Microsoft.EntityFrameworkCore.Tools.6.0.3-rollback.nupkg, not dev

How do I get Microsoft.EntityFrameworkCore.Tools.6.0.3-rollback.nupkg?

@hounddog22030 hounddog22030 changed the title Controlling version number (with a prelease) when building ef core Controlling version number (with a prerelease) when building Mar 1, 2022
@hounddog22030
Copy link
Author

Seems like the only way I can find to control this is from this as below?

  <PropertyGroup Label="Version settings">
    <MajorVersion>6</MajorVersion>
    <MinorVersion>0</MinorVersion>
    <PatchVersion>2</PatchVersion>
    <PreReleaseLabel>preview</PreReleaseLabel>
    <BuildNumber Condition="'$(BuildNumber)' == ''">$(CODEBUILD_BUILD_NUMBER)</BuildNumber>

    <VersionPrefix>$(MajorVersion).$(MinorVersion).$(PatchVersion)</VersionPrefix>
    <VersionSuffix>$(PreReleaseLabel)-$(BuildNumber)</VersionSuffix>

    <!-- Run the build with /p:IsFinalBuild=true to produce the product with 'final' branding and versioning -->
    <IsFinalBuild Condition=" '$(IsFinalBuild)' == '' ">false</IsFinalBuild>
    <IncludePreReleaseLabelInPackageVersion>true</IncludePreReleaseLabelInPackageVersion>
    <IncludePreReleaseLabelInPackageVersion Condition=" '$(IsFinalBuild)' == 'true' AND ('$(PreReleaseLabel)' == 'servicing' OR '$(PreReleaseLabel)' == 'rtm')">false</IncludePreReleaseLabelInPackageVersion>

    <!-- The version in files -->
    <PackageVersion>$(VersionPrefix)</PackageVersion>
    <PackageVersion Condition=" '$(IncludePreReleaseLabelInPackageVersion)' == 'true' ">$(VersionPrefix)-$(VersionSuffix)        
   </PackageVersion>
  </PropertyGroup>

@ajcvickers
Copy link
Member

@hounddog22030 This is not something I have tried to do. @dougbu @wtgodbe Any ideas here?

@hounddog22030
Copy link
Author

@hounddog22030 This is not something I have tried to do. @dougbu @wtgodbe Any ideas here?

Ok. If you've never tried doing it, maybe I'm barking up the wrong tree. Let me go back to my use case here:

I am:

  1. Trying to build the current 6.0 branch and add some debugging logging to diagnose something
  2. I am building the code off a branch in a fork in AWS CodeBuild and publishing the results to a NuGet repository
  3. Trying to use the resultant NuGet packages in our application to exercise the logging

Because I cannot overwrite in the NuGet repository, I want to be able to do iterative builds as I get closer to the issue. e.g. Microsoft.EntityFrameworkCore.Tools.6.0.4-rollback-18.nupkg, Microsoft.EntityFrameworkCore.Tools.6.0.4-rollback-19.nupkg, Microsoft.EntityFrameworkCore.Tools.6.0.4-rollback-20.nupkg

That's the tree I want to bark up.

What would be the best way, using the current versioning infrastructure in EF Core (arcade?) to do the above.

@dougbu
Copy link
Member

dougbu commented Mar 2, 2022

Local builds mostly ignore the prerelease settings in Eng/Versions.props. The way around it is to add a fake "official" build id to your build e.g. ./build.sh /p:OfficialBuildId=20220302.6. I normally update the identifier each time I need one of these odd builds to get unique package names.

@dougbu
Copy link
Member

dougbu commented Mar 2, 2022

A PowerShell script to create the build parameter:

$private:buildIdValue = [System.DateTime]::Now.ToString("yyyyMMdd.6")
$private:BuildId = "/p:OfficialBuildId=$buildIdValue"
Set-Clipboard -Value $BuildId
$BuildId

Update the .6 part of that if you need to do more than one unique build per day.

@ErikEJ
Copy link
Contributor

ErikEJ commented Mar 3, 2022

Something for the build docs?

@ajcvickers
Copy link
Member

@dougbu Thanks! I didn't know that trick.
@ErikEJ Good idea.

@ajcvickers ajcvickers self-assigned this Mar 4, 2022
@ajcvickers ajcvickers added this to the 7.0.0 milestone Mar 7, 2022
@ajcvickers ajcvickers modified the milestones: 7.0.0, MQ Jul 6, 2022
@ajcvickers ajcvickers added punted-for-7.0 Originally planned for the EF Core 7.0 (EF7) release, but moved out due to resource constraints. and removed propose-punt labels Jul 7, 2022
@ajcvickers ajcvickers modified the milestones: MQ, Backlog Oct 26, 2022
@ajcvickers ajcvickers modified the milestones: Backlog, 9.0.0 Dec 12, 2023
@ajcvickers ajcvickers added closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. and removed consider-for-current-release labels Dec 12, 2023
@ajcvickers ajcvickers modified the milestones: 9.0.0, 9.0.0-preview1 Jan 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-docs closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. customer-reported punted-for-7.0 Originally planned for the EF Core 7.0 (EF7) release, but moved out due to resource constraints. type-enhancement
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants