From b275520574c9087b86e6d3ab764baa020d850efa Mon Sep 17 00:00:00 2001 From: allegroai <> Date: Sun, 15 Aug 2021 22:30:19 +0300 Subject: [PATCH] Fix clearml-task ssh repo links are not detected as remote repositories (issue #423) --- clearml/backend_interface/task/populate.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/clearml/backend_interface/task/populate.py b/clearml/backend_interface/task/populate.py index 9cbac4a2..f37878dc 100644 --- a/clearml/backend_interface/task/populate.py +++ b/clearml/backend_interface/task/populate.py @@ -15,6 +15,17 @@ from ...task import Task class CreateAndPopulate(object): + _VCS_SSH_REGEX = \ + "^" \ + "(?:(?P{regular}*?)@)?" \ + "(?P{regular}*?)" \ + ":" \ + "(?P{regular}.*)?" \ + "$" \ + .format( + regular=r"[^/@:#]" + ) + def __init__( self, project_name=None, # type: Optional[str] @@ -74,7 +85,7 @@ class CreateAndPopulate(object): :param raise_on_missing_entries: If True raise ValueError on missing entries when populating :param verbose: If True print verbose logging """ - if len(urlparse(repo).scheme) <= 1: + if repo and len(urlparse(repo).scheme) <= 1 and not re.compile(self._VCS_SSH_REGEX).match(repo): folder = repo repo = None else: