aboutsummaryrefslogtreecommitdiff
path: root/mod/mod-ci-github-gh.cxx
diff options
context:
space:
mode:
authorFrancois Kritzinger <francois@codesynthesis.com>2024-04-18 08:09:02 +0200
committerFrancois Kritzinger <francois@codesynthesis.com>2024-06-05 09:12:46 +0200
commit9bb4f1606d941aacc51626b370b84d976a836aba (patch)
tree96a8cd943f27c5950a3d4b483cef834fe767b969 /mod/mod-ci-github-gh.cxx
parent3f2a23ab62b5cbb940db7f925b3fff84d688285f (diff)
Fixes
Diffstat (limited to 'mod/mod-ci-github-gh.cxx')
-rw-r--r--mod/mod-ci-github-gh.cxx23
1 files changed, 7 insertions, 16 deletions
diff --git a/mod/mod-ci-github-gh.cxx b/mod/mod-ci-github-gh.cxx
index dc1447f..28f21f7 100644
--- a/mod/mod-ci-github-gh.cxx
+++ b/mod/mod-ci-github-gh.cxx
@@ -133,23 +133,14 @@ namespace brep
{
p.next_expect (event::begin_object);
- bool ni (false), nm (false), st (false);
-
- while (p.next_expect (event::name, event::end_object))
- {
- auto c = [&p] (bool& v, const char* s)
- {
- return p.name () == s ? (v = true) : false;
- };
-
- if (c (ni, "id")) node_id = p.next_expect_string ();
- else if (c (nm, "name")) name = p.next_expect_string ();
- else if (c (st, "status")) status = p.next_expect_string ();
- }
+ // We always ask for this exact set of fields to be returned in GraphQL
+ // requests.
+ //
+ node_id = p.next_expect_member_string ("id");
+ name = p.next_expect_member_string ("name");
+ status = p.next_expect_member_string ("status");
- if (!ni) missing_member (p, "gh_check_run", "id");
- if (!nm) missing_member (p, "gh_check_run", "name");
- if (!st) missing_member (p, "gh_check_run", "status");
+ p.next_expect (event::end_object);
}
ostream&