grollmus/BuildNotifications

Improve TFS/DevOps Plugin

Closed this issue · 0 comments

Currently only the
BuildHttpClient.GetBuildsAsync
method is used to fetch all builds.

This method however is a bit tricky. If too many builds are present on the given server, builds of some definitions may be "swallowed".

This is due the fact, that the fetch method seems to operate something similar to this:

IEnumerable<Build> GetBuildsAsync(int top)
{
    return AllBuilds().Take(top);
}

IEnumerable<Build> AllBuilds() 
{
  foreach ( var definitionOnServer in allDefinitions) 
      {
         yield return AllBuildsOf(definitionOnServer);
      } 
}

So if the first definition has N = top many builds, all other definitions are not returned.
Even parameter like queryOrder are applied "after the AllBuilds()" method.

Specifying maxBuildsPerDefinition partially solves this problem as it limits the amount of builds per definition.

This is what this issue is for, to properly calculate a good value for the max builds per definition.
A sensible solution would be:
totalMax / (allBranchesCount * buildsToShowPerGroup)