From 1153510b04279142d5c02d9c81dd8b6bd5e16955 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Fri, 3 May 2024 14:02:17 +0200 Subject: [PATCH 1/2] Revert "don't block CI on github status updates" This reverts commit 0bb55aaa8dfe98dc81c993d647ba814ebd9df260. --- buildbot_nix/github_projects.py | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/buildbot_nix/github_projects.py b/buildbot_nix/github_projects.py index cec9741..6f40319 100644 --- a/buildbot_nix/github_projects.py +++ b/buildbot_nix/github_projects.py @@ -17,14 +17,17 @@ from buildbot.www.auth import AuthBase from buildbot.www.avatar import AvatarBase, AvatarGitHub from buildbot.www.oauth2 import GitHubAuth from twisted.internet import defer, threads -from twisted.internet.defer import ensureDeferred from twisted.python import log from twisted.python.failure import Failure if TYPE_CHECKING: from buildbot.process.log import StreamLog -from .common import http_request, paginated_github_request, slugify_project_name +from .common import ( + http_request, + paginated_github_request, + slugify_project_name, +) from .projects import GitBackend, GitProject from .secrets import read_secret_file @@ -78,15 +81,6 @@ class GithubConfig: return read_secret_file(self.token_secret_name) -class AsyncGitHubStatusPush(GitHubStatusPush): - @defer.inlineCallbacks - def sendMessage( # noqa: N802 - self, reports: list[dict[str, Any]] - ) -> Generator[Any, object, Any]: - # Don't block the CI on the GitHub status updates - yield ensureDeferred(super().sendMessage(reports)) - - @dataclass class GithubBackend(GitBackend): config: GithubConfig @@ -109,7 +103,7 @@ class GithubBackend(GitBackend): ) def create_reporter(self) -> ReporterBase: - return AsyncGitHubStatusPush( + return GitHubStatusPush( token=self.config.token(), # Since we dynamically create build steps, # we use `virtual_builder_name` in the webinterface From 48d3f2dedccb183cc6edd1664abad921de69eeb0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Fri, 3 May 2024 20:25:26 +0200 Subject: [PATCH 2/2] gitea: don't drop pull request events --- buildbot_nix/gitea_projects.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/buildbot_nix/gitea_projects.py b/buildbot_nix/gitea_projects.py index 995f30f..03bae40 100644 --- a/buildbot_nix/gitea_projects.py +++ b/buildbot_nix/gitea_projects.py @@ -181,6 +181,9 @@ class GiteaBackend(GitBackend): def create_change_hook(self) -> dict[str, Any]: return { "secret": self.webhook_secret, + # The "mergable" field is a bit buggy, + # we already do the merge locally anyway. + "onlyMergeablePullRequest": False, } def create_avatar_method(self) -> AvatarBase | None: