diff --git a/henry/commands/analyze.py b/henry/commands/analyze.py index 5a054ad..bb454f5 100644 --- a/henry/commands/analyze.py +++ b/henry/commands/analyze.py @@ -32,7 +32,9 @@ def projects(self, *, id: Optional[str] = None) -> fetcher.TResult: assert isinstance(p.validation_required, bool) p_files = self.sdk.all_project_files(p.name) - if "/bare_models/" in cast(str, p.git_remote_url): + if p.git_remote_url is None: + git_connection_test_results = "No repo found" + elif "/bare_models/" in cast(str, p.git_remote_url): git_connection_test_results = "Bare repo, no tests required" else: git_connection_test_results = self.run_git_connection_tests( @@ -102,3 +104,4 @@ def explores( } ) return result + diff --git a/henry/modules/fetcher.py b/henry/modules/fetcher.py index 700004d..6d6a5ec 100644 --- a/henry/modules/fetcher.py +++ b/henry/modules/fetcher.py @@ -320,7 +320,14 @@ def get_explore_join_stats( def run_git_connection_tests(self, project_id: str): """Run all git connection tests for a given project.""" self.sdk.update_session(models.WriteApiSession(workspace_id="dev")) - supported_tests = self.sdk.all_git_connection_tests(project_id) + + try: + supported_tests = self.sdk.all_git_connection_tests(project_id, transport_options={"headers": {"Accept": "application/json"}}) + except error.SDKError as e: + if e.message == "The resource you're looking for could not be found": + return "Project not found in development mode" + else: + return "Error running git connection tests" results = [] for test in supported_tests: assert isinstance(test.id, str) @@ -427,3 +434,4 @@ class Input(NamedTuple): quiet: bool = False save: Optional[bool] = False timeout: Optional[int] = 120 +