3

I've finished reading the book Pro Nuget, and I think making use of it for our dependencies would be better than our current method. Also, you can build application deployment packages to deploy your build to various environments, something we are also looking to better automate.

One of the ideas is to have several Nuget feeds; a ci feed where every successful integration publishes a package, a qa feed that you only publish versions you want qa to test and then a release feed, where you copy only packages from the qa feed that they successfully tested.

I like this idea but the recommendation is for ci builds to be marked as prerelease by ending the version in -alphaXXXX or similar. If I do that though, I need to get that designation removed during the promotion to the qa feed. I think you'd have to modify the package to do that however part of the appeal of Nuget packages is that once built you don't change them

Another idea is that since we mostly work in trunk, when I make the rc branch our build process would stop adding the prerelease part of the version. That seems like it would work, and then promoting from qa to release feed would be a simple package copy.

Is anyone is doing this approach and is it the recommended approach? Am I missing anything? I have googled but nit found much discussion on the details of such an approach.

Andy
  • 8,432
  • 6
  • 38
  • 76

1 Answers1

3

I'm one of the authors of the book, so I hope you liked it! We're working on a second edition with lots of new content, and this particular case is being tackled as well.

Just to clarify, the CI --> QA --> PROD scenario is set as an example package promotion flow: you can create your own if you like.

You point is correct: package promotion should not require any modifications to the package nor its contents. This effectively means there's not even a rebuild of the binaries inside of your package when promoting it to another feed. The only exception to this rule is the package prerelease version, which can be adjusted or removed. Note: the semantic version should stay the same when promoting!

This is a core feature of http://www.MyGet.org: here's the documentation for it http://docs.myget.org/docs/reference/package-sources (scenario: pushing package upstream).

The above principles are applied in this feature, and we also take care of feed security/api keys. If you do not use MyGet, then you'll need to do this for yourself. The logical steps are:

  1. download the package from the source feed
  2. optionally change the prerelease tag (manually?)
  3. push the package to the target feed

Many open source projects are using this scenario, using a CI feed on MyGet.org and then pushing upstream to NuGet.org. The upstream package source can be any other NuGet feed (e.g. Chocolatey.org gallery, Resharper plug-in gallery, another MyGet.org feed, ...).

Xavier Decoster
  • 14,580
  • 5
  • 35
  • 46
  • I enjoyed the book greatly, its given me a lot of ideas I hope to experiment with to improve our current processes. I understand the ci to qa to release is an example but I think it would work well for us. As a follow up question, suppose my app I'm prompting to qa depends on another package containing the business logic layer which always ships the same time as the app. I assume I'd have to recursively promote the apps dependencies (the ones we also build, we don't use beta 3rd party libs). I look forward to the 2nd edition! – Andy Jul 18 '13 at 23:39
  • 1
    Great! Yes indeed, you'll need to promote the package's dependencies as well if you release them together. – Xavier Decoster Jul 18 '13 at 23:40
  • @XavierDecoster can you clarify how #2 works? I am trying to setup this flow in VSTS, not MyGet. Are there supported commands for removing the prerelease tag from the package, or do I have to unzip the package, modify the nuspec file, and repack? Seems like there should be a built in nuget command for this. – Christopher Haws Apr 27 '17 at 18:03
  • @ChristopherHaws This is a MyGet-only feature and there's no out-of-the-box support for this in either nuget or vsts. – Xavier Decoster Apr 28 '17 at 19:50
  • Eight years later, and i'm having a very similar issue: https://stackoverflow.com/q/69575803/556078 – Max Cascone Oct 14 '21 at 18:41