.NET Client - Releases.GetDeployments Ignores Skip Parameter

I am using the Releases.GetDeployments method which has an optional “skip” parameter. The method ignores any value passed in and will always use “0”.

string apiKey = ConfigurationManager.AppSettings["OctopusApiKey"];
var server = "http://myoctopusserver";
var endpoint = new OctopusServerEndpoint(server, apiKey);
var octoRepository = new OctopusRepository(endpoint);

List<ProjectResource> projectList = octoRepository.Projects.FindAll();

foreach (var project in projectList)
{
	int releasePageIndex = 0;
	ResourceCollection<ReleaseResource> releases = octoRepository.Projects.GetReleases(project, 0);

	while (releases.Items.Count > 0)
	{
		foreach (var release in releases.Items)
		{
			int deployPageIndex = 0;
			ResourceCollection<DeploymentResource> deployments = octoRepository.Releases.GetDeployments(release, 0);

			while (deployments.Items.Count > 0)
			{
				foreach (var deployment in deployments.Items)
				{
					//Do Something
				}

				deployPageIndex++;
				//This call will always return the first page and ignore the skip parameter.
				deployments = octoRepository.Releases.GetDeployments(release, (30 * deployPageIndex));
			}
		}
		releasePageIndex++;
		releases = octoRepository.Projects.GetReleases(project, (30 * releasePageIndex));
	}
}

Octopus Deploy 2.6.3.886
Octopus.Client.dll, v3.0.23.0

Hi Matthew,

It seems we have a bit of bug there. I apologize for that.
I have raised an issue to resolve this, so you can track it.

Just out of curiosity, is there a reason you are using version 3.0.23.0 of the client, with version 2.6.3.886 of the server? In general, client and server versions should stay in sync.

Regards,
Michael

I was unaware that the server / client version should be in sync. Makes sense now that I think about it. If I downloaded the Octopus.Client 2.6.3.886 would it solve the problem?

Unfortunately I don’t believe so.

But it’s still worth keeping client-server versions in sync, to avoid other issues.