From cbe3a565001efe2324b65f52bded710bab4da26d 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