Skip to content
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

Bench get-app always use github.com even if we use different git server such as gitlab #1228

Closed
rvbd opened this issue Dec 7, 2021 · 5 comments
Labels

Comments

@rvbd
Copy link

rvbd commented Dec 7, 2021

Issue: Bug report

To reproduce, run bench get-app (anything from gitlab)

An error, will appear:
fatal: unable to access 'https://github.com/git@gitlab.com:....

Looking at the codes it seems that the remote_server is set to github.com but I can't find where it's actually set to a custom url.
Therefore when running bench get-app from anything other than gitlab it just don't work anymore.

Apology of course if I'm not using the command right, however this was working a while ago, last known working version was 5.0.0-dev.

Thanks a lot for your help.

@rvbd rvbd added the bug label Dec 7, 2021
@phot0n
Copy link
Contributor

phot0n commented Dec 7, 2021

seems hardcoded

self.remote_server = "github.com"

bench/bench/app.py

Lines 116 to 133 in cbf30b4

@property
def url(self):
if self.from_apps:
return os.path.abspath(os.path.join("apps", self.name))
if self.on_disk:
return os.path.abspath(self.name)
if self.use_ssh:
return self.get_ssh_url()
return self.get_http_url()
def get_http_url(self):
return f"https://{self.remote_server}/{self.org}/{self.repo}.git"
def get_ssh_url(self):
return f"git@{self.remote_server}:{self.org}/{self.repo}.git"

@ankush
Copy link
Member

ankush commented Dec 8, 2021

#1227 should fix it. Not closing for now (till release + addition of tests)

@Alchez
Copy link
Contributor

Alchez commented Dec 8, 2021

@ankush Actually, the remote server is still hardcoded to github.com, even if you use SSH URLs (line 133 in the previous comment). The change for this issue would be a different PR that detects the host from the given URL, I think.

@ankush
Copy link
Member

ankush commented Dec 9, 2021

Release might take some time, for now I'd suggest downgrading to 5.6.0

@TurkerTunali
Copy link

We also faced this issue. A workaround is here https://discuss.erpnext.com/t/bench-get-app-bitbucket-requires-github-account/83495?u=turkertunali

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants