MCPcopy Create free account
hub / github.com/github/gh-aw / resolveImportPath

Method resolveImportPath

pkg/cli/dependency_graph.go:233–250  ·  view source on GitHub ↗

resolveImportPath resolves an import path to an absolute file path

(importPath string, baseDir string)

Source from the content-addressed store, hash-verified

231
232// resolveImportPath resolves an import path to an absolute file path
233func (g *DependencyGraph) resolveImportPath(importPath string, baseDir string) string {
234 gitRoot, err := findGitRootForPath(g.workflowsDir)
235 if err != nil {
236 depGraphLog.Printf("Failed to find git root, using fallback: %v", err)
237 gitRoot = g.workflowsDir
238 }
239 fullPath := resolveImportPath(importPath, baseDir, importPathResolverOpts{
240 StripSectionRef: true,
241 UseParserFallback: true,
242 ParserGitRoot: gitRoot,
243 })
244 if fullPath != "" {
245 depGraphLog.Printf("Resolved import %s to %s", importPath, fullPath)
246 } else {
247 depGraphLog.Printf("Failed to resolve import path %s", importPath)
248 }
249 return fullPath
250}
251
252// GetAffectedWorkflows returns the list of workflows that need to be recompiled
253// when the given file is modified

Callers 1

Calls 3

findGitRootForPathFunction · 0.85
resolveImportPathFunction · 0.85
PrintfMethod · 0.45

Tested by

no test coverage detected