From fbefb91f37d1fa800632ef99e34440720d6f7c2d Mon Sep 17 00:00:00 2001 From: Rutvij Mehta Date: Mon, 5 Feb 2024 12:22:35 -0800 Subject: [PATCH] Add optimization state to step response (#418) --- command/config/config.go | 2 +- command/harness/dlite/execute.go | 2 +- command/harness/dlite/response.go | 1 + go.mod | 2 +- go.sum | 4 ++-- 5 files changed, 6 insertions(+), 5 deletions(-) diff --git a/command/config/config.go b/command/config/config.go index 5db7529b..cace2563 100644 --- a/command/config/config.go +++ b/command/config/config.go @@ -326,7 +326,7 @@ type EnvConfig struct { PluginBinaryURI string `envconfig:"DRONE_PLUGIN_BINARY_URI" default:"https://github.com/drone/plugin/releases/download/v0.3.5-beta"` } LiteEngine struct { - Path string `envconfig:"DRONE_LITE_ENGINE_PATH" default:"https://github.com/harness/lite-engine/releases/download/v0.5.59/"` + Path string `envconfig:"DRONE_LITE_ENGINE_PATH" default:"https://github.com/harness/lite-engine/releases/download/v0.5.60/"` EnableMock bool `envconfig:"DRONE_LITE_ENGINE_ENABLE_MOCK"` MockStepTimeoutSecs int `envconfig:"DRONE_LITE_ENGINE_MOCK_STEP_TIMEOUT_SECS" default:"120"` } diff --git a/command/harness/dlite/execute.go b/command/harness/dlite/execute.go index 41922d7e..d2901faf 100644 --- a/command/harness/dlite/execute.go +++ b/command/harness/dlite/execute.go @@ -120,7 +120,7 @@ func (t *VMExecuteTask) handleResponse(w http.ResponseWriter, resp *api.PollStep // convert poll response to a Vm task execution response func convert(r *api.PollStepResponse) VMTaskExecutionResponse { if r.Error == "" { - return VMTaskExecutionResponse{CommandExecutionStatus: Success, OutputVars: r.Outputs, Artifact: r.Artifact, Outputs: r.OutputV2} + return VMTaskExecutionResponse{CommandExecutionStatus: Success, OutputVars: r.Outputs, Artifact: r.Artifact, Outputs: r.OutputV2, OptimizationState: r.OptimizationState} } return VMTaskExecutionResponse{CommandExecutionStatus: Failure, ErrorMessage: r.Error} } diff --git a/command/harness/dlite/response.go b/command/harness/dlite/response.go index e5af67f9..2cfe6a21 100644 --- a/command/harness/dlite/response.go +++ b/command/harness/dlite/response.go @@ -12,6 +12,7 @@ type VMTaskExecutionResponse struct { Artifact []byte `json:"artifact,omitempty"` PoolDriverUsed string `json:"pool_driver_used"` Outputs []*api.OutputV2 `json:"outputs"` + OptimizationState string `json:"optimization_state"` } type DelegateMetaInfo struct { diff --git a/go.mod b/go.mod index 1c93be4d..f8db8903 100644 --- a/go.mod +++ b/go.mod @@ -24,7 +24,7 @@ require ( github.com/google/go-cmp v0.5.9 github.com/google/uuid v1.3.0 github.com/google/wire v0.5.0 - github.com/harness/lite-engine v0.5.59 + github.com/harness/lite-engine v0.5.60 github.com/hashicorp/nomad/api v0.0.0-20230421025320-b4e6a70fe69b github.com/jmoiron/sqlx v1.3.5 github.com/joho/godotenv v1.5.1 diff --git a/go.sum b/go.sum index d57df2ee..039ad189 100644 --- a/go.sum +++ b/go.sum @@ -228,8 +228,8 @@ github.com/grpc-ecosystem/go-grpc-middleware v1.0.1-0.20190118093823-f849b5445de github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= github.com/grpc-ecosystem/grpc-gateway v1.9.5/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= -github.com/harness/lite-engine v0.5.59 h1:/GB2bULaM87GSopTdx4PbNgqv7pduE+hBjc3uAmQSr4= -github.com/harness/lite-engine v0.5.59/go.mod h1:fh48l8VQvTz1RbxQBZ6JbMvqSngaMBJaAmPNXScJGEU= +github.com/harness/lite-engine v0.5.60 h1:XeoqQ1Z0UyICd9TAViBfFkFl3qoO/Za3TSDOBljs2E0= +github.com/harness/lite-engine v0.5.60/go.mod h1:OcY2p9RxEhnj/JeBYQ674ubQrZ2EJW4Qh3dkCowJ97E= github.com/hashicorp/consul/api v1.3.0/go.mod h1:MmDNSzIMUjNpY/mQ398R4bk2FnqQLoPndWW5VkKPlCE= github.com/hashicorp/consul/sdk v0.3.0/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8= github.com/hashicorp/cronexpr v1.1.1 h1:NJZDd87hGXjoZBdvyCF9mX4DCq5Wy7+A/w+A7q0wn6c=