#๐ does it make sense for `moduleSource
1 messages ยท Page 1 of 1 (latest)
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
๐ thx. Mostly asking because I'm fixing a daggerverse crawl issue and this looks a bit odd to me https://github.com/dagger/dagger.io//blob/5d7b6ff90af58d76730f7340fe1684a0b83a6a81/daggerverse/pkg/dagdb/jobs.go#L119-L127
how we're handling that validation. So just checking if that was intentional in the engine API
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.
going back to this, seems like asString actually tries to resolve the ref if I pass a fully qualified module url though like github.com/.....
that's why I got confused
seems like asString is not just returning the ref, but doing some resolving in "some" cases
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).