Problem
findRepoRoot() in cmd/deploy_azure.go:377 creates a temporary directory with os.MkdirTemp, clones a DevLake repo into it, and returns the path. However, the caller (runDeployAzure) never removes the temporary directory after use.
go func findRepoRoot() (string, error) { if azureRepoURL != "" { tmpDir, err := os.MkdirTemp("", "devlake-clone-*") // ... return tmpDir, nil // caller never cleans up tmpDir } }
By contrast, deployLocalFork_clone in deploy_local.go:304-309 correctly uses defer os.RemoveAll(tmpDir).
Each Azure fork deploy leaks ~100MB+ of cloned source code in the system temp directory.
Fix
Either:
- Return a cleanup function alongside the path:
func findRepoRoot() (string, func(), error)
- Or have
runDeployAzure defer cleanup after calling findRepoRoot
Acceptance Criteria
Problem
findRepoRoot()incmd/deploy_azure.go:377creates a temporary directory withos.MkdirTemp, clones a DevLake repo into it, and returns the path. However, the caller (runDeployAzure) never removes the temporary directory after use.go func findRepoRoot() (string, error) { if azureRepoURL != "" { tmpDir, err := os.MkdirTemp("", "devlake-clone-*") // ... return tmpDir, nil // caller never cleans up tmpDir } }By contrast,
deployLocalFork_cloneindeploy_local.go:304-309correctly usesdefer os.RemoveAll(tmpDir).Each Azure fork deploy leaks ~100MB+ of cloned source code in the system temp directory.
Fix
Either:
func findRepoRoot() (string, func(), error)runDeployAzuredefer cleanup after callingfindRepoRootAcceptance Criteria
deploy_local.goalready handles this correctly)go build ./...andgo test ./...pass