From d58be9e2da19230b461544298cb34cca940fecf3 Mon Sep 17 00:00:00 2001 From: Liam Neville Date: Thu, 8 Jun 2023 18:33:23 -0700 Subject: [PATCH 1/2] make some fields nullable on workflowjob --- Octokit/Models/Response/WorkflowJob.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Octokit/Models/Response/WorkflowJob.cs b/Octokit/Models/Response/WorkflowJob.cs index 34f9213a24..d485d425fc 100644 --- a/Octokit/Models/Response/WorkflowJob.cs +++ b/Octokit/Models/Response/WorkflowJob.cs @@ -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 steps, string checkRunUrl, IReadOnlyList labels, long runnerId, string runnerName, long runnerGroupId, string runnerGroupName) + 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 steps, string checkRunUrl, IReadOnlyList labels, long? runnerId = default, string runnerName = default, long? runnerGroupId = default, string runnerGroupName = default) { Id = id; RunId = runId; @@ -111,7 +111,7 @@ public WorkflowJob(long id, long runId, string runUrl, string nodeId, string hea /// /// The Id of the runner to which this job has been assigned. /// - public long RunnerId { get; private set; } + public long? RunnerId { get; private set; } /// /// The name of the runner to which this job has been assigned. @@ -121,7 +121,7 @@ public WorkflowJob(long id, long runId, string runUrl, string nodeId, string hea /// /// The Id of the runner group to which this job has been assigned. /// - public long RunnerGroupId { get; private set; } + public long? RunnerGroupId { get; private set; } /// /// The name of the runner group to which this job has been assigned. From f76117f84a70267057aec53c31858f70445ede0d Mon Sep 17 00:00:00 2001 From: Liam Neville Date: Mon, 26 Jun 2023 13:45:51 -0700 Subject: [PATCH 2/2] add CreatedAt to WorkflowJob model --- Octokit.Tests/Models/WorkflowJobTests.cs | 2 ++ Octokit/Models/Response/WorkflowJob.cs | 8 +++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/Octokit.Tests/Models/WorkflowJobTests.cs b/Octokit.Tests/Models/WorkflowJobTests.cs index 16a8901c43..e16fe58e45 100644 --- a/Octokit.Tests/Models/WorkflowJobTests.cs +++ b/Octokit.Tests/Models/WorkflowJobTests.cs @@ -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"", @@ -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); diff --git a/Octokit/Models/Response/WorkflowJob.cs b/Octokit/Models/Response/WorkflowJob.cs index d485d425fc..d326483bba 100644 --- a/Octokit/Models/Response/WorkflowJob.cs +++ b/Octokit/Models/Response/WorkflowJob.cs @@ -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 steps, string checkRunUrl, IReadOnlyList 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 steps, string checkRunUrl, IReadOnlyList labels, long? runnerId = default, string runnerName = default, long? runnerGroupId = default, string runnerGroupName = default) { Id = id; RunId = runId; @@ -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; @@ -78,6 +79,11 @@ public WorkflowJob(long id, long runId, string runUrl, string nodeId, string hea /// public StringEnum? Conclusion { get; private set; } + /// + /// The time that the job was created. + /// + public DateTimeOffset CreatedAt { get; private set; } + /// /// The time that the job started. ///