Skip to content

Commit 0ac5dcb

Browse files
committed
Fix GitHub App backend failing if project-id-map disappears
Signed-off-by: magic_rb <richard@brezak.sk>
1 parent 467b916 commit 0ac5dcb

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

buildbot_nix/github_projects.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -381,6 +381,9 @@ def __init__(self, auth_type: AuthTypeApp) -> None:
381381
self.auth_type.app_project_id_map_name.read_text()
382382
)
383383
else:
384+
tlog.info(
385+
"~project-id-map~ is not present, GitHub project reload will follow."
386+
)
384387
self.project_id_map = {}
385388

386389
def get_general_token(self) -> RepoToken:
@@ -600,6 +603,12 @@ def are_projects_cached(self) -> bool:
600603
if not self.config.project_cache_file.exists():
601604
return False
602605

606+
if (
607+
isinstance(self.config.auth_type, AuthTypeApp)
608+
and not self.config.auth_type.app_project_id_map_name.exists()
609+
):
610+
return False
611+
603612
all_have_installation_id = True
604613
for project in json.loads(self.config.project_cache_file.read_text()):
605614
if not "installation_id" in project:

0 commit comments

Comments
 (0)