MCPcopy Index your code
hub / github.com/dagger/dagger / canonicalModuleReference

Function canonicalModuleReference

engine/server/session_workspaces.go:39–54  ·  view source on GitHub ↗
(src *core.ModuleSource)

Source from the content-addressed store, hash-verified

37}
38
39func 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

Callers 1

isSameModuleReferenceFunction · 0.85

Calls 2

GitRefStringFunction · 0.92
AsStringMethod · 0.45

Tested by

no test coverage detected