Skip to content

Commit

Permalink
WIP revert custom compute ID
Browse files Browse the repository at this point in the history
  • Loading branch information
ferglor committed Feb 7, 2025
1 parent 8f50d72 commit a119cf3
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 @@ -382,7 +382,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 @@ -394,7 +394,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 @@ -437,7 +437,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 @@ -449,7 +449,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 @@ -492,7 +492,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 @@ -507,7 +507,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 @@ -56,7 +56,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 @@ -57,7 +57,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 @@ -114,7 +114,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 a119cf3

Please sign in to comment.