From 0ac5dcb33d894dd16a590ccaf72a10ab4c4c98f6 Mon Sep 17 00:00:00 2001 From: magic_rb Date: Wed, 12 Jun 2024 17:36:43 +0200 Subject: [PATCH] Fix GitHub App backend failing if `project-id-map` disappears Signed-off-by: magic_rb --- buildbot_nix/github_projects.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/buildbot_nix/github_projects.py b/buildbot_nix/github_projects.py index 1055084..6a2a9d5 100644 --- a/buildbot_nix/github_projects.py +++ b/buildbot_nix/github_projects.py @@ -381,6 +381,9 @@ class GithubAppAuthBackend(GithubAuthBackend): self.auth_type.app_project_id_map_name.read_text() ) else: + tlog.info( + "~project-id-map~ is not present, GitHub project reload will follow." + ) self.project_id_map = {} def get_general_token(self) -> RepoToken: @@ -600,6 +603,12 @@ class GithubBackend(GitBackend): if not self.config.project_cache_file.exists(): return False + if ( + isinstance(self.config.auth_type, AuthTypeApp) + and not self.config.auth_type.app_project_id_map_name.exists() + ): + return False + all_have_installation_id = True for project in json.loads(self.config.project_cache_file.read_text()): if not "installation_id" in project: