resolveImportPath resolves an import path to an absolute file path
(importPath string, baseDir string)
| 231 | |
| 232 | // resolveImportPath resolves an import path to an absolute file path |
| 233 | func (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 |
no test coverage detected