mirror of
https://github.com/zoriya/octokit.net.git
synced 2025-12-06 07:16:09 +00:00
[Fix] Fixes an issue where the runner application response deserialization would fail
This commit is contained in:
@@ -133,7 +133,7 @@ namespace Octokit.Tests.Clients
|
||||
|
||||
await client.ListAllRunnerApplicationsForEnterprise("fake");
|
||||
|
||||
connection.Received().GetAll<IReadOnlyList<RunnerApplication>>(
|
||||
connection.Received().GetAll<RunnerApplication>(
|
||||
Arg.Is<Uri>(u => u.ToString() == "enterprises/fake/actions/runners/downloads"), Args.ApiOptions);
|
||||
|
||||
}
|
||||
@@ -167,7 +167,7 @@ namespace Octokit.Tests.Clients
|
||||
|
||||
await client.ListAllRunnerApplicationsForOrganization("fake");
|
||||
|
||||
connection.Received().GetAll<IReadOnlyList<RunnerApplication>>(
|
||||
connection.Received().GetAll<RunnerApplication>(
|
||||
Arg.Is<Uri>(u => u.ToString() == "orgs/fake/actions/runners/downloads"), Args.ApiOptions);
|
||||
|
||||
}
|
||||
@@ -201,7 +201,7 @@ namespace Octokit.Tests.Clients
|
||||
|
||||
await client.ListAllRunnerApplicationsForRepository("fake", "repo");
|
||||
|
||||
connection.Received().GetAll<IReadOnlyList<RunnerApplication>>(
|
||||
connection.Received().GetAll<RunnerApplication>(
|
||||
Arg.Is<Uri>(u => u.ToString() == "repos/fake/repo/actions/runners/downloads"), Args.ApiOptions);
|
||||
|
||||
}
|
||||
|
||||
@@ -153,9 +153,7 @@ namespace Octokit
|
||||
{
|
||||
Ensure.ArgumentNotNullOrEmptyString(enterprise, nameof(enterprise));
|
||||
|
||||
var results = await ApiConnection.GetAll<IReadOnlyList<RunnerApplication>>(ApiUrls.ActionsListRunnerApplicationsForEnterprise(enterprise), options).ConfigureAwait(false);
|
||||
|
||||
return results.SelectMany(x => x).ToList();
|
||||
return await ApiConnection.GetAll<RunnerApplication>(ApiUrls.ActionsListRunnerApplicationsForEnterprise(enterprise), options).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -184,9 +182,7 @@ namespace Octokit
|
||||
{
|
||||
Ensure.ArgumentNotNullOrEmptyString(organization, nameof(organization));
|
||||
|
||||
var results = await ApiConnection.GetAll<IReadOnlyList<RunnerApplication>>(ApiUrls.ActionsListRunnerApplicationsForOrganization(organization), options).ConfigureAwait(false);
|
||||
|
||||
return results.SelectMany(x => x).ToList();
|
||||
return await ApiConnection.GetAll<RunnerApplication>(ApiUrls.ActionsListRunnerApplicationsForOrganization(organization), options).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -219,9 +215,7 @@ namespace Octokit
|
||||
Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner));
|
||||
Ensure.ArgumentNotNullOrEmptyString(repo, nameof(repo));
|
||||
|
||||
var results = await ApiConnection.GetAll<IReadOnlyList<RunnerApplication>>(ApiUrls.ActionsListRunnerApplicationsForRepository(owner, repo), options).ConfigureAwait(false);
|
||||
|
||||
return results.SelectMany(x => x).ToList();
|
||||
return await ApiConnection.GetAll<RunnerApplication>(ApiUrls.ActionsListRunnerApplicationsForRepository(owner, repo), options).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -15,7 +15,7 @@ namespace Octokit
|
||||
Id = id;
|
||||
}
|
||||
|
||||
public Runner(long id, string name, string os, string status, bool busy, List<Label> labels)
|
||||
public Runner(long id, string name, string os, string status, bool busy, List<RunnerLabel> labels)
|
||||
{
|
||||
Id = id;
|
||||
Name = name;
|
||||
@@ -30,7 +30,7 @@ namespace Octokit
|
||||
public string Os { get; private set; }
|
||||
public string Status { get; private set; }
|
||||
public bool Busy { get; private set; }
|
||||
public IReadOnlyList<Label> Labels { get; private set; }
|
||||
public IReadOnlyList<RunnerLabel> Labels { get; private set; }
|
||||
|
||||
internal string DebuggerDisplay
|
||||
{
|
||||
|
||||
@@ -8,25 +8,27 @@ namespace Octokit
|
||||
{
|
||||
public RunnerApplication() { }
|
||||
|
||||
public RunnerApplication(string os, string architecture, string downloadUrl, string fileName)
|
||||
public RunnerApplication(string os, string architecture, string downloadUrl, string filename, string tempDownloadToken)
|
||||
{
|
||||
Os = os;
|
||||
Architecture = architecture;
|
||||
DownloadUrl = downloadUrl;
|
||||
FileName = fileName;
|
||||
Filename = filename;
|
||||
TempDownloadToken = tempDownloadToken;
|
||||
}
|
||||
|
||||
public string Os { get; private set; }
|
||||
public string Architecture { get; private set; }
|
||||
public string DownloadUrl { get; private set; }
|
||||
public string FileName { get; private set; }
|
||||
public string Filename { get; private set; }
|
||||
public string TempDownloadToken { get; private set; }
|
||||
|
||||
internal string DebuggerDisplay
|
||||
{
|
||||
get
|
||||
{
|
||||
return string.Format("Os: {0}; Architecture: {1}; DownloadUrl: {2}; FileName: {3};",
|
||||
Os, Architecture, DownloadUrl, FileName);
|
||||
return string.Format("Os: {0}; Architecture: {1}; DownloadUrl: {2}; Filename: {3}; TempDownloadToken: {4}",
|
||||
Os, Architecture, DownloadUrl, Filename, TempDownloadToken);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
27
Octokit/Models/Response/RunnerLabel.cs
Normal file
27
Octokit/Models/Response/RunnerLabel.cs
Normal file
@@ -0,0 +1,27 @@
|
||||
using System.Diagnostics;
|
||||
using System.Globalization;
|
||||
|
||||
namespace Octokit
|
||||
{
|
||||
[DebuggerDisplay("{DebuggerDisplay,nq}")]
|
||||
public class RunnerLabel
|
||||
{
|
||||
public RunnerLabel() { }
|
||||
|
||||
public RunnerLabel(long id, string name, string type)
|
||||
{
|
||||
Id = id;
|
||||
Name = name;
|
||||
Type = type;
|
||||
}
|
||||
|
||||
public long Id { get; private set; }
|
||||
public string Name { get; private set; }
|
||||
public string Type { get; private set; }
|
||||
|
||||
internal string DebuggerDisplay
|
||||
{
|
||||
get { return string.Format(CultureInfo.InvariantCulture, "Id: {0}; Name: {1}; Type: {2};", Id, Name, Type); }
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user