From 7bc311d1e99c0937827da79fd757daf5312737d4 Mon Sep 17 00:00:00 2001 From: Jakub Retajczyk Date: Fri, 30 Jan 2026 14:12:14 +0100 Subject: [PATCH 1/2] Fix helper tool swap tests: change ssh to https url --- tests/swap/helper_tool.py | 27 ++++++++++++++++++++++----- 1 file changed, 22 insertions(+), 5 deletions(-) diff --git a/tests/swap/helper_tool.py b/tests/swap/helper_tool.py index adb8ce24..94357642 100644 --- a/tests/swap/helper_tool.py +++ b/tests/swap/helper_tool.py @@ -4,11 +4,11 @@ base = Path(__file__).parent.resolve() / ".test_dependencies" -APP_EXCHANGE_URL = "git@github.com:LedgerHQ/app-exchange.git" +APP_EXCHANGE_URL = "https://github.com/LedgerHQ/app-exchange.git" APP_EXCHANGE_DIR = base / "main/app-exchange/" APP_EXCHANGE_CLONE_DIR = base / "app-exchange/" -APP_ETHEREUM_URL = "git@github.com:LedgerHQ/app-ethereum.git" +APP_ETHEREUM_URL = "https://github.com/LedgerHQ/app-ethereum.git" APP_ETHEREUM_DIR = base / "libraries/app-ethereum/" APP_ETHEREUM_CLONE_DIR = base / "app-ethereum/" @@ -59,15 +59,33 @@ def run_cmd(cmd: str, return ret.stdout.strip() +def ensure_https_git(): + # Force HTTPS for all GitHub SSH URLs (incl. submodules) + run_cmd('git config --global url."https://github.com/".insteadOf git@github.com:') + run_cmd('git config --global url."https://github.com/".insteadOf ssh://git@github.com/') + +def submodule_update_https(cwd: Path): + run_cmd("git submodule sync --recursive", cwd=cwd) + cmd = ( + 'git -c url."https://github.com/".insteadOf=git@github.com: ' + '-c url."https://github.com/".insteadOf=ssh://git@github.com/ ' + "submodule update --init --recursive" + ) + run_cmd(cmd, cwd=cwd) + def clone_or_pull(repo_url: str, clone_dir: str): # Only needed when cloning / pulling, not when building. # By putting the import here we allow the script to be imported inside the docker image from git import Repo + + ensure_https_git() + git_dir = os.path.join(clone_dir, ".git") if not os.path.exists(git_dir): print(f"Cloning into {clone_dir}") run_cmd(f"rm -rf {clone_dir}") - Repo.clone_from(repo_url, clone_dir, recursive=True) + Repo.clone_from(repo_url, clone_dir) + submodule_update_https(Path(clone_dir)) else: print(f"Pulling latest changes in {clone_dir}") repo = Repo(clone_dir) @@ -77,8 +95,7 @@ def clone_or_pull(repo_url: str, clone_dir: str): # Update submodules print(f"Updating submodules in {clone_dir}") - run_cmd("git submodule sync", cwd=Path(clone_dir)) - run_cmd("git submodule update --init --recursive", cwd=Path(clone_dir)) + submodule_update_https(Path(clone_dir)) def build_app(clone_dir: str, flags: str): cmd = f"make clean" From 26ff8e8593715c326657abe47dd33b866e315304 Mon Sep 17 00:00:00 2001 From: Jakub Retajczyk Date: Thu, 5 Feb 2026 16:12:22 +0100 Subject: [PATCH 2/2] Removed redundand code --- tests/swap/helper_tool.py | 7 ------- 1 file changed, 7 deletions(-) diff --git a/tests/swap/helper_tool.py b/tests/swap/helper_tool.py index 94357642..dbd41e0a 100644 --- a/tests/swap/helper_tool.py +++ b/tests/swap/helper_tool.py @@ -59,11 +59,6 @@ def run_cmd(cmd: str, return ret.stdout.strip() -def ensure_https_git(): - # Force HTTPS for all GitHub SSH URLs (incl. submodules) - run_cmd('git config --global url."https://github.com/".insteadOf git@github.com:') - run_cmd('git config --global url."https://github.com/".insteadOf ssh://git@github.com/') - def submodule_update_https(cwd: Path): run_cmd("git submodule sync --recursive", cwd=cwd) cmd = ( @@ -78,8 +73,6 @@ def clone_or_pull(repo_url: str, clone_dir: str): # By putting the import here we allow the script to be imported inside the docker image from git import Repo - ensure_https_git() - git_dir = os.path.join(clone_dir, ".git") if not os.path.exists(git_dir): print(f"Cloning into {clone_dir}")