Add allowPackageConflicts for npm publish #12482
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Adding the ability to allow package conflicts on publishing to npm build. This support the scenario where npm packages gets published from a larger build, where not every build updates the npm package. In this case, if the npm package version has not been updated, the npm package doesn't need to be published and the build can just continue.
The current behavior is that npm fails with a 403 Forbidden. "The feed already contains the package 'packageName' at version 'x.x.x'. This causes the build to be red, or when "continue on error" is set on the task, the build is yellow. We would like the build to be green, because there is no need to publish a new version.
We try here to mimic the behavior from the nuget publish task. When the allowPackageConflicts property is set on the task, this task completes successfully when the package version has already been published.
I was not able to build or test the project locally, because of an error during the build step (#11136), so I am hoping a build will run for this PR. If so I will update the PR based on the build results.