2

Using GitVersion mainline mode we are ensuring each commit produces a new version number. However there are some scenarios where a repeat build with the same version number is necessary.

One example is when a PR has a successful build policy requirement, but the build has expired.

With the NuGet task, we can use the option to skip duplicates and avoid trying to publish the same package version to our Azure Artifacts feed (resulting in a 409 conflict).

There doesn't seem to be an easy way to achieve the same with the npm task/client. How should this be handled?

Brett Postin
  • 11,215
  • 10
  • 60
  • 95

1 Answers1

0

It seems that you want publish the npm package with same version number and don't want to get a 409 conflict error,like checking the Allow duplicates to be skipped option in the nuget task, right?

At present, from the query results: In order to publish the package again, a new version number must be used. You can refer to this [document]1 and case.

We can make it clear that the same version of the package cannot be published to the feed. This can be known from the official document:

Once you publish a particular version of a package to a feed, that version number is permanently reserved. You cannot upload a newer revision package with that same version number, or delete it and upload a new package at the same version.

Hugh Lin
  • 17,829
  • 2
  • 21
  • 25
  • That's correct and I understand why it needs to be immutable, however there are cases like the one i've given where a repeat build is necessary (e.g. expired pr build). We are working around it by switching off build expiry but it would be better to handle npm like nuget by skipping duplicates so we can have successful build validation. – Brett Postin Nov 01 '19 at 13:16