NuGet / Home

Repo for NuGet Client issues
Other
1.49k stars 250 forks source link

Cannot push packages and symbols at the same time and issues with --verbosity option #5446

Open CoskunSunali opened 7 years ago

CoskunSunali commented 7 years ago

I am intending to push both packages and symbols to separate feed sources at the same time based on the documentation and the arguments I see. Please let me know if this is a wrong approach in advance.

If I do not pass the "symbol related" parameters to the dotnet nuget push command, the command succeeds and pushes the packages and symbols to the "same feed" which is not the intended usage - at least for our case. The NuGet feed and symbols feed are separate feeds. (This usage also has its issues when the --no-symbols option is set and the issue is reported at https://github.com/NuGet/Home/issues/5442)

So the following works fine but pushes both type of packages.

& $dotnetExe nuget push "$packageDir\*.nupkg" --verbosity detailed --api-key $apiKey --source $packageFeed

If I do however pass the symbol related" parameters to the same command, I always get reported that some parameters are not valid.

The following results in an error:

& $dotnetExe nuget push "$packageDir\*.nupkg" --verbosity detailed --api-key $apiKey --source $packageFeed --symbol-api-key $apiKey --symbols-source $symbolFeed

Results as: error: Unrecognized option '--verbosity' where we know that --verbosity option exists for sure.

Considering that the above command gets mad at the --verbosity option, I remove it from the command and execute the command as below:

& $dotnetExe nuget push "$packageDir\*.nupkg" --api-key $apiKey --source $packageFeed --symbol-api-key $apiKey --symbols-source $symbolFeed

It results with the following error in this case:

error: Unrecognized option '--symbols-source'

If you try the following command to push the symbols in a separate command:

& $dotnetExe nuget push "$packageDir\*.symbols.nupkg" --verbosity detailed --api-key $apiKey --source $symbolFeed

It results with error: Unrecognized option '--verbosity'

If you try the following command to push the symbols in a separate command:

& $dotnetExe nuget push "$packageDir\*.symbols.nupkg" --verbosity detailed --symbol-api-key $apiKey --symbols-source $symbolFeed

It again results with error: Unrecognized option '--verbosity'

So if you try to push only the symbols, you always get an error saying that the --verbosity option does not exist.

Removing the --verbosity option and executing the following command:

& $dotnetExe nuget push "$packageDir\*.symbols.nupkg" --symbol-api-key $apiKey --symbols-source $symbolFeed

Results with error: Unrecognized option '--symbols-source'

Removing the --verbosity option and executing the following command works fine and pushes the symbols to the symbols feed.

& $dotnetExe nuget push "$packageDir\*.symbols.nupkg" --api-key $apiKey --source $symbolFeed

Finally, the commands expect the --no-symbols parameter before --verbosity parameter when both need to be used. Is that intentional?

The following fails with error: Unrecognized option '--verbosity':

& $dotnetExe nuget push "$packageDir\*.nupkg" --verbosity detailed --no-symbols --source $packageFeed --api-key $apiKey

The following works (just the order of parameters are changed):

& $dotnetExe nuget push "$packageDir\*.nupkg" --no-symbols --verbosity detailed --source $packageFeed --api-key $apiKey

Details about Problem

NuGet product used (NuGet.exe | VS UI | Package Manager Console | dotnet.exe):

dotnet.exe

dotnet.exe --version (if appropriate):

C:\WINDOWS\system32>dotnet --info
.NET Command Line Tools (2.0.0-preview1-005977)

Product Information:
 Version:            2.0.0-preview1-005977
 Commit SHA-1 hash:  414cab8a0b

Runtime Environment:
 OS Name:     Windows
 OS Version:  10.0.15063
 OS Platform: Windows
 RID:         win10-x64
 Base Path:   C:\Program Files\dotnet\sdk\2.0.0-preview1-005977\

Microsoft .NET Core Shared Framework Host

  Version  : 2.0.0-preview1-002111-00
  Build    : 1ff021936263d492539399688f46fd3827169983

Detailed repro steps so we can see the same problem

Commands to reproduce the issue are written above.

mishra14 commented 6 years ago

please try using dotnet nuget --verbosity detailed push ...

it seems that the verbosity is a switch on dotnet nuget

mishra14 commented 6 years ago

Keeping this open as the command seems to prefer the options in specific order, which should be fixed.

CoskunSunali commented 6 years ago

@mishra14 It seems that I have never replied to your comments, which was unintentional.

It has been a long time since I created the issue and found some workarounds which I currently cannot remember.

So issue is closed on my end but I am glad it helped you figure out something else that you need to fix (order of parameters).

Thank you for your assistance and replies.