diff options
author | Francois Kritzinger <francois@codesynthesis.com> | 2024-12-06 11:41:31 +0200 |
---|---|---|
committer | Francois Kritzinger <francois@codesynthesis.com> | 2024-12-06 14:13:26 +0200 |
commit | 041604583b51d292be694ab475712d86bb9af9b5 (patch) | |
tree | fe69f74d5f562d13b61063f0140f3734b3220462 /mod/mod-ci-github-gh.cxx | |
parent | cb1722cea9e4b6151758edd20e089f184fae7905 (diff) |
Post-review changesci-github-2
Diffstat (limited to 'mod/mod-ci-github-gh.cxx')
-rw-r--r-- | mod/mod-ci-github-gh.cxx | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/mod/mod-ci-github-gh.cxx b/mod/mod-ci-github-gh.cxx index 9eebf34..021ff6b 100644 --- a/mod/mod-ci-github-gh.cxx +++ b/mod/mod-ci-github-gh.cxx @@ -205,7 +205,19 @@ namespace brep // while (p.next_expect (event::name, event::end_object)) { - if (c (ai, "id")) app_id = p.next_expect_number<uint64_t> (); + if (c (ai, "id")) + { + // Note: unlike the check_run webhook's app.id, the check_suite + // one can be null. It's unclear under what circumstances, but it + // shouldn't happen unless something is broken. + // + string* v (p.next_expect_number_null ()); + + if (v == nullptr) + throw_json (p, "check_suite.app.id is null"); + + app_id = *v; + } else p.next_expect_value_skip (); } @@ -230,7 +242,7 @@ namespace brep << ", head_sha: " << cs.head_sha << ", latest_check_runs_count: " << cs.check_runs_count << ", conclusion: " << (cs.conclusion ? *cs.conclusion : "null") - << ", app_id: " << (cs.app_id ? to_string (*cs.app_id) : "null"); + << ", app_id: " << cs.app_id; return os; } @@ -298,7 +310,7 @@ namespace brep // while (p.next_expect (event::name, event::end_object)) { - if (c (ai, "id")) app_id = p.next_expect_number<uint64_t> (); + if (c (ai, "id")) app_id = p.next_expect_number (); else p.next_expect_value_skip (); } @@ -501,7 +513,7 @@ namespace brep return p.name () == s ? (v = true) : false; }; - if (c (i, "id")) id = p.next_expect_number<uint64_t> (); + if (c (i, "id")) id = p.next_expect_number (); else p.next_expect_value_skip (); } |