fix(#146): reuse resolved doc-map path from early validation in Step 6c
PR Ready Gate / clear-labels (pull_request) Successful in 2s
CI / test (pull_request) Successful in 17s
CI / review (anthropic--claude-4.6-sonnet, sonnet, SONNET_REVIEW_TOKEN) (pull_request) Successful in 25s
CI / review (gpt-5, gpt, GPT_REVIEW_TOKEN) (pull_request) Successful in 43s
CI / review (gpt-5, security, ., rodin/security-patterns, SECURITY_REVIEW.md, SECURITY_REVIEW_TOKEN) (pull_request) Successful in 1m15s
PR Ready Gate / clear-labels (pull_request) Successful in 2s
CI / test (pull_request) Successful in 17s
CI / review (anthropic--claude-4.6-sonnet, sonnet, SONNET_REVIEW_TOKEN) (pull_request) Successful in 25s
CI / review (gpt-5, gpt, GPT_REVIEW_TOKEN) (pull_request) Successful in 43s
CI / review (gpt-5, security, ., rodin/security-patterns, SECURITY_REVIEW.md, SECURITY_REVIEW_TOKEN) (pull_request) Successful in 1m15s
Addresses sonnet/gpt NIT: early validateWorkspacePath call at line 176 discarded the resolved path (using _), then Step 6c called it again. Store the resolved path in resolvedDocMapFile and reuse it downstream, eliminating the redundant EvalSymlinks syscall on the happy path.
This commit is contained in:
@@ -174,11 +174,14 @@ func main() {
|
||||
}
|
||||
|
||||
// Early validation of filesystem-path flags (fail fast before network I/O)
|
||||
var resolvedDocMapFile string
|
||||
if *docMapFile != "" {
|
||||
if _, err := validateWorkspacePath(*docMapFile, "doc-map"); err != nil {
|
||||
resolved, err := validateWorkspacePath(*docMapFile, "doc-map")
|
||||
if err != nil {
|
||||
slog.Error("invalid doc-map path", "error", err)
|
||||
os.Exit(1)
|
||||
}
|
||||
resolvedDocMapFile = resolved
|
||||
}
|
||||
|
||||
// Initialize clients
|
||||
@@ -365,12 +368,7 @@ func main() {
|
||||
// Step 6c: Load path-scoped design docs if doc-map specified
|
||||
designDocs := ""
|
||||
if *docMapFile != "" {
|
||||
resolvedDocMap, err := validateWorkspacePath(*docMapFile, "doc-map")
|
||||
if err != nil {
|
||||
slog.Error("invalid doc-map path", "error", err)
|
||||
os.Exit(1)
|
||||
}
|
||||
docMapCfg, err := review.ParseDocMapConfig(resolvedDocMap)
|
||||
docMapCfg, err := review.ParseDocMapConfig(resolvedDocMapFile)
|
||||
if err != nil {
|
||||
slog.Error("failed to parse doc-map file", "file", *docMapFile, "error", err)
|
||||
os.Exit(1)
|
||||
|
||||
Reference in New Issue
Block a user