From c012c97889fc4e835a53cadf6a824f671294b6ed Mon Sep 17 00:00:00 2001 From: Francois Kritzinger Date: Wed, 20 Mar 2024 12:48:12 +0200 Subject: Fix id/node_id confusion --- mod/mod-ci-github.cxx | 12 ++++-------- mod/mod-ci-github.hxx | 3 +-- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/mod/mod-ci-github.cxx b/mod/mod-ci-github.cxx index bdbaf23..d1b00c0 100644 --- a/mod/mod-ci-github.cxx +++ b/mod/mod-ci-github.cxx @@ -1234,8 +1234,7 @@ namespace brep { p.next_expect (event::begin_object); - bool i (false), ni (false), hb (false), hs (false), bf (false), - at (false); + bool ni (false), hb (false), hs (false), bf (false), at (false); // Skip unknown/uninteresting members. // @@ -1246,8 +1245,7 @@ namespace brep return p.name () == s ? (v = true) : false; }; - if (c (i, "id")) id = p.next_expect_number (); - else if (c (ni, "node_id")) node_id = p.next_expect_string (); + if (c (ni, "node_id")) node_id = p.next_expect_string (); else if (c (hb, "head_branch")) head_branch = p.next_expect_string (); else if (c (hs, "head_sha")) head_sha = p.next_expect_string (); else if (c (bf, "before")) before = p.next_expect_string (); @@ -1255,7 +1253,6 @@ namespace brep else p.next_expect_value_skip (); } - if (!i) missing_member (p, "check_suite", "id"); if (!ni) missing_member (p, "check_suite", "node_id"); if (!hb) missing_member (p, "check_suite", "head_branch"); if (!hs) missing_member (p, "check_suite", "head_sha"); @@ -1266,8 +1263,7 @@ namespace brep ostream& gh::operator<< (ostream& os, const check_suite& cs) { - os << "id: " << cs.id - << ", node_id: " << cs.node_id + os << "node_id: " << cs.node_id << ", head_branch: " << cs.head_branch << ", head_sha: " << cs.head_sha << ", before: " << cs.before @@ -1305,7 +1301,7 @@ namespace brep ostream& gh::operator<< (ostream& os, const check_run& cr) { - os << "id: " << cr.node_id + os << "node_id: " << cr.node_id << ", name: " << cr.name << ", status: " << cr.status; diff --git a/mod/mod-ci-github.hxx b/mod/mod-ci-github.hxx index 713eb4b..2a4921d 100644 --- a/mod/mod-ci-github.hxx +++ b/mod/mod-ci-github.hxx @@ -49,7 +49,6 @@ namespace brep // struct check_suite { - uint64_t id; // Note: used for installation access token (REST API). string node_id; string head_branch; string head_sha; @@ -90,7 +89,7 @@ namespace brep struct installation { - uint64_t id; + uint64_t id; // Note: used for installation access token (REST API). explicit installation (json::parser&); -- cgit v1.1