feat: Adding DetailsUrl to CheckRun (#2479)

This commit is contained in:
Chris Simpson
2022-07-14 17:04:13 +01:00
committed by GitHub
parent bfbc2ebbe1
commit fb68c67ff4
3 changed files with 15 additions and 5 deletions

View File

@@ -332,7 +332,7 @@ namespace Octokit.Tests.Integration.Clients
using (var repoContext = await _github.CreateRepositoryContext(new NewRepository(Helper.MakeNameWithTimestamp("public-repo")) { AutoInit = true }))
{
// Create a new feature branch
var headCommit = await _github.Repository.Commit.Get(repoContext.RepositoryId, "master");
var headCommit = await _github.Repository.Commit.Get(repoContext.RepositoryId, "main");
var featureBranch = await Helper.CreateFeatureBranch(repoContext.RepositoryOwner, repoContext.RepositoryName, headCommit.Sha, "my-feature");
// Create a check run for the feature branch
@@ -349,6 +349,7 @@ namespace Octokit.Tests.Integration.Clients
Assert.Equal(featureBranch.Object.Sha, checkRun.HeadSha);
Assert.Equal("name", checkRun.Name);
Assert.Equal(CheckStatus.InProgress, checkRun.Status);
Assert.Equal(created.DetailsUrl, checkRun.DetailsUrl);
}
}
@@ -358,7 +359,7 @@ namespace Octokit.Tests.Integration.Clients
using (var repoContext = await _github.CreateRepositoryContext(new NewRepository(Helper.MakeNameWithTimestamp("public-repo")) { AutoInit = true }))
{
// Create a new feature branch
var headCommit = await _github.Repository.Commit.Get(repoContext.RepositoryId, "master");
var headCommit = await _github.Repository.Commit.Get(repoContext.RepositoryId, "main");
var featureBranch = await Helper.CreateFeatureBranch(repoContext.RepositoryOwner, repoContext.RepositoryName, headCommit.Sha, "my-feature");
// Create a check run for the feature branch
@@ -375,6 +376,7 @@ namespace Octokit.Tests.Integration.Clients
Assert.Equal(featureBranch.Object.Sha, checkRun.HeadSha);
Assert.Equal("name", checkRun.Name);
Assert.Equal(CheckStatus.InProgress, checkRun.Status);
Assert.Equal(created.DetailsUrl, checkRun.DetailsUrl);
}
}
}

View File

@@ -333,7 +333,7 @@ namespace Octokit.Tests.Integration.Reactive
using (var repoContext = await _github.CreateRepositoryContext(new NewRepository(Helper.MakeNameWithTimestamp("public-repo")) { AutoInit = true }))
{
// Create a new feature branch
var headCommit = await _github.Repository.Commit.Get(repoContext.RepositoryId, "master");
var headCommit = await _github.Repository.Commit.Get(repoContext.RepositoryId, "main");
var featureBranch = await Helper.CreateFeatureBranch(repoContext.RepositoryOwner, repoContext.RepositoryName, headCommit.Sha, "my-feature");
// Create a check run for the feature branch
@@ -350,6 +350,7 @@ namespace Octokit.Tests.Integration.Reactive
Assert.Equal(featureBranch.Object.Sha, checkRun.HeadSha);
Assert.Equal("name", checkRun.Name);
Assert.Equal(CheckStatus.InProgress, checkRun.Status);
Assert.Equal(created.DetailsUrl, checkRun.DetailsUrl);
}
}
@@ -359,7 +360,7 @@ namespace Octokit.Tests.Integration.Reactive
using (var repoContext = await _github.CreateRepositoryContext(new NewRepository(Helper.MakeNameWithTimestamp("public-repo")) { AutoInit = true }))
{
// Create a new feature branch
var headCommit = await _github.Repository.Commit.Get(repoContext.RepositoryId, "master");
var headCommit = await _github.Repository.Commit.Get(repoContext.RepositoryId, "main");
var featureBranch = await Helper.CreateFeatureBranch(repoContext.RepositoryOwner, repoContext.RepositoryName, headCommit.Sha, "my-feature");
// Create a check run for the feature branch
@@ -376,6 +377,7 @@ namespace Octokit.Tests.Integration.Reactive
Assert.Equal(featureBranch.Object.Sha, checkRun.HeadSha);
Assert.Equal("name", checkRun.Name);
Assert.Equal(CheckStatus.InProgress, checkRun.Status);
Assert.Equal(created.DetailsUrl, checkRun.DetailsUrl);
}
}
}

View File

@@ -12,13 +12,14 @@ namespace Octokit
{
}
public CheckRun(long id, string headSha, string externalId, string url, string htmlUrl, CheckStatus status, CheckConclusion? conclusion, DateTimeOffset startedAt, DateTimeOffset? completedAt, CheckRunOutputResponse output, string name, CheckSuite checkSuite, GitHubApp app, IReadOnlyList<PullRequest> pullRequests)
public CheckRun(long id, string headSha, string externalId, string url, string htmlUrl, string detailsUrl, CheckStatus status, CheckConclusion? conclusion, DateTimeOffset startedAt, DateTimeOffset? completedAt, CheckRunOutputResponse output, string name, CheckSuite checkSuite, GitHubApp app, IReadOnlyList<PullRequest> pullRequests)
{
Id = id;
HeadSha = headSha;
ExternalId = externalId;
Url = url;
HtmlUrl = htmlUrl;
DetailsUrl = detailsUrl;
Status = status;
Conclusion = conclusion;
StartedAt = startedAt;
@@ -55,6 +56,11 @@ namespace Octokit
/// </summary>
public string HtmlUrl { get; protected set; }
/// <summary>
/// The URL of the integrator's site that has the full details of the check.
/// </summary>
public string DetailsUrl { get; protected set; }
/// <summary>
/// The check run status
/// </summary>