Skip to content

Commit

Permalink
Remove legacy fetch for workflow execution inputs (flyteorg#173)
Browse files Browse the repository at this point in the history
  • Loading branch information
Katrina Rogan authored Mar 31, 2021
1 parent 55c3291 commit e35e4f2
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 56 deletions.
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

0 comments on commit e35e4f2

Please sign in to comment.