Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add CreatedAt to WorkflowJob model #2729

Merged
merged 3 commits into from
Jun 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Octokit.Tests/Models/WorkflowJobTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ public void CanBeDeserialized()
""html_url"": ""https://github.com/octo-org/octo-repo/runs/399444496"",
""status"": ""completed"",
""conclusion"": ""success"",
""created_at"": ""2020-01-20T17:42:40Z"",
""started_at"": ""2020-01-20T17:42:40Z"",
""completed_at"": ""2020-01-20T17:44:39Z"",
""name"": ""build"",
Expand Down Expand Up @@ -129,6 +130,7 @@ public void CanBeDeserialized()
Assert.Equal("https://github.com/octo-org/octo-repo/runs/399444496", payload.HtmlUrl);
Assert.Equal(WorkflowJobStatus.Completed, payload.Status);
Assert.Equal(WorkflowJobConclusion.Success, payload.Conclusion);
Assert.Equal(new DateTimeOffset(2020, 01, 20, 17, 42, 40, TimeSpan.Zero), payload.CreatedAt);
Assert.Equal(new DateTimeOffset(2020, 01, 20, 17, 42, 40, TimeSpan.Zero), payload.StartedAt);
Assert.Equal(new DateTimeOffset(2020, 01, 20, 17, 44, 39, TimeSpan.Zero), payload.CompletedAt);
Assert.Equal("build", payload.Name);
Expand Down
8 changes: 7 additions & 1 deletion Octokit/Models/Response/WorkflowJob.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ public class WorkflowJob
{
public WorkflowJob() { }

public WorkflowJob(long id, long runId, string runUrl, string nodeId, string headSha, string url, string htmlUrl, WorkflowJobStatus status, WorkflowJobConclusion? conclusion, DateTimeOffset startedAt, DateTimeOffset? completedAt, string name, IReadOnlyList<WorkflowJobStep> steps, string checkRunUrl, IReadOnlyList<string> labels, long? runnerId = default, string runnerName = default, long? runnerGroupId = default, string runnerGroupName = default)
public WorkflowJob(long id, long runId, string runUrl, string nodeId, string headSha, string url, string htmlUrl, WorkflowJobStatus status, WorkflowJobConclusion? conclusion, DateTimeOffset createdAt, DateTimeOffset startedAt, DateTimeOffset? completedAt, string name, IReadOnlyList<WorkflowJobStep> steps, string checkRunUrl, IReadOnlyList<string> labels, long? runnerId = default, string runnerName = default, long? runnerGroupId = default, string runnerGroupName = default)
{
Id = id;
RunId = runId;
Expand All @@ -21,6 +21,7 @@ public WorkflowJob(long id, long runId, string runUrl, string nodeId, string hea
HtmlUrl = htmlUrl;
Status = status;
Conclusion = conclusion;
CreatedAt = createdAt;
StartedAt = startedAt;
CompletedAt = completedAt;
Name = name;
Expand Down Expand Up @@ -78,6 +79,11 @@ public WorkflowJob(long id, long runId, string runUrl, string nodeId, string hea
/// </summary>
public StringEnum<WorkflowJobConclusion>? Conclusion { get; private set; }

/// <summary>
/// The time that the job was created.
/// </summary>
public DateTimeOffset CreatedAt { get; private set; }

/// <summary>
/// The time that the job started.
/// </summary>
Expand Down