From 0898e2d2a21abb656262f0e10d2c310864822df6 Mon Sep 17 00:00:00 2001 From: Gavin D'souza Date: Tue, 4 Jan 2022 16:23:16 +0530 Subject: [PATCH 1/3] fix: Don't recompute URLs when name passed in App --- bench/app.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/bench/app.py b/bench/app.py index 665d5e5c..a7e5d0de 100755 --- a/bench/app.py +++ b/bench/app.py @@ -61,6 +61,7 @@ class AppMeta: self.on_disk = False self.use_ssh = False self.from_apps = False + self.is_url = False self.branch = branch self.setup_details() @@ -81,6 +82,7 @@ class AppMeta: # fetch meta for repo from remote git server - traditional get-app url elif is_git_url(self.name): + self.is_url = True if self.name.startswith("git@") or self.name.startswith("ssh://"): self.use_ssh = True self._setup_details_from_git_url() @@ -123,6 +125,9 @@ class AppMeta: if self.on_disk: return os.path.abspath(self.name) + if self.is_url: + return self.name + if self.use_ssh: return self.get_ssh_url() From e3b9c2a239f020c4d64c67c8c48b856a8a164283 Mon Sep 17 00:00:00 2001 From: Gavin D'souza Date: Tue, 4 Jan 2022 17:04:45 +0530 Subject: [PATCH 2/3] fix: Set remote_server attr "better" So better here is relative. The point was to not have the parsing break everything. So, idk whats org and repo now right off the bat...and since we're not using this info, we dont need to care about it rn --- bench/app.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bench/app.py b/bench/app.py index a7e5d0de..446fdc5e 100755 --- a/bench/app.py +++ b/bench/app.py @@ -110,9 +110,9 @@ class AppMeta: if self.use_ssh: _first_part, _second_part = self.name.split(":") self.remote_server = _first_part.split("@")[-1] - self.org, _repo = _second_part.split("/") + self.org, _repo = _second_part.rsplit("/", 1) else: - self.remote_server, self.org, _repo = self.name.split("/")[-3:] + self.remote_server, self.org, _repo = self.name.rsplit("/", 2) self.tag = self.branch self.repo = _repo.split(".")[0] From 23b37a3606e35645bc0476ee7b0f21968023bb61 Mon Sep 17 00:00:00 2001 From: Gavin D'souza Date: Tue, 4 Jan 2022 17:08:17 +0530 Subject: [PATCH 3/3] style: Re-order import statement --- bench/app.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/bench/app.py b/bench/app.py index 446fdc5e..0dc2fba7 100755 --- a/bench/app.py +++ b/bench/app.py @@ -30,14 +30,13 @@ from bench.utils.bench import ( ) from bench.utils.render import step - -logger = logging.getLogger(bench.PROJECT_NAME) - - if typing.TYPE_CHECKING: from bench.bench import Bench +logger = logging.getLogger(bench.PROJECT_NAME) + + class AppMeta: def __init__(self, name: str, branch: str = None, to_clone: bool = True): """