What's wrong
In BuildMonitor/Providers/AzureDevOps.cs, UpdateRepositoriesAsync does its work inside the lambda it passes to MakeAzureDevOpsRequestAsync. When no project matches the owner, the lambda calls:
SetStatus(ProviderStatus.Error, $"Project '{owner.Name}' not found in organization '{AccountId}'");
and then returns normally. MakeAzureDevOpsRequestAsync then runs:
await BuildMonitor.MakeRequestAsync(name, action).ConfigureAwait(false);
ClearStatus();
ClearStatus() resets the provider to OK straight away, so the error never reaches the status bar.
Failure scenario
The user adds an Azure DevOps owner with a typo in the project name, or a project is renamed or deleted. BuildMonitor keeps showing the provider as OK and lists no builds for that owner. The only trace is a Log.Warning line.
Reproduced in a scratch test: an action passed to MakeAzureDevOpsRequestAsync sets ProviderStatus.Error through SetStatus. After the call returns, the provider is OK with an empty message.
Suggested fix
Two options:
- Capture
foundProject from the lambda, and call SetStatus(Error, ...) after MakeAzureDevOpsRequestAsync returns.
- Have
MakeAzureDevOpsRequestAsync call ClearStatus() only when the action didn't set an error itself, for example by recording the status before the call and comparing it afterwards.
Acceptance criteria
- With an owner that matches no project,
UpdateRepositoriesAsync leaves the provider in ProviderStatus.Error with the "not found" message.
- A later successful request still clears it.
What's wrong
In
BuildMonitor/Providers/AzureDevOps.cs,UpdateRepositoriesAsyncdoes its work inside the lambda it passes toMakeAzureDevOpsRequestAsync. When no project matches the owner, the lambda calls:and then returns normally.
MakeAzureDevOpsRequestAsyncthen runs:ClearStatus()resets the provider to OK straight away, so the error never reaches the status bar.Failure scenario
The user adds an Azure DevOps owner with a typo in the project name, or a project is renamed or deleted. BuildMonitor keeps showing the provider as OK and lists no builds for that owner. The only trace is a
Log.Warningline.Reproduced in a scratch test: an action passed to
MakeAzureDevOpsRequestAsyncsetsProviderStatus.ErrorthroughSetStatus. After the call returns, the provider isOKwith an empty message.Suggested fix
Two options:
foundProjectfrom the lambda, and callSetStatus(Error, ...)afterMakeAzureDevOpsRequestAsyncreturns.MakeAzureDevOpsRequestAsynccallClearStatus()only when the action didn't set an error itself, for example by recording the status before the call and comparing it afterwards.Acceptance criteria
UpdateRepositoriesAsyncleaves the provider inProviderStatus.Errorwith the "not found" message.