Skip to content
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

feat: added a description field to instructions #2147

Merged
merged 7 commits into from Feb 15, 2024
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view

Large diffs are not rendered by default.

Expand Up @@ -263,13 +263,14 @@ func NewStarlarkRunResponseLineFromRunSuccessEvent(serializedOutputObject string
}
}

func NewStarlarkInstruction(position *kurtosis_core_rpc_api_bindings.StarlarkInstructionPosition, name string, executableInstruction string, arguments []*kurtosis_core_rpc_api_bindings.StarlarkInstructionArg, isSkipped bool) *kurtosis_core_rpc_api_bindings.StarlarkInstruction {
func NewStarlarkInstruction(position *kurtosis_core_rpc_api_bindings.StarlarkInstructionPosition, name string, executableInstruction string, arguments []*kurtosis_core_rpc_api_bindings.StarlarkInstructionArg, isSkipped bool, description string) *kurtosis_core_rpc_api_bindings.StarlarkInstruction {
return &kurtosis_core_rpc_api_bindings.StarlarkInstruction{
InstructionName: name,
Position: position,
ExecutableInstruction: executableInstruction,
Arguments: arguments,
IsSkipped: isSkipped,
Description: description,
}
}

Expand Down
2 changes: 2 additions & 0 deletions api/protobuf/core/api_container_service.proto
Expand Up @@ -256,6 +256,8 @@ message StarlarkInstruction {
string executable_instruction = 4;

bool is_skipped = 5;

string description = 6;
}

message StarlarkInstructionResult {
Expand Down
2 changes: 2 additions & 0 deletions api/rust/src/api_container_api.rs
Expand Up @@ -308,6 +308,8 @@ pub struct StarlarkInstruction {
pub executable_instruction: ::prost::alloc::string::String,
#[prost(bool, tag = "5")]
pub is_skipped: bool,
#[prost(string, tag = "6")]
pub description: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
Expand Down
Expand Up @@ -502,6 +502,9 @@ export class StarlarkInstruction extends jspb.Message {
getIsSkipped(): boolean;
setIsSkipped(value: boolean): StarlarkInstruction;

getDescription(): string;
setDescription(value: string): StarlarkInstruction;

serializeBinary(): Uint8Array;
toObject(includeInstance?: boolean): StarlarkInstruction.AsObject;
static toObject(includeInstance: boolean, msg: StarlarkInstruction): StarlarkInstruction.AsObject;
Expand All @@ -517,6 +520,7 @@ export namespace StarlarkInstruction {
argumentsList: Array<StarlarkInstructionArg.AsObject>,
executableInstruction: string,
isSkipped: boolean,
description: string,
}
}

Expand Down
Expand Up @@ -3972,7 +3972,8 @@ proto.api_container_api.StarlarkInstruction.toObject = function(includeInstance,
argumentsList: jspb.Message.toObjectList(msg.getArgumentsList(),
proto.api_container_api.StarlarkInstructionArg.toObject, includeInstance),
executableInstruction: jspb.Message.getFieldWithDefault(msg, 4, ""),
isSkipped: jspb.Message.getBooleanFieldWithDefault(msg, 5, false)
isSkipped: jspb.Message.getBooleanFieldWithDefault(msg, 5, false),
description: jspb.Message.getFieldWithDefault(msg, 6, "")
};

if (includeInstance) {
Expand Down Expand Up @@ -4031,6 +4032,10 @@ proto.api_container_api.StarlarkInstruction.deserializeBinaryFromReader = functi
var value = /** @type {boolean} */ (reader.readBool());
msg.setIsSkipped(value);
break;
case 6:
var value = /** @type {string} */ (reader.readString());
msg.setDescription(value);
break;
default:
reader.skipField();
break;
Expand Down Expand Up @@ -4097,6 +4102,13 @@ proto.api_container_api.StarlarkInstruction.serializeBinaryToWriter = function(m
f
);
}
f = message.getDescription();
if (f.length > 0) {
writer.writeString(
6,
f
);
}
};


Expand Down Expand Up @@ -4229,6 +4241,24 @@ proto.api_container_api.StarlarkInstruction.prototype.setIsSkipped = function(va
};


/**
* optional string description = 6;
* @return {string}
*/
proto.api_container_api.StarlarkInstruction.prototype.getDescription = function() {
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 6, ""));
};


/**
* @param {string} value
* @return {!proto.api_container_api.StarlarkInstruction} returns this
*/
proto.api_container_api.StarlarkInstruction.prototype.setDescription = function(value) {
return jspb.Message.setProto3StringField(this, 6, value);
};





Expand Down
Expand Up @@ -653,6 +653,11 @@ export declare class StarlarkInstruction extends Message<StarlarkInstruction> {
*/
isSkipped: boolean;

/**
* @generated from field: string description = 6;
*/
description: string;

constructor(data?: PartialMessage<StarlarkInstruction>);

static readonly runtime: typeof proto3;
Expand Down
Expand Up @@ -226,6 +226,7 @@ export const StarlarkInstruction = proto3.makeMessageType(
{ no: 3, name: "arguments", kind: "message", T: StarlarkInstructionArg, repeated: true },
{ no: 4, name: "executable_instruction", kind: "scalar", T: 9 /* ScalarType.STRING */ },
{ no: 5, name: "is_skipped", kind: "scalar", T: 8 /* ScalarType.BOOL */ },
{ no: 6, name: "description", kind: "scalar", T: 9 /* ScalarType.STRING */ },
],
);

Expand Down
1 change: 1 addition & 0 deletions cli/cli/command_args/run/verbosity.go
Expand Up @@ -8,4 +8,5 @@ const (
Detailed
Executable
OutputOnly
Description
)
12 changes: 8 additions & 4 deletions cli/cli/command_args/run/verbosity_enumer.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion cli/cli/commands/run/run.go
Expand Up @@ -140,7 +140,7 @@ var StarlarkRunCmd = &engine_consuming_kurtosis_command.EngineConsumingKurtosisC
},
{
Key: verbosityFlagKey,
Usage: fmt.Sprintf("The verbosity of the command output: %s. If unset, it defaults to `brief` for a concise and explicit output. Use `detailed` to display the exhaustive list of arguments for each command. `executable` will generate executable Starlark instructions.", strings.Join(command_args_run.VerbosityStrings(), ", ")),
Usage: fmt.Sprintf("The verbosity of the command output: %s. If unset, it defaults to `brief` for a concise and explicit output. Use `detailed` to display the exhaustive list of arguments for each command. `executable` will generate executable Starlark instructions. `description` will just print a description of what is about to happen without any details", strings.Join(command_args_run.VerbosityStrings(), ", ")),
Type: flags.FlagType_String,
Shorthand: "v",
Default: defaultVerbosity,
Expand Down
19 changes: 8 additions & 11 deletions cli/cli/go.mod
@@ -1,6 +1,8 @@
module github.com/kurtosis-tech/kurtosis/cli/cli

go 1.20
go 1.21

toolchain go1.21.3

replace (
github.com/kurtosis-tech/kurtosis/api/golang => ../../api/golang
Expand Down Expand Up @@ -50,9 +52,7 @@ require (
github.com/cli/oauth v1.0.1
github.com/compose-spec/compose-go v1.17.0
github.com/fatih/color v1.13.0
github.com/go-git/go-git/v5 v5.11.0
github.com/google/go-github/v50 v50.2.0
github.com/henvic/httpretty v0.1.3
github.com/joho/godotenv v1.5.1
github.com/kurtosis-tech/kurtosis-portal/api/golang v0.0.0-20230818182330-1a86869414d2
github.com/kurtosis-tech/kurtosis/cloud/api/golang v0.0.0
Expand Down Expand Up @@ -84,7 +84,6 @@ require (
github.com/cloudflare/circl v1.3.3 // indirect
github.com/containerd/containerd v1.7.2 // indirect
github.com/containerd/typeurl/v2 v2.1.1 // indirect
github.com/cyphar/filepath-securejoin v0.2.4 // indirect
github.com/danieljoos/wincred v1.2.0 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f // indirect
Expand All @@ -99,9 +98,7 @@ require (
github.com/gammazero/workerpool v1.1.2 // indirect
github.com/ghodss/yaml v1.0.0 // indirect
github.com/gin-gonic/gin v1.9.1 // indirect
github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 // indirect
github.com/go-git/go-billy/v5 v5.5.0 // indirect
github.com/go-logr/logr v1.2.3 // indirect
github.com/go-logr/logr v1.2.4 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
github.com/go-openapi/jsonpointer v0.19.6 // indirect
github.com/go-openapi/jsonreference v0.20.1 // indirect
Expand All @@ -110,7 +107,6 @@ require (
github.com/godbus/dbus/v5 v5.1.0 // indirect
github.com/gogo/googleapis v1.4.1 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/golang/protobuf v1.5.3 // indirect
github.com/golang/snappy v0.0.4 // indirect
github.com/google/gnostic v0.5.7-v3refs // indirect
Expand All @@ -121,10 +117,10 @@ require (
github.com/google/uuid v1.4.0 // indirect
github.com/gorilla/websocket v1.5.1 // indirect
github.com/grpc-ecosystem/go-grpc-middleware v1.3.0 // indirect
github.com/henvic/httpretty v0.1.3 // indirect
github.com/imdario/mergo v0.3.16 // indirect
github.com/improbable-eng/grpc-web v0.15.0 // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/klauspost/compress v1.17.2 // indirect
Expand All @@ -146,15 +142,17 @@ require (
github.com/muesli/termenv v0.13.0 // indirect
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
github.com/nwaples/rardecode v1.1.3 // indirect
github.com/onsi/ginkgo/v2 v2.11.0 // indirect
github.com/onsi/gomega v1.27.10 // indirect
github.com/opencontainers/go-digest v1.0.0 // indirect
github.com/opencontainers/image-spec v1.1.0-rc3 // indirect
github.com/pascaldekloe/name v1.0.1 // indirect
github.com/pelletier/go-toml/v2 v2.0.9 // indirect
github.com/pierrec/lz4 v2.6.1+incompatible // indirect
github.com/pjbgf/sha1cd v0.3.0 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/rivo/uniseg v0.4.4 // indirect
github.com/rogpeppe/go-internal v1.11.0 // indirect
github.com/rs/cors v1.9.0 // indirect
github.com/segmentio/backo-go v1.0.0 // indirect
github.com/segmentio/encoding v0.2.7 // indirect
Expand Down Expand Up @@ -198,7 +196,6 @@ require (
google.golang.org/genproto/googleapis/rpc v0.0.0-20230706204954-ccb25ca9f130 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/segmentio/analytics-go.v3 v3.1.0 // indirect
gopkg.in/warnings.v0 v0.1.2 // indirect
k8s.io/klog/v2 v2.90.1 // indirect
k8s.io/kube-openapi v0.0.0-20230501164219-8b0f38b5fd1f // indirect
nhooyr.io/websocket v1.8.7 // indirect
Expand Down