Skip to content
This repository has been archived by the owner on Oct 9, 2023. It is now read-only.

Remove legacy fetch for workflow execution inputs #173

Merged
merged 2 commits into from
Mar 31, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 0 additions & 19 deletions pkg/manager/impl/execution_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -1034,25 +1034,6 @@ func (m *ExecutionManager) GetExecution(
return nil, transformerErr
}

// TO BE DELETED
// TODO: Remove the publishing to deprecated fields (Inputs) after a smooth migration has been completed of our existing users
// For now, publish to deprecated fields thus ensuring old clients don't break when calling GetExecution
if len(executionModel.InputsURI) > 0 {
var inputs core.LiteralMap
if err := m.storageClient.ReadProtobuf(ctx, executionModel.InputsURI, &inputs); err != nil {
return nil, err
}
execution.Closure.ComputedInputs = &inputs
}
if len(executionModel.UserInputsURI) > 0 {
var userInputs core.LiteralMap
if err := m.storageClient.ReadProtobuf(ctx, executionModel.UserInputsURI, &userInputs); err != nil {
return nil, err
}
execution.Spec.Inputs = &userInputs
}
// END TO BE DELETED

return execution, nil
}

Expand Down
37 changes: 0 additions & 37 deletions pkg/manager/impl/execution_manager_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2149,43 +2149,6 @@ func TestGetExecution_Legacy(t *testing.T) {
assert.True(t, proto.Equal(getLegacyClosure(), execution.Closure))
}

func TestGetExecution_LegacyClient_OffloadedData(t *testing.T) {
repository := repositoryMocks.NewMockRepository()
startedAt := time.Date(2018, 8, 30, 0, 0, 0, 0, time.UTC)
executionGetFunc := func(ctx context.Context, input interfaces.Identifier) (models.Execution, error) {
assert.Equal(t, "project", input.Project)
assert.Equal(t, "domain", input.Domain)
assert.Equal(t, "name", input.Name)
return models.Execution{
ExecutionKey: models.ExecutionKey{
Project: "project",
Domain: "domain",
Name: "name",
},
Spec: specBytes,
Phase: phase,
Closure: closureBytes,
LaunchPlanID: uint(1),
WorkflowID: uint(2),
StartedAt: &startedAt,
UserInputsURI: shared.UserInputs,
InputsURI: shared.Inputs,
}, nil
}
repository.ExecutionRepo().(*repositoryMocks.MockExecutionRepo).SetGetCallback(executionGetFunc)
storageClient := getMockStorageForExecTest(context.Background())
execManager := NewExecutionManager(repository, getMockExecutionsConfigProvider(), storageClient, workflowengineMocks.NewMockExecutor(), mockScope.NewTestScope(), mockScope.NewTestScope(), &mockPublisher, mockExecutionRemoteURL, nil, nil, nil)
_ = storageClient.WriteProtobuf(context.Background(), storage.DataReference(shared.UserInputs), storage.Options{}, getLegacySpec().Inputs)
_ = storageClient.WriteProtobuf(context.Background(), storage.DataReference(shared.Inputs), storage.Options{}, getLegacyClosure().ComputedInputs)
execution, err := execManager.GetExecution(context.Background(), admin.WorkflowExecutionGetRequest{
Id: &executionIdentifier,
})
assert.NoError(t, err)
assert.True(t, proto.Equal(&executionIdentifier, execution.Id))
assert.True(t, proto.Equal(getLegacySpec(), execution.Spec))
assert.True(t, proto.Equal(getLegacyClosure(), execution.Closure))
}

func TestGetExecutionData_LegacyModel(t *testing.T) {
repository := repositoryMocks.NewMockRepository()
startedAt := time.Date(2018, 8, 30, 0, 0, 0, 0, time.UTC)
Expand Down