LOW: GetBuildDir parameter named appID but always called with app.Name #123

Open
opened 2026-02-21 09:52:19 +01:00 by clawbot · 0 comments
Collaborator

Bug

deploy.Service.GetBuildDir(appID string) is documented as taking an app ID, but all call sites pass app.Name:

  • cloneRepository() uses filepath.Join(svc.config.DataDir, "builds", app.Name) inline
  • cleanupCancelledDeploy() calls svc.GetBuildDir(app.Name)

The builds directory structure uses app names, not ULIDs. If anyone calls GetBuildDir with an actual app ID, the path will not match.

Files

  • internal/service/deploy/deploy.go:88 - GetBuildDir definition
  • internal/service/deploy/deploy.go - cloneRepository and cleanupCancelledDeploy

Fix

Rename parameter to appName and update doc comment, or make cloneRepository use GetBuildDir instead of constructing the path inline.

## Bug `deploy.Service.GetBuildDir(appID string)` is documented as taking an app ID, but all call sites pass `app.Name`: - `cloneRepository()` uses `filepath.Join(svc.config.DataDir, "builds", app.Name)` inline - `cleanupCancelledDeploy()` calls `svc.GetBuildDir(app.Name)` The builds directory structure uses app names, not ULIDs. If anyone calls `GetBuildDir` with an actual app ID, the path will not match. ## Files - `internal/service/deploy/deploy.go:88` - GetBuildDir definition - `internal/service/deploy/deploy.go` - cloneRepository and cleanupCancelledDeploy ## Fix Rename parameter to `appName` and update doc comment, or make `cloneRepository` use `GetBuildDir` instead of constructing the path inline.
Sign in to join this conversation.
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: sneak/upaas#123
No description provided.