From df97a5bb93f406544bba0c6145e3533fc6f7ff31 Mon Sep 17 00:00:00 2001 From: Shreyas Goenka Date: Tue, 22 Oct 2024 01:29:04 +0200 Subject: [PATCH 1/2] Remove unnecessary API call in pipeline runner --- bundle/run/pipeline.go | 5 ----- 1 file changed, 5 deletions(-) diff --git a/bundle/run/pipeline.go b/bundle/run/pipeline.go index d684f838..092e6dcb 100644 --- a/bundle/run/pipeline.go +++ b/bundle/run/pipeline.go @@ -90,11 +90,6 @@ func (r *pipelineRunner) Run(ctx context.Context, opts *Options) (output.RunOutp // Include resource key in logger. ctx = log.NewContext(ctx, log.GetLogger(ctx).With("resource", r.Key())) w := r.bundle.WorkspaceClient() - _, err := w.Pipelines.GetByPipelineId(ctx, pipelineID) - if err != nil { - log.Warnf(ctx, "Cannot get pipeline: %s", err) - return nil, err - } req, err := opts.Pipeline.toPayload(r.pipeline, pipelineID) if err != nil { From 50af744a974f7ba3bc6ad1dbb406a4c007862628 Mon Sep 17 00:00:00 2001 From: Shreyas Goenka Date: Mon, 18 Nov 2024 16:32:41 +0100 Subject: [PATCH 2/2] fix test --- bundle/run/pipeline_test.go | 2 -- 1 file changed, 2 deletions(-) diff --git a/bundle/run/pipeline_test.go b/bundle/run/pipeline_test.go index e4608061..821e24d4 100644 --- a/bundle/run/pipeline_test.go +++ b/bundle/run/pipeline_test.go @@ -90,8 +90,6 @@ func TestPipelineRunnerRestart(t *testing.T) { PipelineId: "123", }).Return(mockWait, nil) - pipelineApi.EXPECT().GetByPipelineId(mock.Anything, "123").Return(&pipelines.GetPipelineResponse{}, nil) - // Mock runner starting a new update pipelineApi.EXPECT().StartUpdate(mock.Anything, pipelines.StartUpdate{ PipelineId: "123",