Skip to content

Commit 53c1f48

Browse files
committed
Don't crash on 404 from GitHub
Fixes KIWI-TCMS-EA, https://sentry.io/organizations/kiwitcms/issues/1869016907/
1 parent b09bb23 commit 53c1f48

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

tcms_github_app/utils.py

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -300,9 +300,18 @@ def create_product_from_installation_repositories(data):
300300
with tenant_context(tenant):
301301
rpc = github_rpc_from_inst(installation)
302302
for repo in data.payload['repositories_added']:
303-
repo_object = rpc.get_repo(repo['full_name'])
304-
_product_from_repo(repo_object)
305-
_bugtracker_from_repo(repo_object)
303+
try:
304+
repo_object = rpc.get_repo(repo['full_name'])
305+
_product_from_repo(repo_object)
306+
_bugtracker_from_repo(repo_object)
307+
except github.UnknownObjectException:
308+
# KIWI-TCMS-EA
309+
# https://sentry.io/organizations/kiwitcms/issues/1869016907/
310+
# Not sure when & how this happens, the repo is accessible on GitHub but
311+
# it is a fork, not a source repo.
312+
# In any case, if we can't get the data from GitHub there's nothing
313+
# we can do here!
314+
continue
306315

307316

308317
def create_installation(data):

0 commit comments

Comments
 (0)