From 33ee65453e6a5c6bbb1d5c10f78b3c3b2e4bca40 Mon Sep 17 00:00:00 2001 From: Francois Kritzinger Date: Thu, 31 Oct 2024 15:03:10 +0200 Subject: Update comments, clean up and fix code --- mod/mod-ci-github-gq.cxx | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) (limited to 'mod/mod-ci-github-gq.cxx') diff --git a/mod/mod-ci-github-gq.cxx b/mod/mod-ci-github-gq.cxx index 17096eb..1909e1f 100644 --- a/mod/mod-ci-github-gq.cxx +++ b/mod/mod-ci-github-gq.cxx @@ -241,7 +241,8 @@ namespace brep { vector check_runs; // Received check runs. - resp (json::parser& p): check_runs (gq_parse_response_check_runs (p)) {} + resp (json::parser& p) + : check_runs (gq_parse_response_check_runs (p)) {} resp () = default; } rs; @@ -271,23 +272,23 @@ namespace brep // @@ Are we handling the case where the resulting state (built) // differs from what we expect? // - if (rst != build_state::built && rst != st) + // @@@ Does built-to-built transition updates status? + // + if (rst != st && rst != build_state::built) { error << "unexpected check_run status: received '" << rcr.status << "' but expected '" << gh_to_status (st) << '\''; return false; // Fail because something is clearly very wrong. } - else - { - check_run& cr (crs[i]); - if (!cr.node_id) - cr.node_id = move (rcr.node_id); + check_run& cr (crs[i]); - cr.state = rst; - cr.state_synced = true; - } + if (!cr.node_id) + cr.node_id = move (rcr.node_id); + + cr.state = rst; + cr.state_synced = (rst == st); } return true; -- cgit v1.1