From c94738d1a1b3087799cc1f0decdd66d7ab692d44 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Fri, 5 Jul 2024 12:46:20 +0200 Subject: [PATCH] buildbot_nix: allows to restart a build --- buildbot_nix/__init__.py | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/buildbot_nix/__init__.py b/buildbot_nix/__init__.py index 2b1379f..976f744 100644 --- a/buildbot_nix/__init__.py +++ b/buildbot_nix/__init__.py @@ -678,8 +678,14 @@ class AnyProjectEndpointMatcher(EndpointMatcherBase): if res is None: return None - builder = yield self.master.data.get(("builders", res["builderid"])) - builder_name = normalize_virtual_builder_name(builder["name"]) + builderid = res.get("builderid") + if builderid is None: + builder_name = res["builder_names"][0] + else: + builder = yield self.master.data.get(("builders", builderid)) + builder_name = builder["name"] + + builder_name = normalize_virtual_builder_name(builder_name) if builder_name in self.builders: log.warn( "Builder {builder} allowed by {role}: {builders}", @@ -696,6 +702,14 @@ class AnyProjectEndpointMatcher(EndpointMatcherBase): builders=self.builders, ) + def match_ForceSchedulerEndpoint_force( # noqa: N802 + self, + epobject: Any, + epdict: dict[str, Any], + options: dict[str, Any], + ) -> defer.Deferred[Match]: + return self.check_builder(epobject, epdict, "build") + def match_BuildEndpoint_rebuild( # noqa: N802 self, epobject: Any,