From 16bca2304306d80f465af4b29b814f3d4c7d2486 Mon Sep 17 00:00:00 2001 From: mchanyeechoy <96125017+mchanyeechoy@users.noreply.github.com> Date: Tue, 17 Sep 2024 11:43:26 -0400 Subject: [PATCH] Add FailureReason to JobBasic (#759) --- NGitLab.Mock/Job.cs | 5 +++++ NGitLab.Mock/PublicAPI.Unshipped.txt | 2 ++ NGitLab/Models/JobBasic.cs | 3 +++ NGitLab/PublicAPI.Unshipped.txt | 2 ++ 4 files changed, 12 insertions(+) diff --git a/NGitLab.Mock/Job.cs b/NGitLab.Mock/Job.cs index 174b09b4..6daecbe8 100644 --- a/NGitLab.Mock/Job.cs +++ b/NGitLab.Mock/Job.cs @@ -38,6 +38,8 @@ public sealed class Job : GitLabObject public bool AllowFailure { get; set; } + public string FailureReason { get; set; } + public User User { get; set; } public string WebUrl => Server.MakeUrl($"{Project.PathWithNamespace}/-/jobs/{Id.ToString(CultureInfo.InvariantCulture)}"); @@ -84,6 +86,7 @@ internal Bridge ToBridgeClient() Duration = Duration, TagList = TagList, QueuedDuration = QueuedDuration, + FailureReason = FailureReason, }; } @@ -118,6 +121,7 @@ internal Models.Job ToJobClient() }, Status = Status, AllowFailure = AllowFailure, + FailureReason = FailureReason, Tag = Tag, User = User?.ToClientUser(), WebUrl = WebUrl, @@ -149,6 +153,7 @@ internal Job Clone() Duration = Duration, TagList = TagList, QueuedDuration = QueuedDuration, + FailureReason = FailureReason, }; } } diff --git a/NGitLab.Mock/PublicAPI.Unshipped.txt b/NGitLab.Mock/PublicAPI.Unshipped.txt index 116cd4d9..95df0f28 100644 --- a/NGitLab.Mock/PublicAPI.Unshipped.txt +++ b/NGitLab.Mock/PublicAPI.Unshipped.txt @@ -572,6 +572,8 @@ NGitLab.Mock.Job.DownstreamPipeline.get -> NGitLab.Mock.Pipeline NGitLab.Mock.Job.DownstreamPipeline.set -> void NGitLab.Mock.Job.Duration.get -> float? NGitLab.Mock.Job.Duration.set -> void +NGitLab.Mock.Job.FailureReason.get -> string +NGitLab.Mock.Job.FailureReason.set -> void NGitLab.Mock.Job.FinishedAt.get -> System.DateTime NGitLab.Mock.Job.FinishedAt.set -> void NGitLab.Mock.Job.Id.get -> int diff --git a/NGitLab/Models/JobBasic.cs b/NGitLab/Models/JobBasic.cs index 66f76c50..9459953a 100644 --- a/NGitLab/Models/JobBasic.cs +++ b/NGitLab/Models/JobBasic.cs @@ -59,6 +59,9 @@ public class JobBasic [JsonPropertyName("tag_list")] public string[] TagList { get; set; } + [JsonPropertyName("failure_reason")] + public string FailureReason { get; set; } + public class JobPipeline { [JsonPropertyName("id")] diff --git a/NGitLab/PublicAPI.Unshipped.txt b/NGitLab/PublicAPI.Unshipped.txt index 51298ba5..a29e775c 100644 --- a/NGitLab/PublicAPI.Unshipped.txt +++ b/NGitLab/PublicAPI.Unshipped.txt @@ -2253,6 +2253,8 @@ NGitLab.Models.JobArtifactQuery.RefName.get -> string NGitLab.Models.JobArtifactQuery.RefName.set -> void NGitLab.Models.JobBasic NGitLab.Models.JobBasic.Commit.get -> NGitLab.Models.Commit +NGitLab.Models.JobBasic.FailureReason.get -> string +NGitLab.Models.JobBasic.FailureReason.set -> void NGitLab.Models.JobBasic.JobBasic() -> void NGitLab.Models.JobBasic.JobPipeline.JobPipeline() -> void NGitLab.Models.JobBasic.JobPipeline.ProjectId.get -> int