Skip to content

Azure DevOps organizations with more than 100 projects: projects past the first page are never discovered, and adding one manually reports "Project not found" #321

Open

Description

@matt-edmondson

What's wrong

Both Azure DevOps project lookups call ProjectClient.GetProjects() with no top and no continuation token:

  • discovery: BuildMonitor/Providers/AzureDevOps.cs ~line 166
  • per-owner repository update: ~line 209

The Projects – List API returns one page, 100 projects by default. The client returns an IPagedList<TeamProjectReference> whose ContinuationToken points to the next page. That token is never read.

Failure scenario

In an organization with 150 projects:

  • "Discover All Projects" adds only the first 100.
  • A project past the first page that is added manually as an owner goes through UpdateRepositoriesAsync. It isn't in the first page, so the lookup hits the "not found" path and the owner shows as an error, though the project exists.

The per-owner path also lists all projects once per owner on every provider refresh (N owners × full list) just to find one project by name.

Suggested fix

  • Discovery: loop GetProjects(continuationToken: token) until the returned list's ContinuationToken is null.
  • UpdateRepositoriesAsync: call ProjectClient.GetProject(owner.Name) directly. It accepts a name or ID, fixes the paging bug for this path, and removes the N×list cost. Map a ProjectDoesNotExistWithNameException (or 404) to the existing "not found" handling.

Acceptance criteria

  • Discovery returns every project in an organization with more than 100 projects.
  • A manually added owner naming a project past the first page resolves and polls normally.

Activity

  1. added
    bug
    on Sep 29, 2026
  2. matt-edmondson commented on Sep 29, 2026

    @matt-edmondson
    ContributorAuthor

    Triage

    • Category: Bug (API paging is not followed)
    • Priority: Medium. Only organizations with more than 100 projects are affected, but for them discovery is silently incomplete and valid owners show as errors. Switching to GetProject(name) also removes the N×full-list cost on every refresh.
    • Area / suggested assignment: BuildMonitor/Providers/AzureDevOps.cs (discovery ~L166 and UpdateRepositoriesAsync ~L209).
    • Duplicates: none. It is related to Azure DevOps "Project not found" error status is cleared immediately, so a mistyped or deleted project never shows as an error #304 ("Project not found" status cleared immediately). Both touch the not-found path in UpdateRepositoriesAsync, so fixing them together avoids conflicts.
    • In progress: no. There are no open PRs in this repo.

    Generated by Claude Code

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

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions