forked from LedgerHQ/app-hedera
-
Notifications
You must be signed in to change notification settings - Fork 1
Fix helper tool swap tests: change ssh to https url #76
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
jakubretajczykBD
wants to merge
2
commits into
blockydevs:develop
Choose a base branch
from
jakubretajczykBD:fix/clone-build-swap-tests
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 1 commit
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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" | ||
|
|
||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Podeślij mi jaki problem leciał przed tą zmianą. Potrzebuje mieć jakieś konkrety do opisu, gdzie chce dać: