You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When calling NuGetSetApiKey with NuGetSetApiKeySettings where Verbosity is set to NuGetVerbosity.Quiet, I get an error message for the task and the script exits.
The error message say:
"SetApiKey returned unexpected response"
What is Expected?
That the call should not throw an exception.
What version of Cake are you using?
Tested with multiple versions of Cake (0.30.0, 0.34.x, 0.36.0 and 0.37.0) and Cake.Tool 0.36.0 and 0.37.0
Also tested with older versions of NuGet.CommandLine as tool in the script.
Are you running on a 32 or 64 bit system?
64 bit
What environment are you running on? Windows? Linux? Mac?
Windows 10
Are you running on a CI Server? If so, which one?
No, local build, but I'm pretty sure I can reproduce on the CI server also
How Did You Get This To Happen? (Steps to Reproduce)
build.cake.txt
To reproduce with the attached build.cake script:
dotnet cake -Target="Quiet"
To test with Verbosity.Normal (the working one):
dotnet cake -Target="Normal"
The issue seems to be here in the code.
As when you set verbosity to Quiet, the variable "output" is empty, making the first part of the if condition true.
I am not sure if the original plan was to thrown an exception if "output" was empty or not.
@escarls you're right. It looks to me like the whole block is redundant, since any failure should be reflected in the process exit code, and brittle, since it expects output and it must conform to a particular shape.
In fact, the process wrapper should redact the api key in the output anyway, so intercepting the output itself seems redundant too, unless I'm missing something.
FWIW, NuGetSetProxy also checks the process output, expecting it to be effectively blank in this case, but probably doesn't need to.
What You Are Seeing?
When calling NuGetSetApiKey with NuGetSetApiKeySettings where Verbosity is set to NuGetVerbosity.Quiet, I get an error message for the task and the script exits.
The error message say:
"SetApiKey returned unexpected response"
What is Expected?
That the call should not throw an exception.
What version of Cake are you using?
Tested with multiple versions of Cake (0.30.0, 0.34.x, 0.36.0 and 0.37.0) and Cake.Tool 0.36.0 and 0.37.0
Also tested with older versions of NuGet.CommandLine as tool in the script.
Are you running on a 32 or 64 bit system?
64 bit
What environment are you running on? Windows? Linux? Mac?
Windows 10
Are you running on a CI Server? If so, which one?
No, local build, but I'm pretty sure I can reproduce on the CI server also
How Did You Get This To Happen? (Steps to Reproduce)
build.cake.txt
To reproduce with the attached build.cake script:
dotnet cake -Target="Quiet"
To test with Verbosity.Normal (the working one):
dotnet cake -Target="Normal"
Output Log
error.log
The text was updated successfully, but these errors were encountered: