diff options
author | Francois Kritzinger <francois@codesynthesis.com> | 2024-06-06 16:32:06 +0200 |
---|---|---|
committer | Francois Kritzinger <francois@codesynthesis.com> | 2024-10-15 09:05:28 +0200 |
commit | 4697aefcf0de2003f106fefab67af6b1132ed26c (patch) | |
tree | d0dd3d0f2b100aac9a711b3bb1bb4832f71636e7 /mod/mod-ci-github.cxx | |
parent | 3fcbcc11675540fc7296073debc0cab3f74e7997 (diff) |
Post-review changes: conclusion
Diffstat (limited to 'mod/mod-ci-github.cxx')
-rw-r--r-- | mod/mod-ci-github.cxx | 79 |
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; + } } } } |