From ef9deaa518ee80420f7eed8af011a69f865583fb Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 18 Feb 2025 09:20:33 +0200 Subject: ci-github: Fail if no accurate list of check runs in build_built() --- mod/mod-ci-github.cxx | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'mod/mod-ci-github.cxx') diff --git a/mod/mod-ci-github.cxx b/mod/mod-ci-github.cxx index a3f2d88..d53c46e 100644 --- a/mod/mod-ci-github.cxx +++ b/mod/mod-ci-github.cxx @@ -2707,6 +2707,21 @@ namespace brep if (sd.completed) return nullptr; + // If we don't have the accurate list of check runs in the service data + // (for example, because we ran out of transaction retries trying to + // update it), then things are going to fall apart: we will add this check + // run and then immediately conclude that the check suite is complete + // (while GitHub will likely continue showing a bunch of queued check + // runs. If this checks run is successful, then we will conclude the + // check suite is successful and update the conclusion check run, all + // based on one build. + // + if (sd.check_runs.empty ()) + { + error << "no queued check runs in service data for tenant " << tenant_id; + return nullptr; + } + // Here we only update the state of this check run. If there are no more // unbuilt ones, then the synthetic conclusion check run will be updated // in build_completed(). Note that determining whether we have no more -- cgit v1.1