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-05-13 09:17:32 +0200
commit9b73ccf57d7731505c81728142fd7038c2960406 (patch)
tree612a8abd837a03ce53d129590a9459499c7393ee /mod/mod-ci-github-gh.cxx
parent9fa70a9c7ffa0ca4b605cd988c9e896eb9879494 (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&