From a6a70ec7692bd91bb15a55c99d74344975ca2957 Mon Sep 17 00:00:00 2001 From: Cedric Date: Wed, 20 Nov 2024 11:17:40 +0000 Subject: [PATCH] [CAPPL-305] Fix typo in custom compute capability ID (#945) --- pkg/workflows/sdk/builder_test.go | 12 +++--- pkg/workflows/sdk/compute_generated.go | 40 +++++++++---------- pkg/workflows/sdk/compute_test.go | 2 +- pkg/workflows/sdk/gen/compute.go.tmpl | 4 +- .../sdk/testutils/compute_capability.go | 2 +- 5 files changed, 30 insertions(+), 30 deletions(-) diff --git a/pkg/workflows/sdk/builder_test.go b/pkg/workflows/sdk/builder_test.go index bfbfa3095..d3901843a 100644 --- a/pkg/workflows/sdk/builder_test.go +++ b/pkg/workflows/sdk/builder_test.go @@ -392,7 +392,7 @@ func TestBuilder_ValidSpec(t *testing.T) { }, Actions: []sdk.StepDefinition{ { - ID: "custom_compute@1.0.0", + ID: "custom-compute@1.0.0", Ref: "compute", Inputs: sdk.StepInputs{ Mapping: map[string]any{"Arg0": "$(trigger.outputs.cool_output)"}, @@ -404,7 +404,7 @@ func TestBuilder_ValidSpec(t *testing.T) { CapabilityType: capabilities.CapabilityTypeAction, }, { - ID: "custom_compute@1.0.0", + ID: "custom-compute@1.0.0", Ref: "compute again", Inputs: sdk.StepInputs{ Mapping: map[string]any{"Arg0": "$(trigger.outputs.cool_output.0)"}, @@ -449,7 +449,7 @@ func TestBuilder_ValidSpec(t *testing.T) { }, Actions: []sdk.StepDefinition{ { - ID: "custom_compute@1.0.0", + ID: "custom-compute@1.0.0", Ref: "compute", Inputs: sdk.StepInputs{ Mapping: map[string]any{"Arg0": []any{"$(trigger.outputs.cool_output)"}}, @@ -461,7 +461,7 @@ func TestBuilder_ValidSpec(t *testing.T) { CapabilityType: capabilities.CapabilityTypeAction, }, { - ID: "custom_compute@1.0.0", + ID: "custom-compute@1.0.0", Ref: "compute again", Inputs: sdk.StepInputs{ Mapping: map[string]any{"Arg0": "$(trigger.outputs.cool_output)"}, @@ -506,7 +506,7 @@ func TestBuilder_ValidSpec(t *testing.T) { }, Actions: []sdk.StepDefinition{ { - ID: "custom_compute@1.0.0", + ID: "custom-compute@1.0.0", Ref: "compute", Inputs: sdk.StepInputs{ Mapping: map[string]any{ @@ -521,7 +521,7 @@ func TestBuilder_ValidSpec(t *testing.T) { CapabilityType: capabilities.CapabilityTypeAction, }, { - ID: "custom_compute@1.0.0", + ID: "custom-compute@1.0.0", Ref: "compute again", Inputs: sdk.StepInputs{ Mapping: map[string]any{ diff --git a/pkg/workflows/sdk/compute_generated.go b/pkg/workflows/sdk/compute_generated.go index ec75381e4..5098ddc03 100644 --- a/pkg/workflows/sdk/compute_generated.go +++ b/pkg/workflows/sdk/compute_generated.go @@ -41,7 +41,7 @@ func Compute1WithConfig[I0 any, O any, C any](w *WorkflowSpecFactory, ref string } def := StepDefinition{ - ID: "custom_compute@1.0.0", + ID: "custom-compute@1.0.0", Ref: ref, Inputs: input.ToSteps(), Config: cm, @@ -98,7 +98,7 @@ func Compute1WithConfig[I0 any, O any, C any](w *WorkflowSpecFactory, ref string // Compute1WithMetadata DO NOT USE, this functions is for internal local testing while other tools are being developed and is temporary func Compute1WithMetadata[I0 any, O any](w *WorkflowSpecFactory, ref string, input Compute1Inputs[I0], compute func(Runtime, I0, capabilities.RequestMetadata) (O, error)) ComputeOutputCap[O] { def := StepDefinition{ - ID: "custom_compute@1.0.0", + ID: "custom-compute@1.0.0", Ref: ref, Inputs: input.ToSteps(), Config: map[string]any{ @@ -181,7 +181,7 @@ func Compute2WithConfig[I0 any, I1 any, O any, C any](w *WorkflowSpecFactory, re } def := StepDefinition{ - ID: "custom_compute@1.0.0", + ID: "custom-compute@1.0.0", Ref: ref, Inputs: input.ToSteps(), Config: cm, @@ -238,7 +238,7 @@ func Compute2WithConfig[I0 any, I1 any, O any, C any](w *WorkflowSpecFactory, re // Compute2WithMetadata DO NOT USE, this functions is for internal local testing while other tools are being developed and is temporary func Compute2WithMetadata[I0 any, I1 any, O any](w *WorkflowSpecFactory, ref string, input Compute2Inputs[I0, I1], compute func(Runtime, I0, I1, capabilities.RequestMetadata) (O, error)) ComputeOutputCap[O] { def := StepDefinition{ - ID: "custom_compute@1.0.0", + ID: "custom-compute@1.0.0", Ref: ref, Inputs: input.ToSteps(), Config: map[string]any{ @@ -324,7 +324,7 @@ func Compute3WithConfig[I0 any, I1 any, I2 any, O any, C any](w *WorkflowSpecFac } def := StepDefinition{ - ID: "custom_compute@1.0.0", + ID: "custom-compute@1.0.0", Ref: ref, Inputs: input.ToSteps(), Config: cm, @@ -381,7 +381,7 @@ func Compute3WithConfig[I0 any, I1 any, I2 any, O any, C any](w *WorkflowSpecFac // Compute3WithMetadata DO NOT USE, this functions is for internal local testing while other tools are being developed and is temporary func Compute3WithMetadata[I0 any, I1 any, I2 any, O any](w *WorkflowSpecFactory, ref string, input Compute3Inputs[I0, I1, I2], compute func(Runtime, I0, I1, I2, capabilities.RequestMetadata) (O, error)) ComputeOutputCap[O] { def := StepDefinition{ - ID: "custom_compute@1.0.0", + ID: "custom-compute@1.0.0", Ref: ref, Inputs: input.ToSteps(), Config: map[string]any{ @@ -470,7 +470,7 @@ func Compute4WithConfig[I0 any, I1 any, I2 any, I3 any, O any, C any](w *Workflo } def := StepDefinition{ - ID: "custom_compute@1.0.0", + ID: "custom-compute@1.0.0", Ref: ref, Inputs: input.ToSteps(), Config: cm, @@ -527,7 +527,7 @@ func Compute4WithConfig[I0 any, I1 any, I2 any, I3 any, O any, C any](w *Workflo // Compute4WithMetadata DO NOT USE, this functions is for internal local testing while other tools are being developed and is temporary func Compute4WithMetadata[I0 any, I1 any, I2 any, I3 any, O any](w *WorkflowSpecFactory, ref string, input Compute4Inputs[I0, I1, I2, I3], compute func(Runtime, I0, I1, I2, I3, capabilities.RequestMetadata) (O, error)) ComputeOutputCap[O] { def := StepDefinition{ - ID: "custom_compute@1.0.0", + ID: "custom-compute@1.0.0", Ref: ref, Inputs: input.ToSteps(), Config: map[string]any{ @@ -619,7 +619,7 @@ func Compute5WithConfig[I0 any, I1 any, I2 any, I3 any, I4 any, O any, C any](w } def := StepDefinition{ - ID: "custom_compute@1.0.0", + ID: "custom-compute@1.0.0", Ref: ref, Inputs: input.ToSteps(), Config: cm, @@ -676,7 +676,7 @@ func Compute5WithConfig[I0 any, I1 any, I2 any, I3 any, I4 any, O any, C any](w // Compute5WithMetadata DO NOT USE, this functions is for internal local testing while other tools are being developed and is temporary func Compute5WithMetadata[I0 any, I1 any, I2 any, I3 any, I4 any, O any](w *WorkflowSpecFactory, ref string, input Compute5Inputs[I0, I1, I2, I3, I4], compute func(Runtime, I0, I1, I2, I3, I4, capabilities.RequestMetadata) (O, error)) ComputeOutputCap[O] { def := StepDefinition{ - ID: "custom_compute@1.0.0", + ID: "custom-compute@1.0.0", Ref: ref, Inputs: input.ToSteps(), Config: map[string]any{ @@ -771,7 +771,7 @@ func Compute6WithConfig[I0 any, I1 any, I2 any, I3 any, I4 any, I5 any, O any, C } def := StepDefinition{ - ID: "custom_compute@1.0.0", + ID: "custom-compute@1.0.0", Ref: ref, Inputs: input.ToSteps(), Config: cm, @@ -828,7 +828,7 @@ func Compute6WithConfig[I0 any, I1 any, I2 any, I3 any, I4 any, I5 any, O any, C // Compute6WithMetadata DO NOT USE, this functions is for internal local testing while other tools are being developed and is temporary func Compute6WithMetadata[I0 any, I1 any, I2 any, I3 any, I4 any, I5 any, O any](w *WorkflowSpecFactory, ref string, input Compute6Inputs[I0, I1, I2, I3, I4, I5], compute func(Runtime, I0, I1, I2, I3, I4, I5, capabilities.RequestMetadata) (O, error)) ComputeOutputCap[O] { def := StepDefinition{ - ID: "custom_compute@1.0.0", + ID: "custom-compute@1.0.0", Ref: ref, Inputs: input.ToSteps(), Config: map[string]any{ @@ -926,7 +926,7 @@ func Compute7WithConfig[I0 any, I1 any, I2 any, I3 any, I4 any, I5 any, I6 any, } def := StepDefinition{ - ID: "custom_compute@1.0.0", + ID: "custom-compute@1.0.0", Ref: ref, Inputs: input.ToSteps(), Config: cm, @@ -983,7 +983,7 @@ func Compute7WithConfig[I0 any, I1 any, I2 any, I3 any, I4 any, I5 any, I6 any, // Compute7WithMetadata DO NOT USE, this functions is for internal local testing while other tools are being developed and is temporary func Compute7WithMetadata[I0 any, I1 any, I2 any, I3 any, I4 any, I5 any, I6 any, O any](w *WorkflowSpecFactory, ref string, input Compute7Inputs[I0, I1, I2, I3, I4, I5, I6], compute func(Runtime, I0, I1, I2, I3, I4, I5, I6, capabilities.RequestMetadata) (O, error)) ComputeOutputCap[O] { def := StepDefinition{ - ID: "custom_compute@1.0.0", + ID: "custom-compute@1.0.0", Ref: ref, Inputs: input.ToSteps(), Config: map[string]any{ @@ -1084,7 +1084,7 @@ func Compute8WithConfig[I0 any, I1 any, I2 any, I3 any, I4 any, I5 any, I6 any, } def := StepDefinition{ - ID: "custom_compute@1.0.0", + ID: "custom-compute@1.0.0", Ref: ref, Inputs: input.ToSteps(), Config: cm, @@ -1141,7 +1141,7 @@ func Compute8WithConfig[I0 any, I1 any, I2 any, I3 any, I4 any, I5 any, I6 any, // Compute8WithMetadata DO NOT USE, this functions is for internal local testing while other tools are being developed and is temporary func Compute8WithMetadata[I0 any, I1 any, I2 any, I3 any, I4 any, I5 any, I6 any, I7 any, O any](w *WorkflowSpecFactory, ref string, input Compute8Inputs[I0, I1, I2, I3, I4, I5, I6, I7], compute func(Runtime, I0, I1, I2, I3, I4, I5, I6, I7, capabilities.RequestMetadata) (O, error)) ComputeOutputCap[O] { def := StepDefinition{ - ID: "custom_compute@1.0.0", + ID: "custom-compute@1.0.0", Ref: ref, Inputs: input.ToSteps(), Config: map[string]any{ @@ -1245,7 +1245,7 @@ func Compute9WithConfig[I0 any, I1 any, I2 any, I3 any, I4 any, I5 any, I6 any, } def := StepDefinition{ - ID: "custom_compute@1.0.0", + ID: "custom-compute@1.0.0", Ref: ref, Inputs: input.ToSteps(), Config: cm, @@ -1302,7 +1302,7 @@ func Compute9WithConfig[I0 any, I1 any, I2 any, I3 any, I4 any, I5 any, I6 any, // Compute9WithMetadata DO NOT USE, this functions is for internal local testing while other tools are being developed and is temporary func Compute9WithMetadata[I0 any, I1 any, I2 any, I3 any, I4 any, I5 any, I6 any, I7 any, I8 any, O any](w *WorkflowSpecFactory, ref string, input Compute9Inputs[I0, I1, I2, I3, I4, I5, I6, I7, I8], compute func(Runtime, I0, I1, I2, I3, I4, I5, I6, I7, I8, capabilities.RequestMetadata) (O, error)) ComputeOutputCap[O] { def := StepDefinition{ - ID: "custom_compute@1.0.0", + ID: "custom-compute@1.0.0", Ref: ref, Inputs: input.ToSteps(), Config: map[string]any{ @@ -1409,7 +1409,7 @@ func Compute10WithConfig[I0 any, I1 any, I2 any, I3 any, I4 any, I5 any, I6 any, } def := StepDefinition{ - ID: "custom_compute@1.0.0", + ID: "custom-compute@1.0.0", Ref: ref, Inputs: input.ToSteps(), Config: cm, @@ -1466,7 +1466,7 @@ func Compute10WithConfig[I0 any, I1 any, I2 any, I3 any, I4 any, I5 any, I6 any, // Compute10WithMetadata DO NOT USE, this functions is for internal local testing while other tools are being developed and is temporary func Compute10WithMetadata[I0 any, I1 any, I2 any, I3 any, I4 any, I5 any, I6 any, I7 any, I8 any, I9 any, O any](w *WorkflowSpecFactory, ref string, input Compute10Inputs[I0, I1, I2, I3, I4, I5, I6, I7, I8, I9], compute func(Runtime, I0, I1, I2, I3, I4, I5, I6, I7, I8, I9, capabilities.RequestMetadata) (O, error)) ComputeOutputCap[O] { def := StepDefinition{ - ID: "custom_compute@1.0.0", + ID: "custom-compute@1.0.0", Ref: ref, Inputs: input.ToSteps(), Config: map[string]any{ diff --git a/pkg/workflows/sdk/compute_test.go b/pkg/workflows/sdk/compute_test.go index c336a505b..08c0c8344 100644 --- a/pkg/workflows/sdk/compute_test.go +++ b/pkg/workflows/sdk/compute_test.go @@ -55,7 +55,7 @@ func TestCompute(t *testing.T) { }, Actions: []sdk.StepDefinition{ { - ID: "custom_compute@1.0.0", + ID: "custom-compute@1.0.0", Ref: "Compute", Inputs: sdk.StepInputs{ Mapping: map[string]any{"Arg0": "$(trigger.outputs)"}, diff --git a/pkg/workflows/sdk/gen/compute.go.tmpl b/pkg/workflows/sdk/gen/compute.go.tmpl index c82d8a71a..00c0ffc29 100644 --- a/pkg/workflows/sdk/gen/compute.go.tmpl +++ b/pkg/workflows/sdk/gen/compute.go.tmpl @@ -45,7 +45,7 @@ func Compute{{.}}WithConfig[{{range RangeNum .}}I{{.}} any, {{ end }}O any, C a } def := StepDefinition{ - ID: "custom_compute@1.0.0", + ID: "custom-compute@1.0.0", Ref: ref, Inputs: input.ToSteps(), Config: cm, @@ -102,7 +102,7 @@ func Compute{{.}}WithConfig[{{range RangeNum .}}I{{.}} any, {{ end }}O any, C a // Compute{{.}}WithMetadata DO NOT USE, this functions is for internal local testing while other tools are being developed and is temporary func Compute{{.}}WithMetadata[{{range RangeNum .}}I{{.}} any, {{ end }}O any](w *WorkflowSpecFactory, ref string, input Compute{{.}}Inputs[{{range RangeNum . }}I{{.}},{{ end }}], compute func(Runtime, {{range RangeNum . }}I{{.}},{{ end }} capabilities.RequestMetadata) (O, error)) ComputeOutputCap[O] { def := StepDefinition{ - ID: "custom_compute@1.0.0", + ID: "custom-compute@1.0.0", Ref: ref, Inputs: input.ToSteps(), Config: map[string]any{ diff --git a/pkg/workflows/sdk/testutils/compute_capability.go b/pkg/workflows/sdk/testutils/compute_capability.go index 3e9932acb..e89ab9777 100644 --- a/pkg/workflows/sdk/testutils/compute_capability.go +++ b/pkg/workflows/sdk/testutils/compute_capability.go @@ -14,7 +14,7 @@ type computeCapability struct { func (c *computeCapability) Info(ctx context.Context) (capabilities.CapabilityInfo, error) { info := capabilities.MustNewCapabilityInfo( - "custom_compute@1.0.0", capabilities.CapabilityTypeAction, "Custom compute capability", + "custom-compute@1.0.0", capabilities.CapabilityTypeAction, "Custom compute capability", ) info.IsLocal = true return info, nil