#.netrc loading

1 messages ยท Page 1 of 1 (latest)

flat hedge
#

can you share what you're doing to get the repos?

#

if it's inside a module, you need to provide the creds - the automatic netrc provisioning only works at the top most level (like in the shell)

#

this is for security - allowing any module to just use your creds implicitly is a pretty big break in sandboxing

quaint kettle
#

I'm in a code repo (locally checked out) and trying to do

dagger call -m <git_repo>/<path>/<module> build

#

I've tried with and without https:// before git_repo

#

It's talking to gitlab

flat hedge
#

hm it should be able to read netrc ๐Ÿค”

#

are you using dagger cloud? if you have a link to a trace, that might help me debug a bit further

quaint kettle
#

No, we're still POCing

#

So all just local

flat hedge
#

obviously, don't share your netrc exactly, but would be curious if there's anything special in the format

#

are you using macdef?

quaint kettle
#

I don't think so:

machine <host>
login <user>
password <token>

#

I don't think so. I'm not sure I know what macdef is. ๐Ÿ˜„

flat hedge
#

and host is just the gitlab host?

#

that is the same as in git_repo

quaint kettle
#

Correct

#

no https, just the hostname

flat hedge
#

there's no port in the hostname in either case?

quaint kettle
#

It's possible I have the path wrong? The URl in a browser, like github. have <repo>/~/tree.... bits. I assume that is not needed, and it should be the path as I would see it locally ie <repo>/<path>/<module

#

Correct, no port

#

Hrm, I wonder if it has something to do with me being on a mac? The credential helper for my git config is osxkeychain

flat hedge
#

is your netrc encrypted using the osxkeychain?

quaint kettle
#

No. I'm not sure how that would be done. ๐Ÿ˜„ It's clear text in my homedir. I update that file when my token changes.

flat hedge
#

mm okay, so potentially having a credential helper could be getting in the way here

#

if you just temporarily disable that - does it work?

flat hedge
quaint kettle
#

Just to verify, I looked in mac Keychain Access (which took forever to find as Apple is hiding it) and I don't see anything in there listed under git or our code repo.

flat hedge
#

okay, just to confirm, something like this works for me:

โฏ cat ~/.netrc
machine github.com
    login git
    password ...
โฏ dagger functions -m github.com/dagger/dagger.io/api

Name             Description
build            -
#

does just using functions work for you?

#

sorry, i'm trying my best here ๐Ÿ˜… i can't seem to repro properly

quaint kettle
#

Lemme try functions. I've not tried that.

#

I'm still new to dagger, so didn't even know about that

#

functions gives same error. ๐Ÿ™

#

Maybe relevent, but the path I provide is <repo>/a/b/c/d/e/module, but the error complains about not being able to find <repo>/a/b. In my example c is the actual git repo (where would would append .git), and d/e are dirs in that repo

flat hedge
#

what git hosting provider are you using

quaint kettle
#

Gitlab

flat hedge
#

sorry yes you said ๐Ÿ˜…

quaint kettle
#

No worries. ๐Ÿ˜„

flat hedge
#

@grave dew do you know if there's anything else we need here?

#

if you change to have /a/b/c.git/d/e/module

#

does that fix anything

#

i remember something about that a while back

quaint kettle
#

That worked. I swear I tried that in my trials

#

Ah, I think I tried it when I was trying to access a branch on the repo

flat hedge
#

yayyy

#

nice nice

quaint kettle
#

TY!

grave dew
# flat hedge if you change to have `/a/b/c.git/d/e/module`

Yeah exactly. I suppose you're working with a private gitlab remote ? Unfortunately, the .git is the only way to properly parse those remotes to distinguish between subdirectories and the root of the repo, from the ref, for this provider

flat hedge
#

where's the logic that handles that? ๐Ÿ˜…

grave dew