#cant import dagger module in private git repository

1 messages · Page 1 of 1 (latest)

silk crater
#

Im using Azure DevOps on-prem implementation with autnetication and trying to use module from git monorepo:

dagger -m https://<PRIVATE_LINK>/<ORG>/<PROJECT>/_git/<REPO>/<PATH/TO/MODULE> call --help
✔ connect 0.3s
✘ load module: https://<PRIVATE_LINK>/<ORG>/<PROJECT>/_git/<REPO>/<PATH/TO/MODULE> 2m11s ERROR
┇ finding module configuration › moduleSource(refString: "https://<PRIVATE_LINK>/<ORG>/<PROJECT>/_git/<REPO>/<PATH/TO/MODULE>") › parseRefString: https://<PRIVATE_LINK>/<ORG>/<PROJECT>/_git/<REPO>/<PATH/TO/MODULE> › 
✘ parseGitRefString: https://<PRIVATE_LINK>/<ORG>/<PROJECT>/_git/<REPO>/<PATH/TO/MODULE> 2m11s ERROR
! failed to get repo root for import path: unrecognized import path "https://<PRIVATE_LINK>/<ORG>/<PROJECT>/_git/<REPO>/<PATH/TO/MODULE>"

But cant use it. Can you help me find problem in URL?
And loading takes a lot of time....

#

I also tested:

  1. just https://<PRIVATE_LINK>/<ORG>/<PROJECT>/_git/<REPO> - the same error failed to get repo root for import path: unrecognized import path
  2. https://<PRIVATE_LINK>/<ORG>/<PROJECT>/_git/<REPO>.git/<PATH/TO/MODULE> - get the error:
! repository not found: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  <html xmlns="http://www.w3.org/1999/xhtml">
  <head>
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"/>
  <title>404 - File or directory not found.</title>
  <style type="text/css">
  <!--
  body{margin:0;font-size:.7em;font-family:Verdana, Arial, Helvetica, sans-serif;background:#EEEEEE;}
  fieldset{padding:0 15px 10px 15px;} 
  h1{font-size:2.4em;margin:0;color:#FFF;}
  h2{font-size:1.7em;margin:0;color:#CC0000;} 
  h3{font-size:1.2em;margin:10px 0 0 0;color:#000000;} 
  #header{width:96%;margin:0 0 0 0;padding:6px 2% 6px 2%;font-family:"trebuchet MS", Verdana, sans-serif;color:#FFF;
  background-color:#555555;}
  #content{margin:0 0 0 2%;position:relative;}
  .content-container{background:#FFF;width:96%;margin-top:8px;padding:10px;position:relative;}
  -->
  </style>
  </head>
  <body>
  <div id="header"><h1>Server Error</h1></div>
  <div id="content">
   <div class="content-container"><fieldset>
    <h2>404 - File or directory not found.</h2>
    <h3>The resource you are looking for might have been removed, had its name changed, or is temporarily unavailable.</h3>
   </fieldset></div>
  </div>
  </body>
  </html>

=> thus i think authentication is working, but something incorrect in link or in parsing huge monorepo

dry palm
#

👋 we do have several tests against the public azure devops URLs to fetch modules from there.

dry palm
silk crater
#

@dry palm
No, I haven’t found a similar case. I think the main thing I wasn’t able to find is the additional path segment between the slashes — the one that sits between the hostname and the repo.

I’m using the HTTP notation, and this is roughly the kind of URL I get from the API for the repository (I tried to give the fullest possible example without exposing anything corporate :)):

https://exampleUrl.com/tfs/DefaultCollection/exampleProject/_git/exampleRepo

So between exampleUrl.com and exampleRepo there are at least four path segments. In all test examples, there are at most three. Could this affect the behavior?

Additionally: the path to a folder inside the repository in the browser looks like an extra parameter at the end:
path=%2Fexample-1%2Fexample-2%2Fexample-3.
But it feels like this is a secondary issue — it first needs to be able to access the repo at all.

silk crater
#

@dry palm thanks, I found all the tests and the regexes themselves… now I’ll think about whether anything can be done with this. But as I understand it, I’m supposed to match the last regex, since I’m using an on-prem solution - https://github.com/dagger/dagger/blob/fd5930a1787cc1d78624e3ae4783b301926de5ee/engine/vcs/vcs.go#L689C2-L700C1

GitHub

An open-source runtime for composable workflows. Great for AI agents and CI/CD. - dagger/dagger

dry palm
#

is the ssh format ssh.exampleurl.com in your organization case?

silk crater
#

I finally managed to fix the issue – I pushed it here: https://github.com/dagger/dagger/pull/11500.
I don't know about SSH; we don't use it at all. But I'll look into it later (not right now, unless it's a blocker). I'd like to merge it, as it significantly expands Dagger's usability for us)

GitHub

GitHub is where people build software. More than 150 million people use GitHub to discover, fork, and contribute to over 420 million projects.

dry palm
#

I'd like to see if we can also make sure that SSH cloning also works so we don't find any surprise in the future 🙏