Skip to content

Commit

Permalink
[CAPPL-305] Fix typo in custom compute capability ID (#945)
Browse files Browse the repository at this point in the history
  • Loading branch information
cedric-cordenier authored Nov 20, 2024
1 parent ad84e37 commit a6a70ec
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 30 deletions.
12 changes: 6 additions & 6 deletions pkg/workflows/sdk/builder_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)"},
Expand All @@ -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)"},
Expand Down Expand Up @@ -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)"}},
Expand All @@ -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)"},
Expand Down Expand Up @@ -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{
Expand All @@ -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{
Expand Down
40 changes: 20 additions & 20 deletions pkg/workflows/sdk/compute_generated.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pkg/workflows/sdk/compute_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)"},
Expand Down
4 changes: 2 additions & 2 deletions pkg/workflows/sdk/gen/compute.go.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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{
Expand Down
2 changes: 1 addition & 1 deletion pkg/workflows/sdk/testutils/compute_capability.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit a6a70ec

Please sign in to comment.