Skip to content

Commit

Permalink
Rename SdkWorkflowSpec to SDKSpec
Browse files Browse the repository at this point in the history
  • Loading branch information
nolag committed Sep 17, 2024
1 parent 4f55485 commit 0b35f7e
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions core/services/job/models.go
Original file line number Diff line number Diff line change
Expand Up @@ -899,7 +899,7 @@ func (w *WorkflowSpec) Validate(ctx context.Context) error {
return fmt.Errorf("%w: failed to parse workflow spec %s: %w", ErrInvalidWorkflowYAMLSpec, w.Workflow, err)
}

if _, err = w.SdkWorkflowSpec(ctx); err != nil {
if _, err = w.SDKSpec(ctx); err != nil {
return err
}

Expand All @@ -913,7 +913,7 @@ func (w *WorkflowSpec) Validate(ctx context.Context) error {
return nil
}

func (w *WorkflowSpec) SdkWorkflowSpec(ctx context.Context) (sdk.WorkflowSpec, error) {
func (w *WorkflowSpec) SDKSpec(ctx context.Context) (sdk.WorkflowSpec, error) {
if w.sdkWorkflow != nil {
return *w.sdkWorkflow, nil
}
Expand Down
4 changes: 2 additions & 2 deletions core/services/workflows/delegate.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ func (d *Delegate) OnDeleteJob(context.Context, job.Job) error { return nil }

// ServicesForSpec satisfies the job.Delegate interface.
func (d *Delegate) ServicesForSpec(ctx context.Context, spec job.Job) ([]job.ServiceCtx, error) {
sdkSpec, err := spec.WorkflowSpec.SdkWorkflowSpec(ctx)
sdkSpec, err := spec.WorkflowSpec.SDKSpec(ctx)
if err != nil {
return nil, err
}
Expand Down Expand Up @@ -87,7 +87,7 @@ func ValidatedWorkflowJobSpec(ctx context.Context, tomlString string) (job.Job,
return jb, fmt.Errorf("toml unmarshal error on workflow spec: %w", err)
}

sdkSpec, err := spec.SdkWorkflowSpec(ctx)
sdkSpec, err := spec.SDKSpec(ctx)
if err != nil {
return jb, fmt.Errorf("failed to convert to sdk workflow spec: %w", err)
}
Expand Down
2 changes: 1 addition & 1 deletion core/services/workflows/engine_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ func newTestEngine(t *testing.T, reg *coreCap.Registry, spec string, opts ...fun
sdkSpec, err := (&job.WorkflowSpec{
Workflow: spec,
SpecType: job.YamlSpec,
}).SdkWorkflowSpec(testutils.Context(t))
}).SDKSpec(testutils.Context(t))
require.NoError(t, err)

reg.SetLocalRegistry(&testConfigProvider{})
Expand Down

0 comments on commit 0b35f7e

Please sign in to comment.