#๐Ÿ‘‹ does it make sense for `moduleSource

1 messages ยท Page 1 of 1 (latest)

static wadi
#

Yes, it's just a ref string at that point. There's other APIs on ModuleSource that actually trigger trying to load/resolve the ref, which is where errors could happen if it's invalid

meager parcel
#

how we're handling that validation. So just checking if that was intentional in the engine API

static wadi
#

It just returns an error there because you are querying a scalar, so it's synchronously eval'd, which involves an actual query being submitted etc.

meager parcel
#

that's why I got confused

#

seems like asString is not just returning the ref, but doing some resolving in "some" cases

static wadi
# meager parcel going back to this, seems like `asString` actually tries to resolve the ref if I...

Yeah that's true, in the git ref case it does actually verify that the git repo exists and resolves to a commit (if needed), but it doesn't try to load anything as a module yet: https://github.com/sipsma/dagger/blob/ed47994a0375a5041951f604e12c16ae9a95d216/core/schema/modulesource.go#L101-L101

Locals refs don't do as much because they technically can be local refs to the caller's filesystem or local refs relative to another ModuleSource (i.e. you have a git repo with multiple modules that depend on each other, then the dependency is technically a local ref, but "local to the git repo" if that makes sense).