cake-build / cake-build/cake

Nuget Provider Error Causes Cake to PseudoFail

Open
#3,838 2 comments 0 reactions 0 assignees View on GitHub
Waiting for issuer feedback
Dominant language
C#
Stars
4.2k
Forks
778
Avg merge
3h 37m
Merged PRs (30d)
21

Description

### Prerequisites

- [X] I have written a descriptive issue title
- [X] I have searched [issues](https://github.com/cake-build/cake/issues) to ensure it has not already been reported

### Cake runner

Cake Frosting

### Cake version

2.0.0

### Operating system

Windows

### Operating system architecture

64-Bit

### CI Server

Azure DevOps

### What are you seeing?

When the Nuget Manager sends a message to Standard Error about how it can't connect to a provider, this shows up at the very beginning of the Cake Run, before anything else
> ##[error][NuGet Manager] [Error] Problem starting the plugin 'C:\Users\VssAdministrator\.nuget\plugins\netcore\CredentialProvider.Microsoft\CredentialProvider.Microsoft.dll'. Plugin 'CredentialProvider.Microsoft' failed within 5.101 seconds with exit code -1.

The Cake task then ran to completion, but DevOps marked the task as a failure.

### What is expected?

I would expect that if something is going to cause the DevOps Task to fail, Cake would exit immediately.

My problem comes down to the fact that Cake did two things together which it should not do, in my opinion:
1. It let the error propagate to Azure DevOps in such a way that AzDO believed the Task failed.
2. It continued the Task.

The problem with doing these two things together is that things happen in the Cake task that, in my flow, _need_ to be followed by things outside of the Cake task. (Publishing symbols, specifically. I'm working on getting this into Cake, but it's not there yet.)

The things happening outside the Cake task shouldn't happen if the Cake task fails. So my dilemma is that I need Cake to either
- fail immediately if it's not going to return success to AzDO or
- return success to AzDO regardless of what error messages it gets, if it ran to successful completion.

Possibly whatever process Cake is using for Nuget Manager needs to have its error output redirected so AzDO doesn't freak out?

### Steps to Reproduce

Unfortunately, I am not sure how to reproduce this. The error itself (the NuGet Provider failing) isn't easily reproducible and is definitely not the fault of Cake.

### Output log

_No response_

Contributor guide

Open the contributing guide

Research direction

No source file, test, or reproducible entry point is named. Begin by investigating Cake Frosting's NuGet Manager and plugin startup under Cake 2.0.0 on Azure DevOps, then establish whether the provider's error output should affect task status and verify the chosen behavior with a regression test.

Written by the indexing model from the issue text.

Assessment

Tech stack
azure, csharp
Domain
build-system, ci-cd
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.