From d7fdbc5fa56f81a9194a68f37d1ab9549dc45abd Mon Sep 17 00:00:00 2001 From: Gyanendra Mishra Date: Fri, 16 Feb 2024 22:03:21 +0530 Subject: [PATCH] fix: improved some descriptions for starlark instructions (#2168) Kevin had given some feedback on #2147 ; this PR works on those --- .../kurtosis_instruction/tasks/run_python.go | 2 +- .../kurtosis_instruction/tasks/run_sh.go | 9 +++++++-- .../kurtosis_instruction/upload_files/upload_files.go | 2 +- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/core/server/api_container/server/startosis_engine/kurtosis_instruction/tasks/run_python.go b/core/server/api_container/server/startosis_engine/kurtosis_instruction/tasks/run_python.go index 87c3e508cf..5ebd17ac9f 100644 --- a/core/server/api_container/server/startosis_engine/kurtosis_instruction/tasks/run_python.go +++ b/core/server/api_container/server/startosis_engine/kurtosis_instruction/tasks/run_python.go @@ -328,7 +328,7 @@ func (builtin *RunPythonCapabilities) FillPersistableAttributes(builder *enclave } func (builtin *RunPythonCapabilities) Description() string { - return "Running a one time python script" + return "Running Python script" } func setupRequiredPackages(ctx context.Context, builtin *RunPythonCapabilities) (*exec_result.ExecResult, error) { diff --git a/core/server/api_container/server/startosis_engine/kurtosis_instruction/tasks/run_sh.go b/core/server/api_container/server/startosis_engine/kurtosis_instruction/tasks/run_sh.go index 4935dacb60..324fe2024b 100644 --- a/core/server/api_container/server/startosis_engine/kurtosis_instruction/tasks/run_sh.go +++ b/core/server/api_container/server/startosis_engine/kurtosis_instruction/tasks/run_sh.go @@ -26,7 +26,9 @@ import ( const ( RunShBuiltinName = "run_sh" - defaultRunShImageName = "badouralix/curl-jq" + defaultRunShImageName = "badouralix/curl-jq" + shScriptPrintCharLimit = 80 + runningShScriptPrefix = "Running sh script" ) func NewRunShService(serviceNetwork service_network.ServiceNetwork, runtimeValueStore *runtime_value_store.RuntimeValueStore, nonBlockingMode bool) *kurtosis_plan_instruction.KurtosisPlanInstruction { @@ -273,7 +275,10 @@ func (builtin *RunShCapabilities) FillPersistableAttributes(builder *enclave_pla } func (builtin *RunShCapabilities) Description() string { - return "Running a one time bash script" + if len(builtin.run) < shScriptPrintCharLimit { + return fmt.Sprintf("%v: `%v`", runningShScriptPrefix, builtin.run) + } + return runningShScriptPrefix } func getCommandToRun(builtin *RunShCapabilities) (string, error) { diff --git a/core/server/api_container/server/startosis_engine/kurtosis_instruction/upload_files/upload_files.go b/core/server/api_container/server/startosis_engine/kurtosis_instruction/upload_files/upload_files.go index 8c5a9e932a..0178ec8e21 100644 --- a/core/server/api_container/server/startosis_engine/kurtosis_instruction/upload_files/upload_files.go +++ b/core/server/api_container/server/startosis_engine/kurtosis_instruction/upload_files/upload_files.go @@ -215,5 +215,5 @@ func (builtin *UploadFilesCapabilities) FillPersistableAttributes(builder *encla } func (builtin *UploadFilesCapabilities) Description() string { - return fmt.Sprintf("Uploading file '%v' to files articact '%v'", builtin.src, builtin.artifactName) + return fmt.Sprintf("Uploading file '%v' to files artifact '%v'", builtin.src, builtin.artifactName) }