Search Unity

Package manager can't clone azure dev ops repos

Discussion in 'Package Manager' started by vrmYavuz, Feb 13, 2019.

  1. vrmYavuz

    vrmYavuz

    Joined:
    Mar 7, 2018
    Posts:
    5
    Hey i am trying to use package manager for my custom unity packages and i am trying to pull packages from git. I have succesfuly done it by using public github repo but in our company we are using azure devops so i would like to have my packages stored in azure devops repositories but when i am using my azure devops repo clone link package manager give an error like this

    com.vrm.packageName: Version 'https://ProjectName@dev.azure.com/CompanyName/ProjectName/_git/PackageName' is invalid. Expected a 'SemVer' compatible value or a value starting with 'file:', 'http:', 'https:', 'git:' or 'ssh:'.

    i have tried to clone this repository by using git clone command in terminal and it worked

    and i am tried to put '.git' to end of my repository link, when i am doing that it gives this error

    Error when executing git command. remote: TF401019: The Git repository with name or identifier CarouselSystem.git does not exist or you do not have permissions for the operation you are attempting.

    I dont understand what is the problem can anyone help me?
     
  2. maximeb_unity

    maximeb_unity

    Unity Technologies

    Joined:
    Mar 20, 2018
    Posts:
    121
    Hi @vrmYavuz,

    In order to disambiguate URLs internally, we require URLs to end with .git to use Git packages, so you had it right when you added the '.git' suffix.

    Next is that it seems to be an authentication issue: you're trying to access your repository using the 'ProjectName' user, without including a password. I presume that on the command-line, Git would ask you for your password? If so, then it's a bit different with the Package Manager because when it calls Git, it's not calling it over a shell where you can interactively provide Git with your password. There's a couple solutions:

    - Use SSH instead. This requires that you register an SSH key with the Git server that allows it to recognize that you're connecting as the 'ProjectName' user. (Typically this is done on a per-user basis, rather than using a shared username, like 'ProjectName', but YMMV.)
    - Configure a Git credential helper in your global settings. Take a look at https://git-scm.com/docs/gitcredentials for this. This might be non-trivial to set up, but I know it can work. (We'll eventually provide better instructions on how to set this up in our documentation.)
    - The easiest (but worst, in terms of security) is to use a URL with both username and password in it, e.g.
    https://ProjectName:Password@dev.azure.com/CompanyName/ProjectName/_git/PackageName
    . Warning: I do NOT recommend you do that: while that's probably fine for local tests, you should never share a project with such a Git URL added to it because you'd basically be handing the keys to that account to anyone fetching your project (i.e. they would have the same access level as you for all the repos on that server...)
     
  3. vrmYavuz

    vrmYavuz

    Joined:
    Mar 7, 2018
    Posts:
    5
    @maximeb_unity first of all thank you for you answer.

    The repository which i store my package is a public one so anyone with a link can download it and when i try to get it from command line it doesnt ask for a password.

    https://VRMPackages@dev.azure.com/VRMPackages/CarouselSystem/_git/CarouselSystem

    anyone can get the repository from this url i am giving it in case you want to try it for yourself.

    But when i put '.git' to end of this link i cant clone it it gives error and unity package manager requires .git at end of it
    so i cant use azure repos for package manager is this a bug?
    Are you planning to support urls without .git at end?



    upload_2019-2-15_18-16-32.png
     
  4. maximeb_unity

    maximeb_unity

    Unity Technologies

    Joined:
    Mar 20, 2018
    Posts:
    121
    Hi @vrmYavuz,

    I confirm I cannot clone that URL with a trailing .git extension (getting prompted for credentials). Apparently Azure repos do not treat <git-url> and <git-url>.git as interchangeable, unlike Github, BitBucket and GitLab.

    The dev team will be notified of this bug. For the time being, it looks like you cannot use Azure repos. If your repo is public, I might suggest hosting your repo on one of the aforementioned repository hosting services, at least until we fix this.
     
  5. WWysocki

    WWysocki

    Joined:
    May 30, 2015
    Posts:
    6
  6. felipemunoz_unity

    felipemunoz_unity

    Unity Technologies

    Joined:
    Apr 5, 2019
    Posts:
    5
    Hi @WWysocki ! Unity Version 2019.1 should have support for "git" dependencies that don't need to end with .git
    Would you be able to give it a try and let us know if it worked for your use case?

    To use this feature, the url in the project manifest should be specified as:
    git+https://user@host/path/to/repo


    Edit: 2019.1 is currently available as a beta version.

    Cheers,
    Felipe
     
    Last edited: Apr 8, 2019
  7. WWysocki

    WWysocki

    Joined:
    May 30, 2015
    Posts:
    6
    Hi @felipemunoz_unity ! I just got it working with Azure DevOps repos in Unity 2019.1.0f1 and 2019.2.0.a11 :) Thanks!