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

Cannot install from Azure DevOps repository #16

Closed
startdust10191 opened this issue Apr 25, 2019 · 7 comments
Closed

Cannot install from Azure DevOps repository #16

startdust10191 opened this issue Apr 25, 2019 · 7 comments
Assignees
Labels
enhancement New feature or request

Comments

@startdust10191
Copy link

Hi,

I'm unable to install a dependency hosted on a private Azure DevOps git repository.

I tracked down the problem to two places:

  1. On the file models\dep.go, the function GetURL appends ".git" to the URL. This creates an invalid URL for Azure DevOps.

  2. My login credentials are stored on the git credential store, but it appears that the go-git library is not able to use it.

I'm new to golang, but was thinking about modifying boss code myself and create a pull request. For the first problem, I would modify the GetURL function to not append ".git" and always use the URL supplied on the command line. For the second problem I would call the local git client (using os/exec) instead of using the go-git library.

@hunsche hunsche added the enhancement New feature or request label Apr 25, 2019
@snakeice
Copy link
Member

Hello
Pardon my delay in responding..

  1. The addition of '.git' has been removed on commit 509b492 and will be available in the next release

  2. You can execute boss login yourrepository.com to use ssh credential or basic auth to login, can you try it and give me a feedback?

The reason for using the native git wrapper is due to the allowable malleability with go-git where we have easy access to all commands, file storage, with an effective implementation, today this process uses basic features to management storage, we have future plans to optimize this storage, improvement in cache control, better compression of the repository data and some others that are in viability validation.

@startdust10191
Copy link
Author

Hi @snakeice,

It is still not working.

Given the (redacted) URL for a library repository https://CCCCC.visualstudio.com/PPPPP/_git/RRRRR,
where CCCCC the company account in visualstudio.com, PPPPP is the project name, and RRRRR is the repository name.

I used boss login CCCCC.visualstudio.com to provide my credentials, using basic authentication (not SSH).

Problems found:

  1. Expected URL format (an usability problem).
    I just went to the visualstudio.com repository and copied the default clone URL, then I wanted to run boss install https://CCCCC.visualstudio.com/PPPPP/_git/RRRRR, but this got me: [ERROR] Error to get repository of https: Get https://https/info/refs?service=git-upload-pack: dial tcp: lookup https: no such host.
    I had to edit the URL to remove https://. Only with boss install CCCCC.visualstudio.com/PPPPP/_git/RRRRR boss was able to continue further.

  2. Then I got [ERROR] Error to get repository of CCCCC.visualstudio.com/PPPPP/_git/RRRRR: authentication required
    I found that the code uses a map Configuration.Auth to store authentication information, and the key is a segment of the URL.
    On git.go function CloneCache there is a call to GetURLPrefix() that returns CCCCC.visualstudio, but the Auth map has a key CCCCC.visualstudio.com. The wrong key provided by GetURLPrefix() is passed to the configuration.go GetAuth function, which results in nil, so the clone is attempted without authentication information.
    I manually forced the key to be CCCCC.visualstudio.com to test the code further.

  3. After forcing the right Auth key, I got:
    [ERROR] Error to get repository of CCCCC.visualstudio.com/PPPPP/_git/RRRRR: unexpected client error: unexpected requesting "https://CCCCC.visualstudio.com/PPPPP/_git/RRRRR/git-upload-pack" status code: 400
    More investigation lead me to this issue: (Git Fetch does not work with Azure DevOps repos src-d/go-git#1058). It appears that go-git is currently incompatible with Azure DevOps repositories.

So, what about if boss is modified to have a global flag, where the user can choose to use the go-git or use the local git client via os/exec? From your last comment, it's my understanding that the reason to use go-git is to improve performance, but would be nice (in my case essential) to let users choose over performance or improved compatibility. At my work place the build server stores Azure credentials in the Windows Credential Manager, and to the best of my knowledge only the standard git client for Windows is able to access such credentials.

My experience with golang is limited, but I'm willing to help with the option to use the local git client.

@snakeice
Copy link
Member

Hello, we working to temporarily use, on failure case using go-git, the native git client. (until finish correction of go-git).

This week we intend to finish the process ^^

We want for help in implementation \m/
Soon have a Slack to facilitate communication.

@startdust10191
Copy link
Author

Great! Please let me know how I can help with the code.

@snakeice
Copy link
Member

snakeice commented Jun 14, 2019

Can you try v3.0.0-alpha4?

  • Pre-release need manually download of boss.exe

For use a native git client need execute boss config git mode native

Enter in Slack to talk over development.

@startdust10191
Copy link
Author

Hi @snakeice ,

I'll test it. Can you please re-send the Slack link. The one to sent has expired.

@snakeice
Copy link
Member

Ohh i changed link, new is http://bit.ly/hashload-slack

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

No branches or pull requests

3 participants