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

Azure DevOps not able fetch code from Git repo #213

Closed
amitmele opened this issue Nov 9, 2019 · 10 comments · Fixed by #636
Closed

Azure DevOps not able fetch code from Git repo #213

amitmele opened this issue Nov 9, 2019 · 10 comments · Fixed by #636
Assignees
Labels
bug Something isn't working dependencies Pull requests that update a dependency file

Comments

@amitmele
Copy link

amitmele commented Nov 9, 2019

Using Azure DevOps private registry,

Authorisation is successful but
While building Image getting bellow error

PS C:\Test\kpack\kpack-ms> .\logs.exe -image sample-image
prepare:main.go:78: unable to fetch git repository: unexpected client error: unexpected requesting "https://private-test.visualstudio.com/PROJECT/_git/test-sb-kp-ms/git-upload-pack" status code: 400

@amitmele
Copy link
Author

amitmele commented Nov 9, 2019

Ref May Help: argoproj/argo-cd#1067, issue mostly with go-git library

@matthewmcnew
Copy link
Collaborator

It looks like this is a direct result of the issue in the go-git library. src-d/go-git#1058

@matthewmcnew matthewmcnew added bug Something isn't working dependencies Pull requests that update a dependency file labels Nov 12, 2019
@lsilvapvt
Copy link

lsilvapvt commented Aug 6, 2020

Any plans to address this issue with the product? It prevents the adoption of the product by any customer users of Azure DevOps repositories.

@tylerphelan
Copy link
Contributor

new issue: go-git/go-git#64

@rajivmca2004
Copy link

Any update on this, when it will be fixed? Our partner/customer is getting impacted with this.

@phillebaba
Copy link

@rajivmca2004 I have created a PR go-git/go-git#200 with a fix that would make it work for Azure DevOps.

@djoyahoy
Copy link
Contributor

djoyahoy commented Nov 3, 2020

@phillebaba Thank you for letting us know and for your hard work on that PR!

@dirien
Copy link

dirien commented Dec 9, 2020

hi,

i just wanted to mention that @phillebaba enabled in the GitOps Toolkit the git2go library as an alternative. This approach could be useful here too?

@phillebaba
Copy link

Yep so our solution after a failed attempt at adding multi_ack support to go-git was to switch over to git2go. It is probably the only other proper git client for golang. After spending some time with reading git wire protocol specs I can say that fully implementing multi_ack and multi_ack_detailed is not an easy job in go-git and would require someone who could work on it full time for some weeks. This makes implementing it in go-git improbable.

Saying that, git2go does have its limitations as well that I found along the way. Hopefully this would help you guys when choosing if it is right for you to switch.

  • git2go is a golang binding for libgit2 which is built in C. This means that if you want to run anything using git2go locally you will need to install the libgit2 library. This is pretty easy on macOS and most linux distros, not to sure about Windows. If you run everything in a container this really is not an issue.
  • Shallow cloning is currently not supported, which was a big deal for us. There is a PR that has been open for a couple of years, but has sadly not been merged yet. It is still active to this day.
  • SSH key validation is a bit tricky if you want to do it in memory as it does not expose data to use the standard go method. I have looked into solving this but it may take a while. Until then you could just use the solution flux uses which is not as nice as the standard go method.

@matthewmcnew
Copy link
Collaborator

Thanks for the summary @phillebaba. We will look at git2go. The shallow cloning/ssh key validation might be a bit of a hurdle for us. We will need to investigate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working dependencies Pull requests that update a dependency file
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants