automotiveMastermind/condo

bug: the `ProductionReleaseBranchBuildQuality` does not work as expected when non-empty

Opened this issue · 0 comments

When setting the ProductionReleaseBranchBuildQuality to anything other than empty, the recommended release version does not increment appropriately. The release appears to be treated as a pre-release build despite the change log being generated and the build being tagged as 1.0.0 without the build quality appended to the release version.

Example setup:

export TEST_FOLDER=~/Desktop/release-example
mkdir -p $TEST_FOLDER
cd $TEST_FOLDER
git init
echo artifacts/ > .gitignore
git add .gitignore
git commit -m "initial"
git checkout -b prod

cat <<EOF > condo.build
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" 
  xmlns="http://schemas.microsoft.com/developer/msbuild/2003" InitialTargets="Clean;Initialize" DefaultTargets="Publish">
  <PropertyGroup>
    <Product>some-project</Product>
    <StartDateUtc>2018-11-30</StartDateUtc>

    <Company>automotiveMastermind</Company>
    <Authors>automotiveMastermind</Authors>

    <ProductionReleaseBranch>prod</ProductionReleaseBranch>
    <ProductionReleaseBranchBuildQuality>prod</ProductionReleaseBranchBuildQuality>
  </PropertyGroup>

  <Import Project="\$(CondoTargetsPath)\Lifecycle.targets" />
  <Import Project="\$(CondoTargetsPath)\Goals.targets" />
</Project>
EOF

git add condo.build
git commit -m "build: add condo build"
bash -c 'export CI=true && export CONDO_PUSH_COMMITS=false && condo'

Example versioning output:

PrintVersionInfo:
         Build Version      : 0.0.1-prod-00336
         Current Version    : 0.0.0
         Current Release    : 0.0.0
         Recommended Release: 0.0.1-prod
         Next Release       : 1.0.0
         File Version       : 0.0.00336.0436
         Build Quality      : prod
         Pre-Release Tag    : prod-00336
         Major Version      : 0
         Create Release     : True

Expected versioning output:

PrintVersionInfo:
         Build Version      : 1.0.0-prod
         Current Version    : 0.0.0
         Current Release    : 0.0.0
         Recommended Release: 1.0.0-prod
         Next Release       : 1.0.0-prod
         File Version       : 1.0.0.0436
         Build Quality      : prod
         Pre-Release Tag    : prod
         Major Version      : 1
         Create Release     : True