From 22699fcf9d50afb8ee115644c3e984e1e8f25eb8 Mon Sep 17 00:00:00 2001 From: theknut Date: Fri, 25 Jul 2025 12:50:29 +0200 Subject: [PATCH 1/2] feat: add WithMergeStatusRecheck property --- NGitLab/Impl/MergeRequestClient.cs | 1 + NGitLab/Models/MergeRequestQuery.cs | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/NGitLab/Impl/MergeRequestClient.cs b/NGitLab/Impl/MergeRequestClient.cs index 2a2b09d9..7593a07b 100644 --- a/NGitLab/Impl/MergeRequestClient.cs +++ b/NGitLab/Impl/MergeRequestClient.cs @@ -62,6 +62,7 @@ public IEnumerable Get(MergeRequestQuery query) url = Utils.AddParameter(url, "target_branch", query.TargetBranch); url = Utils.AddParameter(url, "search", query.Search); url = Utils.AddParameter(url, "wip", query.Wip.HasValue ? (query.Wip.Value ? "yes" : "no") : null); + url = Utils.AddParameter(url, "with_merge_status_recheck", query.WithMergeStatusRecheck.HasValue ? query.WithMergeStatusRecheck.Value.ToString().ToLower() : null)); return _api.Get().GetAll(url); } diff --git a/NGitLab/Models/MergeRequestQuery.cs b/NGitLab/Models/MergeRequestQuery.cs index 00eca081..42f552ae 100644 --- a/NGitLab/Models/MergeRequestQuery.cs +++ b/NGitLab/Models/MergeRequestQuery.cs @@ -107,4 +107,9 @@ public class MergeRequestQuery /// Filter merge requests against their wip status. yes to return only WIP merge requests, no to return non WIP merge requests /// public bool? Wip { get; set; } + + /// + /// Listing merge requests might not proactively update (which also affects ), as this can be an expensive operation. If you need the value of these fields from this endpoint, set this parameter to true. + /// + public bool? WithMergeStatusRecheck { get; set; } } From bdb46e6f51e1672bba52bcc4bb35e67e0029ff09 Mon Sep 17 00:00:00 2001 From: theknut Date: Mon, 28 Jul 2025 11:19:43 +0200 Subject: [PATCH 2/2] fix: use ToLowerInvariant --- NGitLab/Impl/MergeRequestClient.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NGitLab/Impl/MergeRequestClient.cs b/NGitLab/Impl/MergeRequestClient.cs index 7593a07b..04ea5941 100644 --- a/NGitLab/Impl/MergeRequestClient.cs +++ b/NGitLab/Impl/MergeRequestClient.cs @@ -62,7 +62,7 @@ public IEnumerable Get(MergeRequestQuery query) url = Utils.AddParameter(url, "target_branch", query.TargetBranch); url = Utils.AddParameter(url, "search", query.Search); url = Utils.AddParameter(url, "wip", query.Wip.HasValue ? (query.Wip.Value ? "yes" : "no") : null); - url = Utils.AddParameter(url, "with_merge_status_recheck", query.WithMergeStatusRecheck.HasValue ? query.WithMergeStatusRecheck.Value.ToString().ToLower() : null)); + url = Utils.AddParameter(url, "with_merge_status_recheck", query.WithMergeStatusRecheck?.ToString().ToLowerInvariant()); return _api.Get().GetAll(url); }