aboutsummaryrefslogtreecommitdiff
path: root/mod/mod-ci-github-gq.cxx
diff options
context:
space:
mode:
authorFrancois Kritzinger <francois@codesynthesis.com>2024-10-31 15:03:10 +0200
committerFrancois Kritzinger <francois@codesynthesis.com>2024-12-10 16:34:15 +0200
commit33ee65453e6a5c6bbb1d5c10f78b3c3b2e4bca40 (patch)
tree96c9a5234fecb27096d5ae1a95009dae8a1b07ad /mod/mod-ci-github-gq.cxx
parente4447a19e8a58c16a9c31d13c5ed2c26b30a3550 (diff)
Update comments, clean up and fix code
Diffstat (limited to 'mod/mod-ci-github-gq.cxx')
-rw-r--r--mod/mod-ci-github-gq.cxx21
1 files changed, 11 insertions, 10 deletions
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<gh_check_run> 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;