aboutsummaryrefslogtreecommitdiff
path: root/mod/mod-ci-github.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'mod/mod-ci-github.cxx')
-rw-r--r--mod/mod-ci-github.cxx79
1 files changed, 46 insertions, 33 deletions
diff --git a/mod/mod-ci-github.cxx b/mod/mod-ci-github.cxx
index 2561bad..82da4f0 100644
--- a/mod/mod-ci-github.cxx
+++ b/mod/mod-ci-github.cxx
@@ -1572,7 +1572,7 @@ namespace brep
if (cr.state == build_state::built)
{
if (conclusion)
- *conclusion |= cr.status
+ *conclusion |= *cr.status;
}
else
conclusion = nullopt;
@@ -1781,46 +1781,59 @@ namespace brep
}
}
- // Update the conclusion check run if all check runs are now built.
- //
- if (cr.state == build_state::built && conclusion)
+ if (cr.state == build_state::built)
{
- assert (sd.conclusion_node_id);
+ // Check run was created/updated successfully to built.
+ //
+ // @@ TMP Feels like this should also be done inside
+ // gq_{create,update}_check_run() -- where cr.state is set if the
+ // create/update succeeds -- but I think we didn't want to pass a
+ // result_status into a gq_ function because converting to a GitHub
+ // conclusion/title/summary is reasonably complicated.
+ //
+ cr.status = b.status;
- // Update the conclusion check run with success.
+ // Update the conclusion check run if all check runs are now built.
//
- result_status rs (*conclusion);
+ if (conclusion)
+ {
+ assert (sd.conclusion_node_id);
- optional<gq_built_result> br (
- gq_built_result (gh_to_conclusion (rs, sd.warning_success),
- circle (rs) + ' ' + ucase (to_string (rs)),
- "All configurations are built"));
+ // Update the conclusion check run with success.
+ //
+ result_status rs (*conclusion);
- check_run cr;
+ optional<gq_built_result> br (
+ gq_built_result (gh_to_conclusion (rs, sd.warning_success),
+ circle (rs) + ' ' + ucase (to_string (rs)),
+ "All configurations are built"));
- // Set some fields for display purposes.
- //
- cr.node_id = *sd.conclusion_node_id;
- cr.name = conclusion_check_run_name;
+ check_run cr;
- if (gq_update_check_run (error,
- cr,
- iat->token,
- sd.repository_node_id,
- *sd.conclusion_node_id,
- nullopt /* details_url */,
- build_state::built,
- move (br)))
- {
- l3 ([&]{trace << "updated check_run { " << cr << " }";});
- }
- else
- {
- // Nothing we can do here except log the error.
+ // Set some fields for display purposes.
//
- error << "check suite " << ts.id
- << ": unable to update conclusion check run "
- << *sd.conclusion_node_id;
+ cr.node_id = *sd.conclusion_node_id;
+ cr.name = conclusion_check_run_name;
+
+ if (gq_update_check_run (error,
+ cr,
+ iat->token,
+ sd.repository_node_id,
+ *sd.conclusion_node_id,
+ nullopt /* details_url */,
+ build_state::built,
+ move (br)))
+ {
+ l3 ([&]{trace << "updated check_run { " << cr << " }";});
+ }
+ else
+ {
+ // Nothing we can do here except log the error.
+ //
+ error << "check suite " << ts.id
+ << ": unable to update conclusion check run "
+ << *sd.conclusion_node_id;
+ }
}
}
}