Some background information to our actual situation. We are migrating from TFS VC to git. We've a ASP .NET Web API with many different Controller Libraries (>30 assemblies). Many of them are referencing some Core assemblies like our data model. In TFS VC those Core Assemblies where checked in relative to our projects in a binary folder. Not a best practice anyhow...
As we are moving to git we want to clean up this fault. Our idea is to share the Core assemblies as nuget package on a local Azure Dev Ops feed. We want to use git-flow workflow with branches: master, development and features/
Example
CoreAssemblyA.csproj
published to nuget feed with version1.2
ConsumerB.csproj
- consuming CoreAssemlyA as a nuget package (current version1.2
).ConsumerC.csproj
consuming CoreAssemblyA as a nuget package (current version1.2
).
Nuget package is packed and published during CI build and release pipeline within our AzureDevOps server after a pull request / merge commit.
Now there are two feature requests for ConsumerB and ConsumerC, handled by two independent developers, each require to change/extend the CoreAssemblyA.
- Developer A: Starting with a feature branch: features/feature1. Extending code of CoreAssemblyA (eg. add properties to a class), change version to the next higher (starting from
1.2 => 1.3
), start a pull request to development branch - Developer B: Starting at the same time with a feature branch: features/feature2. Extending code of CoreAssemblyA (eg. add properties to another class), change version to the next higher (starting from
1.2 => 1.3
), start a pull request to development branch
Questions / ideas:
How to get rid of the version conflict they are running into? The second pull request and CI Build with a nuget push build task will fail with a "version already exists on feed"-error.
Another idea I thought about was to apply prerelease tags to the published nuget package. But if I reference CoreAssemblyA as a PackageReference with version:
1.3-*
I'll get the version that is pushed last (either from developer A (feature1) or developer B (feature2)). To refernce the correct version in each feature branch the concrete prerelease version could be referenced in consuming csproj, but when and how to "cleanup" this version to get a non prerelease version into development during the pull request / merge commit?A local package source or changing the .dll in nuget package folder seems to be a huge manual copy / paste overhead to me.
Maybe one can point me to the right direction.