(src *core.ModuleSource)
| 37 | } |
| 38 | |
| 39 | func canonicalModuleReference(src *core.ModuleSource) string { |
| 40 | sourceSubpath := src.SourceSubpath |
| 41 | if sourceSubpath == "" { |
| 42 | sourceSubpath = src.SourceRootSubpath |
| 43 | } |
| 44 | |
| 45 | switch src.Kind { |
| 46 | case core.ModuleSourceKindLocal: |
| 47 | return filepath.Clean(filepath.Join(src.Local.ContextDirectoryPath, sourceSubpath)) |
| 48 | case core.ModuleSourceKindGit: |
| 49 | return core.GitRefString(src.Git.CloneRef, sourceSubpath, "") |
| 50 | default: |
| 51 | // Fallback for non-local/non-git sources. |
| 52 | return src.AsString() |
| 53 | } |
| 54 | } |
| 55 | |
| 56 | // ensureWorkspaceLoaded detects the workspace from the client's working directory |
| 57 | // and loads all configured modules onto the dagql server. Called from serveQuery |
no test coverage detected