Coordinate workspace cleanup with active operations

This commit is contained in:
2026-12-01 20:17:27 +00:00
parent 038105ece9
commit 9e3fc25fdd
15 changed files with 358 additions and 32 deletions

View File

@@ -85,6 +85,14 @@ func cleanSelectedSession(ctx context.Context, input *cleanCommandInput, deps co
if err != nil {
return report, err
}
if !input.DryRun {
store := deps.newWorkspaceStore(pipeline.Workspace.Root)
lock, lockErr := store.AcquireWorkspaceLockContext(ctx)
if lockErr != nil {
return report, fmt.Errorf("clean: acquire workspace lock: %w", lockErr)
}
defer func() { err = errors.Join(err, store.ReleaseWorkspaceLock(lock)) }()
}
appendTarget := func(root, target, policy string, directory bool) error {
if err := ctx.Err(); err != nil {
return err