Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions internal/providers/crownest/backend.go
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ func (b *backend) Run(ctx context.Context, req RunRequest) (result RunResult, re
SourceMeta: map[string]string{
"repo": repoName(req.Repo),
},
}, idempotencyKey("create", randomSuffix()))
}, idempotencyKey("create", shared.RandomSuffix()))
if err != nil {
if acquired && workspaceRun.SandboxID != "" {
return RunResult{}, b.cleanupCreateFailure(ctx, api, workspaceRun.SandboxID, err)
Expand Down Expand Up @@ -955,7 +955,3 @@ func repoName(repo Repo) string {
}
return repo.Root
}

func randomSuffix() string {
return shared.RandomSuffix()
}
6 changes: 1 addition & 5 deletions internal/providers/opencomputer/backend.go
Original file line number Diff line number Diff line change
Expand Up @@ -495,7 +495,7 @@ func newSandboxName(repo Repo) string {
if base == "" {
base = "crabbox"
}
return namePrefix + base + "-" + randomSuffix()
return namePrefix + base + "-" + shared.RandomSuffix()
}

func isReadyState(state string) bool {
Expand All @@ -518,10 +518,6 @@ func isTerminalState(state string) bool {
}
}

func randomSuffix() string {
return shared.RandomSuffix()
}

// openComputerWorkdir returns the configured absolute workspace path inside the
// sandbox, validating that it isn't relative, empty, or a broad system path.
func openComputerWorkdir(cfg Config) (string, error) {
Expand Down
6 changes: 1 addition & 5 deletions internal/providers/opensandbox/backend.go
Original file line number Diff line number Diff line change
Expand Up @@ -1011,11 +1011,7 @@ func newSandboxName(repo Repo) string {
if base == "" {
base = "crabbox"
}
return namePrefix + base + "-" + randomSuffix()
}

func randomSuffix() string {
return shared.RandomSuffix()
return namePrefix + base + "-" + shared.RandomSuffix()
}

func (b *openSandboxBackend) cleanupContext(ctx context.Context) (context.Context, context.CancelFunc) {
Expand Down
6 changes: 1 addition & 5 deletions internal/providers/superserve/backend.go
Original file line number Diff line number Diff line change
Expand Up @@ -804,7 +804,7 @@ func newSandboxName(repo Repo) string {
if len(base) > 40 {
base = strings.Trim(base[:40], "-")
}
return namePrefix + base + "-" + randomSuffix()
return namePrefix + base + "-" + shared.RandomSuffix()
}

func repoScope(repo Repo) string {
Expand All @@ -816,10 +816,6 @@ func repoScope(repo Repo) string {
return "repo-sha256:" + hex.EncodeToString(sum[:8])
}

func randomSuffix() string {
return shared.RandomSuffix()
}

func timeoutOrDefault(primary, fallback time.Duration) time.Duration {
if primary > 0 {
return primary
Expand Down
6 changes: 1 addition & 5 deletions internal/providers/vercelsandbox/backend.go
Original file line number Diff line number Diff line change
Expand Up @@ -802,7 +802,7 @@ func newSandboxName(repo Repo) string {
if len(base) > 40 {
base = strings.Trim(base[:40], "-")
}
return "crabbox-" + base + "-" + randomSuffix()
return "crabbox-" + base + "-" + shared.RandomSuffix()
}

func repoScope(repo Repo) string {
Expand All @@ -814,10 +814,6 @@ func repoScope(repo Repo) string {
return "repo-sha256:" + hex.EncodeToString(sum[:8])
}

func randomSuffix() string {
return shared.RandomSuffix()
}

func timeoutOrDefault(primary, fallback time.Duration) time.Duration {
if primary > 0 {
return primary
Expand Down