From 6964d32fef15c3b99d40840d16bd298143002cc1 Mon Sep 17 00:00:00 2001 From: Francois Kritzinger Date: Thu, 6 Jun 2024 17:38:27 +0200 Subject: Handle check suite re-runs --- mod/mod-ci-github.cxx | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/mod/mod-ci-github.cxx b/mod/mod-ci-github.cxx index 82da4f0..0ddc75d 100644 --- a/mod/mod-ci-github.cxx +++ b/mod/mod-ci-github.cxx @@ -309,8 +309,6 @@ namespace brep // Someone manually requested to re-run all the check runs in this // check suite. Treat as a new request. // - // @@@ Test and make sure works? - // return handle_check_suite_request (move (cs), warning_success); } else if (cs.action == "completed") @@ -559,6 +557,15 @@ namespace brep << cs.check_suite.head_branch; } } + // Cancel existing CI request if this check suite is being re-run. + // + else if (cs.action == "rerequested") + { + const string& nid (cs.check_suite.node_id); + + if (!cancel (error, warn, &trace, *build_db_, "ci-github", nid)) + error << "check suite " << nid << " (re-requested): unable to cancel"; + } // Start CI for the check suite. // -- cgit v1.1