From f2ffb672aaa0056df33754c9b92a91df973c4886 Mon Sep 17 00:00:00 2001 From: Cat from Catalyst Date: Thu, 28 Sep 2023 14:32:45 +0100 Subject: [PATCH 1/3] Update app.py empty list has no .length() but len([]) is 0 --- app.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app.py b/app.py index dedc9fd..96df09c 100644 --- a/app.py +++ b/app.py @@ -70,7 +70,7 @@ def sync_team(client=None, owner=None, team_id=None, slug=None): try: directory_group = get_directory_from_slug(slug, custom_map, org) # If we're filtering on group prefix, skip if the group doesn't match - if group_prefix.length() > 0 and not directory_group.startswith( + if len(group_prefix) > 0 and not directory_group.startswith( tuple(group_prefix) ): print(f"skipping team {team.slug} - not in group prefix") From e275f0a2d8fed0a80f99bd82633ea81d062a2583 Mon Sep 17 00:00:00 2001 From: Cat from Catalyst Date: Mon, 2 Oct 2023 09:59:03 +0100 Subject: [PATCH 2/3] Add a health check endpoint Some deployment systems require a health check --- githubapp/core.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/githubapp/core.py b/githubapp/core.py index 07fced3..e6ff8dc 100644 --- a/githubapp/core.py +++ b/githubapp/core.py @@ -89,6 +89,11 @@ def init_app(self, app): methods=["POST"], ) + app.add_url_rule("/health_check", endpoint="health_check") + @app.endpoint("health_check") + def health_check(): + return 'Web server is running.', 200 + @property def id(self): return current_app.config["GITHUBAPP_ID"] From cf361b95dff845aaf914c33ffbbf3de668802bda Mon Sep 17 00:00:00 2001 From: Cat from Catalyst Date: Mon, 2 Oct 2023 10:07:43 +0100 Subject: [PATCH 3/3] Fix for formatting --- githubapp/core.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/githubapp/core.py b/githubapp/core.py index e6ff8dc..2684192 100644 --- a/githubapp/core.py +++ b/githubapp/core.py @@ -92,7 +92,7 @@ def init_app(self, app): app.add_url_rule("/health_check", endpoint="health_check") @app.endpoint("health_check") def health_check(): - return 'Web server is running.', 200 + return "Web server is running.", 200 @property def id(self):