feat: SSH Command from Files#5358
Conversation
Signed-off-by: André Calil <andre@calil.com.br>
|
👋 Commands for maintainers:
|
Signed-off-by: André Calil <andre@calil.com.br>
Docs Impact ReviewThe SSH component reference will auto-update, but the Files concept page needs a new section explaining that user-defined scripts can be stored in the repository and referenced by components. Suggested docs updates:
Why: The PR introduces a new Maintainers: Reply with Posted automatically by warp-gateway · commit 434bbc3 |
|
/docs-agree |
|
Tracking docs update in superplanehq/docs#115: superplanehq/docs#115 Assigned @AleksandarCole. |
Signed-off-by: André Calil <andre@calil.com.br>
…-file Signed-off-by: André Calil <andre@calil.com.br>
Signed-off-by: André Calil <andre@calil.com.br>
Signed-off-by: André Calil <andre@calil.com.br>
Signed-off-by: André Calil <andre@calil.com.br>
Signed-off-by: André Calil <andre@calil.com.br>
Signed-off-by: André Calil <andre@calil.com.br>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 948b78a. Configure here.
Signed-off-by: André Calil <andre@calil.com.br>
| // (pipefail, declare -A) that the &&-join would destroy. | ||
| func (c *SSHCommand) buildExecutionCommand(metadata ExecutionMetadata) (string, error) { | ||
| if metadata.CommandSource == CommandSourceFile { | ||
| return c.buildScriptCommand(metadata.WorkingDirectory, metadata.Environment, metadata.Commands), nil |
There was a problem hiding this comment.
Why are we storing the file contents in the node metadata?
| func (c *SSHCommand) buildScriptCommand(workingDirectory string, environment []EnvironmentVariable, script string) string { | ||
| finalScript := script | ||
| if workingDirectory != "" { | ||
| finalScript = fmt.Sprintf("cd %s || exit 1\n%s", shellQuote(workingDirectory), script) |
There was a problem hiding this comment.
What if when using a file, we actually copied that file into the host, and executed the file with bash? I'm guessing that would make the experience of using multi-line or full-on scripts a lot easier
There was a problem hiding this comment.
Interesting. Addressing this now.

Summary
Introduces a new source option for SSH commands:
inline(current) orfile.This should offer a better UX for large commands.
Resolves #5344