From c1a6bac9df34cc7c37f85621d804de5564b59fe9 Mon Sep 17 00:00:00 2001 From: Francois Kritzinger Date: Tue, 4 Jun 2024 14:29:27 +0200 Subject: Fix GraphQL response parsing --- mod/mod-ci-github-gq.cxx | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/mod/mod-ci-github-gq.cxx b/mod/mod-ci-github-gq.cxx index e5ea0c5..5979511 100644 --- a/mod/mod-ci-github-gq.cxx +++ b/mod/mod-ci-github-gq.cxx @@ -114,10 +114,12 @@ namespace brep } else if (p.name () == "errors") { - // Don't stop parsing because the error semantics depends on whether - // or not `data` is present. + // Skip the errors object but don't stop parsing because the error + // semantics depends on whether or not `data` is present. // err = true; // Handled below. + + p.next_expect_value_skip (); } else { @@ -622,13 +624,19 @@ namespace brep value = move (oid); } - else if (ma == "CONFLICTING") - { - value = ""; - } - else if (ma == "UNKNOWN") + else { - // Still being generated; leave value absent. + if (ma == "CONFLICTING") + value = ""; + else if (ma == "UNKNOWN") + { + // Still being generated; leave value absent. + } + + // Skip the merge commit ID (which should be null). + // + p.next_expect_name ("potentialMergeCommit"); + p.next_expect_value_skip (); } p.next_expect (event::end_object); // node -- cgit v1.1