Skip to content

Azure DevOps "Project not found" error status is cleared immediately, so a mistyped or deleted project never shows as an error #304

Description

@matt-edmondson

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingreadyFully specified; implement as written

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions