Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Option for skip duplicate #97

Open
jasonycw opened this issue Aug 31, 2020 · 5 comments
Open

Option for skip duplicate #97

jasonycw opened this issue Aug 31, 2020 · 5 comments

Comments

@jasonycw
Copy link

Currently with dotnet nuget push and nuget push there is an option to skip duplicate

image
image

With gpr push, if duplicate package is found, there will be an error with non-zero exit code.

[ThePackage.1.5.14.nupkg]: Repository url: https://github.com/OWNER/ThePackage. Version: 1.5.14. Size: 39625 bytes.
[ThePackage.1.5.14.nupkg]: Uploading package.
[ThePackage.1.5.14.nupkg]: Error: Version 1.5.14 of "ThePackage" has already been pushed.

This cause docker to fail and exit.

It would be nice if there is an option like dotnet and nuget CLI to skip duplicate or make this as warning instead of an error with non-zero exit code
e.g.

gpr push --api-key $GITHUB_ACCESS_TOKEN "ThePackage.1.5.14.nupkg" --skip-duplicate
@phnx47
Copy link

phnx47 commented Sep 9, 2020

Workaround in ubuntu:

gpr push --api-key $GITHUB_ACCESS_TOKEN "ThePackage.1.5.14.nupkg" || true

@MoazAlkharfan
Copy link

Would this workaround work if multiple packages are being pushed?
Ex:
gpr push -k ${{secrets.GITHUB_TOKEN}} ./output/*.nupkg || true

@ghost
Copy link

ghost commented Sep 25, 2020

This would also be handy when <IncludeSymbols>true</IncludeSymbols> is defined in packed projects as the default symbols.nupkg results in duplicate package errors on gpr push (whereas dotnet nuget push can skip dup). Changing to <SymbolPackageFormat>snupkg</SymbolPackageFormat> also works around.

@bbourdrez
Copy link

That workaround is not a good idea, if your push fails you don't get to see that. It's the most crucial step of any package deployment, and you're throwing away the information on whether it succeeded or not. If your connection goes down and the package never makes it to the server, you won't know.
Implementing a ignore-duplicate mechanism like is done in dotnet and nuget is the preferable solution, IMO.

@bbourdrez
Copy link

#115

This works on my end, will try to roll it into some of our pipelines to stress-test it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants