-
Notifications
You must be signed in to change notification settings - Fork 14
[DEP-0] feat(sandbox): rename compute -> sandbox #451
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -1,4 +1,4 @@ | ||||||||||||||||||||||
| package compute | ||||||||||||||||||||||
| package sandbox | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| import ( | ||||||||||||||||||||||
| "fmt" | ||||||||||||||||||||||
|
|
@@ -11,20 +11,20 @@ import ( | |||||||||||||||||||||
| "github.com/spf13/cobra" | ||||||||||||||||||||||
| ) | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| func newComputeExec() *cobra.Command { | ||||||||||||||||||||||
| func newSandboxExec() *cobra.Command { | ||||||||||||||||||||||
| cmd := &cobra.Command{ | ||||||||||||||||||||||
| Use: "exec [flags]", | ||||||||||||||||||||||
| Short: "Execute a command within the compute", | ||||||||||||||||||||||
| Long: "Execute a command within the compute", | ||||||||||||||||||||||
| Example: ` | ||||||||||||||||||||||
| # execute command within the compute | ||||||||||||||||||||||
|
Comment on lines
17
to
20
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The help text still references "compute" instead of "sandbox". This creates inconsistent user-facing documentation. Should be updated to: Short: "Execute a command within the sandbox",
Long: "Execute a command within the sandbox",
Example: `
# execute command within the sandbox
Suggested change
Spotted by Graphite |
||||||||||||||||||||||
| depot compute exec --sandbox-id 1234567890 --session-id 1234567890 -- /bin/bash -lc whoami | ||||||||||||||||||||||
| depot sandbox exec --sandbox-id 1234567890 --session-id 1234567890 -- /bin/bash -lc whoami | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| # execute command with timeout (30 seconds) | ||||||||||||||||||||||
| depot compute exec --sandbox-id 1234567890 --session-id 1234567890 --timeout 30000 -- /bin/bash -lc whoami | ||||||||||||||||||||||
| depot sandbox exec --sandbox-id 1234567890 --session-id 1234567890 --timeout 30000 -- /bin/bash -lc whoami | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| # execute complex command | ||||||||||||||||||||||
| depot compute exec --sandbox-id 1234567890 --session-id 1234567890 -- /bin/bash -lc 'for i in {1..10}; do echo $i; sleep 1; done' | ||||||||||||||||||||||
| depot sandbox exec --sandbox-id 1234567890 --session-id 1234567890 -- /bin/bash -lc 'for i in {1..10}; do echo $i; sleep 1; done' | ||||||||||||||||||||||
| `, | ||||||||||||||||||||||
| Args: cobra.MinimumNArgs(1), | ||||||||||||||||||||||
| RunE: func(cmd *cobra.Command, args []string) error { | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -1,4 +1,4 @@ | ||||||||||||||||||||||
| package compute | ||||||||||||||||||||||
| package sandbox | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| import ( | ||||||||||||||||||||||
| "context" | ||||||||||||||||||||||
|
|
@@ -17,20 +17,20 @@ import ( | |||||||||||||||||||||
| "golang.org/x/term" | ||||||||||||||||||||||
| ) | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| func newComputePty() *cobra.Command { | ||||||||||||||||||||||
| func newSandboxPty() *cobra.Command { | ||||||||||||||||||||||
| cmd := &cobra.Command{ | ||||||||||||||||||||||
| Use: "pty [flags]", | ||||||||||||||||||||||
| Short: "Open a pseudo-terminal within the compute", | ||||||||||||||||||||||
| Long: "Open a pseudo-terminal within the compute", | ||||||||||||||||||||||
| Example: ` | ||||||||||||||||||||||
| # open a pseudo-terminal within the compute | ||||||||||||||||||||||
|
Comment on lines
23
to
26
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The help text still references "compute" instead of "sandbox". This creates inconsistent user-facing documentation. Should be updated to: Short: "Open a pseudo-terminal within the sandbox",
Long: "Open a pseudo-terminal within the sandbox",
Example: `
# open a pseudo-terminal within the sandbox
Suggested change
Spotted by Graphite |
||||||||||||||||||||||
| depot compute pty --sandbox-id 1234567890 --session-id 1234567890 | ||||||||||||||||||||||
| depot sandbox pty --sandbox-id 1234567890 --session-id 1234567890 | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| # set terminal workdir | ||||||||||||||||||||||
| depot compute pty --sandbox-id 1234567890 --session-id 1234567890 --cwd /tmp | ||||||||||||||||||||||
| depot sandbox pty --sandbox-id 1234567890 --session-id 1234567890 --cwd /tmp | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| # set terminal environment variables | ||||||||||||||||||||||
| depot compute pty --sandbox-id 1234567890 --session-id 1234567890 --env FOO=BAR --env BAR=FOO | ||||||||||||||||||||||
| depot sandbox pty --sandbox-id 1234567890 --session-id 1234567890 --env FOO=BAR --env BAR=FOO | ||||||||||||||||||||||
| `, | ||||||||||||||||||||||
| RunE: func(cmd *cobra.Command, args []string) error { | ||||||||||||||||||||||
| ctx := cmd.Context() | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,6 @@ | ||
| //go:build !windows | ||
|
|
||
| package compute | ||
| package sandbox | ||
|
|
||
| import ( | ||
| "context" | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| package compute | ||
| package sandbox | ||
|
|
||
| import ( | ||
| "context" | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -1,12 +1,12 @@ | ||||||||||||||
| package compute | ||||||||||||||
| package sandbox | ||||||||||||||
|
|
||||||||||||||
| import ( | ||||||||||||||
| "github.com/spf13/cobra" | ||||||||||||||
| ) | ||||||||||||||
|
|
||||||||||||||
| func NewCmdCompute() *cobra.Command { | ||||||||||||||
| func NewCmdSandbox() *cobra.Command { | ||||||||||||||
| cmd := &cobra.Command{ | ||||||||||||||
| Use: "compute [flags] [compute args...]", | ||||||||||||||
| Use: "sandbox [flags] [compute args...]", | ||||||||||||||
| Short: "Manage Depot compute", | ||||||||||||||
| Long: `Compute is the building block of Depot CI. | ||||||||||||||
|
Comment on lines
+9
to
11
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The help text still references "compute" instead of "sandbox". This creates inconsistent user-facing documentation. Should be updated to: Use: "sandbox [flags] [sandbox args...]",
Short: "Manage Depot sandbox",
Long: `Sandbox is the building block of Depot CI.
Suggested change
Spotted by Graphite |
||||||||||||||
|
|
||||||||||||||
|
|
@@ -20,9 +20,9 @@ Subcommands: | |||||||||||||
|
|
||||||||||||||
| cmd.PersistentFlags().String("token", "", "Depot API token") | ||||||||||||||
|
|
||||||||||||||
| cmd.AddCommand(newComputeExec()) | ||||||||||||||
| cmd.AddCommand(newComputePty()) | ||||||||||||||
| cmd.AddCommand(newComputeExecPipe()) | ||||||||||||||
| cmd.AddCommand(newSandboxExec()) | ||||||||||||||
| cmd.AddCommand(newSandboxPty()) | ||||||||||||||
| cmd.AddCommand(newSandboxExecPipe()) | ||||||||||||||
|
|
||||||||||||||
| return cmd | ||||||||||||||
| } | ||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The help text still references "compute" instead of "sandbox". This creates inconsistent user-facing documentation.
The Short, Long, and Example descriptions should be updated:
Spotted by Graphite

Is this helpful? React 👍 or 👎 to let us know.