diff --git a/.github/workflows/graphs/build-test-publish.act b/.github/workflows/graphs/build-test-publish.act index 8388e32..aa735f1 100644 --- a/.github/workflows/graphs/build-test-publish.act +++ b/.github/workflows/graphs/build-test-publish.act @@ -657,28 +657,28 @@ nodes: inputs: value: actrun-notarization-macos.zip - id: secret-v1-red-pineapple-guava - type: core/secret@v1 + type: core/secret-get@v1 position: x: 3620 y: 2680 inputs: name: APPLE_ID - id: secret-v1-monkey-silver-boysenberry - type: core/secret@v1 + type: core/secret-get@v1 position: x: 3620 y: 2790 inputs: name: APPLE_ID_PASSWORD - id: secret-v1-kiwano-pineapple-bear - type: core/secret@v1 + type: core/secret-get@v1 position: x: 2220 y: 2190 inputs: name: APPLE_TEAM_IDENTITY - id: secret-v1-cherry-pear-cranberry - type: core/secret@v1 + type: core/secret-get@v1 position: x: 3620 y: 2570 @@ -1281,7 +1281,7 @@ nodes: substitutes[0]: null fmt: '%s.pkg' - id: secret-v1-giraffe-snake-tiger - type: core/secret@v1 + type: core/secret-get@v1 position: x: 10050 y: 3000 @@ -1928,7 +1928,7 @@ nodes: description: '' label: MacOS CodeSign - id: secret-v1-cranberry-watermelon-starfruit - type: core/secret@v1 + type: core/secret-get@v1 position: x: 11090 y: 2200 @@ -2139,21 +2139,21 @@ nodes: description: '' label: MacOS Notarization - id: secret-v1-persimmon-jackfruit-gold - type: core/secret@v1 + type: core/secret-get@v1 position: x: 11570 y: 2680 inputs: name: APPLE_ID - id: secret-v1-date-cow-shark - type: core/secret@v1 + type: core/secret-get@v1 position: x: 11570 y: 2790 inputs: name: APPLE_ID_PASSWORD - id: secret-v1-watermelon-gray-pineapple - type: core/secret@v1 + type: core/secret-get@v1 position: x: 11570 y: 2570 @@ -5058,7 +5058,7 @@ nodes: x: 13840 y: 1090 - id: secret-v1-raspberry-apple-giraffe - type: core/secret@v1 + type: core/secret-get@v1 position: x: 13670 y: 2340 diff --git a/core/base.go b/core/base.go index c7c42d3..be52fc9 100644 --- a/core/base.go +++ b/core/base.go @@ -353,6 +353,7 @@ type NodeTypeDefinitionBasic struct { Label string `yaml:"label,omitempty" json:"label,omitempty" bson:"label,omitempty"` Compact bool `yaml:"compact,omitempty" json:"compact,omitempty" bson:"compact,omitempty"` GhMeta GhMetadata `yaml:"gh_meta" json:"gh_meta" bson:"gh_meta"` + Aliases []string `yaml:"aliases,omitempty" json:"aliases,omitempty" bson:"aliases,omitempty"` // Used by the gateway to indicate errors when being retreived Error string `yaml:"error,omitempty" json:"error,omitempty" bson:"error,omitempty"` @@ -561,6 +562,17 @@ func RegisterNodeFactory(nodeDefStr string, fn nodeFactoryFunc) error { nodeDef.FactoryFn = fn registries[id] = nodeDef + for _, alias := range nodeDef.Aliases { + if strings.Contains(alias, "_") { + return CreateErr(nil, nil, "alias '%v' must not contain underscores", alias) + } + aliasId := fmt.Sprintf("%v@v%v", alias, nodeDef.Version) + if _, exists := registries[aliasId]; exists { + return CreateErr(nil, nil, "alias '%v' already registered", aliasId) + } + registries[aliasId] = nodeDef + } + return nil } diff --git a/core/errors.go b/core/errors.go index c1e9b2b..a3ade88 100644 --- a/core/errors.go +++ b/core/errors.go @@ -68,7 +68,7 @@ func (e *LeafError) Error() string { func (e *LeafError) ErrorWithCauses() string { var lines []string - // 1. Top level error (no prefix) + // top level error (no prefix) // iterate backwards for high-level first for i := len(e.ErrorStack) - 1; i >= 0; i-- { prefix := "" diff --git a/core/inputs.go b/core/inputs.go index 54ca423..7d10df2 100644 --- a/core/inputs.go +++ b/core/inputs.go @@ -362,11 +362,12 @@ func (n *Inputs) InputValueById(ec *ExecutionState, host NodeWithInputs, inputId ec.PushNodeVisit(dataSource.SrcNode, false) v, err := dataSource.SrcNodeOutputs.OutputValueById(ec, OutputId(outputCacheId)) - ec.PopNodeVisit() if err != nil { return nil, err } + ec.PopNodeVisit() + // handle slice indexing if dataSource.SrcIndexOutputInfo != nil { slice := reflect.ValueOf(v) diff --git a/node_interfaces/interface_core_random-number_v1.go b/node_interfaces/interface_core_random-number_v1.go index 8b565cf..50fa703 100644 --- a/node_interfaces/interface_core_random-number_v1.go +++ b/node_interfaces/interface_core_random-number_v1.go @@ -17,7 +17,7 @@ const Core_random_number_v1_Input_seed core.InputId = "seed" // Outputs (o) ==> -// Triggered when the random number is successfully generated. +// Triggered when the random number is generated. const Core_random_number_v1_Output_exec_success core.OutputId = "exec-success" // The generated random number const Core_random_number_v1_Output_number core.OutputId = "number" diff --git a/node_interfaces/interface_core_secret-get_v1.go b/node_interfaces/interface_core_secret-get_v1.go new file mode 100644 index 0000000..89d4379 --- /dev/null +++ b/node_interfaces/interface_core_secret-get_v1.go @@ -0,0 +1,17 @@ +// Code generated by actrun. DO NOT EDIT. + +package node_interfaces + +import "github.com/actionforge/actrun-cli/core" // A node to read key secrets. + +// ==> (o) Inputs + +// The name of the secret. +const Core_secret_get_v1_Input_name core.InputId = "name" +// A prefix for the secret, specifically used to easier construct environment variables. +const Core_secret_get_v1_Input_prefix core.InputId = "prefix" + +// Outputs (o) ==> + +// The value of the secret. +const Core_secret_get_v1_Output_secret core.OutputId = "secret" diff --git a/node_interfaces/interface_core_secret-set_v1.go b/node_interfaces/interface_core_secret-set_v1.go new file mode 100644 index 0000000..d06fd8b --- /dev/null +++ b/node_interfaces/interface_core_secret-set_v1.go @@ -0,0 +1,19 @@ +// Code generated by actrun. DO NOT EDIT. + +package node_interfaces + +import "github.com/actionforge/actrun-cli/core" // A node to set a secret value at runtime. + +// ==> (o) Inputs + +// Triggers the setting of the secret. +const Core_secret_set_v1_Input_exec core.InputId = "exec" +// The name of the secret to set. +const Core_secret_set_v1_Input_name core.InputId = "name" +// The value of the secret. +const Core_secret_set_v1_Input_value core.InputId = "value" + +// Outputs (o) ==> + +// Triggered when the secret is successfully set. +const Core_secret_set_v1_Output_exec_success core.OutputId = "exec-success" diff --git a/nodes/secret@v1.go b/nodes/secret-get@v1.go similarity index 93% rename from nodes/secret@v1.go rename to nodes/secret-get@v1.go index 69f7c88..421065c 100644 --- a/nodes/secret@v1.go +++ b/nodes/secret-get@v1.go @@ -8,7 +8,7 @@ import ( ni "github.com/actionforge/actrun-cli/node_interfaces" ) -//go:embed secret@v1.yml +//go:embed secret-get@v1.yml var secretDefinition string type SecretNode struct { @@ -18,12 +18,12 @@ type SecretNode struct { } func (n *SecretNode) OutputValueById(c *core.ExecutionState, outputId core.OutputId) (any, error) { - secretName, err := core.InputValueById[string](c, n, ni.Core_secret_v1_Input_name) + secretName, err := core.InputValueById[string](c, n, ni.Core_secret_get_v1_Input_name) if err != nil { return nil, err } - prefix, err := core.InputValueById[string](c, n, ni.Core_secret_v1_Input_prefix) + prefix, err := core.InputValueById[string](c, n, ni.Core_secret_get_v1_Input_prefix) if err != nil { return nil, err } diff --git a/nodes/secret@v1.yml b/nodes/secret-get@v1.yml similarity index 92% rename from nodes/secret@v1.yml rename to nodes/secret-get@v1.yml index eef8d3d..c788add 100644 --- a/nodes/secret@v1.yml +++ b/nodes/secret-get@v1.yml @@ -1,8 +1,10 @@ yaml-version: 3.0 -id: core/secret +id: core/secret-get version: 1 -name: Secret +aliases: + - core/secret +name: Get Secret icon: octKey category: system short_desc: A node to read key secrets. diff --git a/nodes/secret-set@v1.go b/nodes/secret-set@v1.go new file mode 100644 index 0000000..fa84b55 --- /dev/null +++ b/nodes/secret-set@v1.go @@ -0,0 +1,43 @@ +package nodes + +import ( + _ "embed" + + "github.com/actionforge/actrun-cli/core" + ni "github.com/actionforge/actrun-cli/node_interfaces" +) + +//go:embed secret-set@v1.yml +var setSecretDefinition string + +type SetSecretNode struct { + core.NodeBaseComponent + core.Executions + core.Inputs + core.Outputs +} + +func (n *SetSecretNode) ExecuteImpl(c *core.ExecutionState, inputId core.InputId, prevError error) error { + secretName, err := core.InputValueById[string](c, n, ni.Core_secret_set_v1_Input_name) + if err != nil { + return err + } + + secretValue, err := core.InputValueById[string](c, n, ni.Core_secret_set_v1_Input_value) + if err != nil { + return err + } + + c.Secrets[secretName] = secretValue + + return n.Execute(ni.Core_secret_set_v1_Output_exec_success, c, nil) +} + +func init() { + err := core.RegisterNodeFactory(setSecretDefinition, func(ctx any, parent core.NodeBaseInterface, parentId string, nodeDef map[string]any, validate bool) (core.NodeBaseInterface, []error) { + return &SetSecretNode{}, nil + }) + if err != nil { + panic(err) + } +} diff --git a/nodes/secret-set@v1.yml b/nodes/secret-set@v1.yml new file mode 100644 index 0000000..115d50b --- /dev/null +++ b/nodes/secret-set@v1.yml @@ -0,0 +1,41 @@ +yaml-version: 3.0 + +id: core/secret-set +version: 1 +name: Set Secret +icon: octKey +category: system +short_desc: A node to set a secret value at runtime. +long_desc: Sets a secret value that can be retrieved later using the Get Secret node. +style: + header: + background: "#3794ff" + body: + background: "#1f4f86" +inputs: + exec: + exec: true + index: 0 + name: '' + desc: Triggers the setting of the secret. + name: + name: Name + type: string + hint: "e.g. MY_KEY" + required: true + desc: The name of the secret to set. + index: 1 + value: + name: Value + type: string + hint: "e.g. secret-value" + required: true + desc: The value of the secret. + index: 2 + +outputs: + exec-success: + name: '' + exec: true + index: 0 + desc: Triggered when the secret is successfully set. diff --git a/tests_e2e/references/reference_error_no_output.sh_l8 b/tests_e2e/references/reference_error_no_output.sh_l8 index 1c03d05..b9d09a0 100644 --- a/tests_e2e/references/reference_error_no_output.sh_l8 +++ b/tests_e2e/references/reference_error_no_output.sh_l8 @@ -22,13 +22,14 @@ actrun: error_no_output.act error: 1: execute 'Start' (start) 2: execute 'Print' (print-v1-panda-orange-peacock) + 3: request input from 'Run Executable' (run-exec-v1-wolf-guava-gray) error when requesting input from 'Print' (print-v1-panda-orange-peacock) values at **first** input port ↳ output port 'output' has no value hint: - No output value provided. Check the settings of 'Print' (print-v1-panda-orange-peacock) node + No output value provided. Check the settings of 'Run Executable' (run-exec-v1-wolf-guava-gray) node stack trace: github.com/actionforge/actrun-cli/core.(*Outputs).OutputValueById @@ -36,11 +37,11 @@ github.com/actionforge/actrun-cli/core.(*Outputs).OutputValueById github.com/actionforge/actrun-cli/core.(*Inputs).InputValueById inputs.go:364 github.com/actionforge/actrun-cli/core.inputValueById[...] - inputs.go:471 + inputs.go:472 github.com/actionforge/actrun-cli/core.InputValueFromSubInputs[...] - inputs.go:466 + inputs.go:467 github.com/actionforge/actrun-cli/core.InputArrayValueById[...] - inputs.go:548 + inputs.go:549 github.com/actionforge/actrun-cli/nodes.(*PrintNode).ExecuteImpl print@v1.go:27 github.com/actionforge/actrun-cli/core.(*Executions).Execute diff --git a/tests_e2e/references/reference_group-port-collision.sh_l13 b/tests_e2e/references/reference_group-port-collision.sh_l13 index 88a6c55..484b08f 100644 --- a/tests_e2e/references/reference_group-port-collision.sh_l13 +++ b/tests_e2e/references/reference_group-port-collision.sh_l13 @@ -23,7 +23,7 @@ stack trace: github.com/actionforge/actrun-cli/nodes.init.39.func1 group@v1.go:128 github.com/actionforge/actrun-cli/core.NewNodeInstance - base.go:598 + base.go:610 github.com/actionforge/actrun-cli/core.LoadNode graph.go:599 github.com/actionforge/actrun-cli/core.LoadNodes diff --git a/tests_e2e/references/reference_index.sh_l20 b/tests_e2e/references/reference_index.sh_l20 index 98215f6..9fdb1ce 100644 --- a/tests_e2e/references/reference_index.sh_l20 +++ b/tests_e2e/references/reference_index.sh_l20 @@ -54,6 +54,7 @@ error: 4: execute 'Print' (print-v1-indigo-guava-elephant) 5: execute 'Print' (print-v1-indigo-guava-elephant) 6: execute 'Print' (print-v1-indigo-guava-elephant) + 7: request input from 'Array Get' (array-get-v1-goose-chicken-nectarine) error when requesting input from 'Print' (print-v1-indigo-guava-elephant) values at **first** input port ↳ index out of bounds: 3 @@ -65,11 +66,11 @@ github.com/actionforge/actrun-cli/nodes.(*ArrayGet).OutputValueById github.com/actionforge/actrun-cli/core.(*Inputs).InputValueById inputs.go:364 github.com/actionforge/actrun-cli/core.inputValueById[...] - inputs.go:471 + inputs.go:472 github.com/actionforge/actrun-cli/core.InputValueFromSubInputs[...] - inputs.go:466 + inputs.go:467 github.com/actionforge/actrun-cli/core.InputArrayValueById[...] - inputs.go:548 + inputs.go:549 github.com/actionforge/actrun-cli/nodes.(*PrintNode).ExecuteImpl print@v1.go:27 github.com/actionforge/actrun-cli/core.(*Executions).Execute diff --git a/tests_e2e/references/reference_run-python-embedded.sh_l13 b/tests_e2e/references/reference_run-python-embedded.sh_l13 index 8959fca..a1c6a1e 100644 --- a/tests_e2e/references/reference_run-python-embedded.sh_l13 +++ b/tests_e2e/references/reference_run-python-embedded.sh_l13 @@ -27,7 +27,7 @@ stack trace: github.com/actionforge/actrun-cli/nodes.init.50.func1 nrun-python-embedded@v1.go:16 github.com/actionforge/actrun-cli/core.NewNodeInstance - base.go:598 + base.go:610 github.com/actionforge/actrun-cli/core.LoadNode graph.go:599 github.com/actionforge/actrun-cli/core.LoadNodes diff --git a/tests_e2e/references/reference_scope.sh_l8 b/tests_e2e/references/reference_scope.sh_l8 index cc540ac..a9e9b4b 100644 --- a/tests_e2e/references/reference_scope.sh_l8 +++ b/tests_e2e/references/reference_scope.sh_l8 @@ -53,101 +53,4 @@ PushNodeVisit: string-fmt-v1-sheep-donkey-penguin, execute: false PushNodeVisit: group-v1-brown-turkey-donkey, execute: false PushNodeVisit: group-outputs-v1-wolf-cow-seahorse, execute: false PushNodeVisit: (cached) random-number-v1-pear-magenta-wolf, execute: false -error, some strings are the same! 0.9666203808495691 0.05759205459865479 0.05759205459865479 0.05759205459865479 -actrun: scope.act - -error: - 1: execute 'Start' (start) - 2: execute 'Group' (group-v1-brown-turkey-donkey) - 3: execute 'Group Inputs' (group-inputs-v1-starfish-navy-orange) - 4: execute 'Random Number' (random-number-v1-pear-magenta-wolf) - 5: execute 'Group Output' (group-outputs-v1-wolf-cow-seahorse) - 6: execute 'Group' (group-v1-brown-turkey-donkey) - 7: execute 'Group' (core-group-v1-panda-yellow-squirrel) - 8: execute 'Group Inputs' (group-inputs-v1-starfish-navy-orange) - 9: execute 'Random Number' (random-number-v1-pear-magenta-wolf) - 10: execute 'Group Output' (group-outputs-v1-wolf-cow-seahorse) - 11: execute 'Group' (core-group-v1-panda-yellow-squirrel) - 12: execute 'Run Script' (run-v1-lychee-grape-tangerine) - error during execution - ↳ failed to run command - ↳ exit status 1 - - - -stack trace: -github.com/actionforge/actrun-cli/nodes.runAndCaptureOutput - run@v1.go:384 -github.com/actionforge/actrun-cli/nodes.runCommand - run@v1.go:260 -github.com/actionforge/actrun-cli/nodes.(*RunNode).ExecuteImpl - run@v1.go:112 -github.com/actionforge/actrun-cli/core.(*Executions).Execute - executions.go:56 -github.com/actionforge/actrun-cli/nodes.(*GroupNode).ExecuteImpl - group@v1.go:75 -github.com/actionforge/actrun-cli/core.(*Executions).Execute - executions.go:56 -github.com/actionforge/actrun-cli/nodes.(*GroupOutputsNode).ExecuteImpl - group-outputs@v1.go:30 -github.com/actionforge/actrun-cli/core.(*Executions).Execute - executions.go:56 -github.com/actionforge/actrun-cli/nodes.(*RandomNumberNode).ExecuteImpl - random-number@v1.go:58 -github.com/actionforge/actrun-cli/core.(*Executions).Execute - executions.go:56 -github.com/actionforge/actrun-cli/nodes.(*GroupInputsNode).ExecuteImpl - group-inputs@v1.go:39 -github.com/actionforge/actrun-cli/core.(*Executions).Execute - executions.go:56 -github.com/actionforge/actrun-cli/nodes.(*GroupNode).ExecuteImpl - group@v1.go:75 -github.com/actionforge/actrun-cli/core.(*Executions).Execute - executions.go:56 -github.com/actionforge/actrun-cli/nodes.(*GroupNode).ExecuteImpl - group@v1.go:75 -github.com/actionforge/actrun-cli/core.(*Executions).Execute - executions.go:56 -github.com/actionforge/actrun-cli/nodes.(*GroupOutputsNode).ExecuteImpl - group-outputs@v1.go:30 -github.com/actionforge/actrun-cli/core.(*Executions).Execute - executions.go:56 -github.com/actionforge/actrun-cli/nodes.(*RandomNumberNode).ExecuteImpl - random-number@v1.go:58 -github.com/actionforge/actrun-cli/core.(*Executions).Execute - executions.go:56 -github.com/actionforge/actrun-cli/nodes.(*GroupInputsNode).ExecuteImpl - group-inputs@v1.go:39 -github.com/actionforge/actrun-cli/core.(*Executions).Execute - executions.go:56 -github.com/actionforge/actrun-cli/nodes.(*GroupNode).ExecuteImpl - group@v1.go:75 -github.com/actionforge/actrun-cli/core.(*Executions).Execute - executions.go:56 -github.com/actionforge/actrun-cli/nodes.(*StartNode).ExecuteImpl - start@v1.go:49 -github.com/actionforge/actrun-cli/nodes.(*StartNode).ExecuteEntry - start@v1.go:44 -github.com/actionforge/actrun-cli/core.RunGraph - graph.go:426 -github.com/actionforge/actrun-cli/core.RunGraphFromString - graph.go:1013 -github.com/actionforge/actrun-cli/core.RunGraphFromFile - graph.go:1031 -github.com/actionforge/actrun-cli/cmd.cmdRootRun - cmd_root.go:175 -github.com/spf13/cobra.(*Command).execute - command.go:-1 -github.com/spf13/cobra.(*Command).ExecuteC - command.go:-1 -github.com/spf13/cobra.(*Command).Execute - command.go:-1 -github.com/actionforge/actrun-cli/cmd.Execute - cmd_root.go:190 -main.main - main.go:26 -runtime.main - proc.go:-1 -runtime.goexit - asm_{..}.s:-1 - +good, random number S1 is different to the others, and S2, S3 and S4 are the same diff --git a/tests_e2e/references/reference_secret.sh_l11 b/tests_e2e/references/reference_secret.sh_l12 similarity index 86% rename from tests_e2e/references/reference_secret.sh_l11 rename to tests_e2e/references/reference_secret.sh_l12 index 78dbb8b..b677c21 100644 --- a/tests_e2e/references/reference_secret.sh_l11 +++ b/tests_e2e/references/reference_secret.sh_l12 @@ -18,4 +18,6 @@ PushNodeVisit: start, execute: true PushNodeVisit: run-v1-butterfly-gray-shark, execute: true PushNodeVisit: env-array-v1-lemon-grape-lion, execute: false PushNodeVisit: secret-v1-orange-blueberry-red, execute: false -THIS_IS_A_SECRET +PushNodeVisit: core-secret-get-v1-duck-starfruit-silver, execute: false +THIS_IS_A_SECRET_FROM_BASH +THIS_IS_A_SECRET_2_FROM_BASH diff --git a/tests_e2e/references/reference_secret.sh_l15 b/tests_e2e/references/reference_secret.sh_l17 similarity index 85% rename from tests_e2e/references/reference_secret.sh_l15 rename to tests_e2e/references/reference_secret.sh_l17 index 38252ff..054771a 100644 --- a/tests_e2e/references/reference_secret.sh_l15 +++ b/tests_e2e/references/reference_secret.sh_l17 @@ -18,4 +18,6 @@ PushNodeVisit: start, execute: true PushNodeVisit: run-v1-butterfly-gray-shark, execute: true PushNodeVisit: env-array-v1-lemon-grape-lion, execute: false PushNodeVisit: secret-v1-orange-blueberry-red, execute: false -THIS_IS_ANOTHER_SECRET +PushNodeVisit: core-secret-get-v1-duck-starfruit-silver, execute: false +THIS_IS_ANOTHER_SECRET_FROM_BASH +THIS_IS_ANOTHER_SECRET_2_FROM_BASH diff --git a/tests_e2e/references/reference_secret.sh_l19 b/tests_e2e/references/reference_secret.sh_l21 similarity index 85% rename from tests_e2e/references/reference_secret.sh_l19 rename to tests_e2e/references/reference_secret.sh_l21 index a02dfed..649f845 100644 --- a/tests_e2e/references/reference_secret.sh_l19 +++ b/tests_e2e/references/reference_secret.sh_l21 @@ -19,4 +19,6 @@ PushNodeVisit: start, execute: true PushNodeVisit: run-v1-butterfly-gray-shark, execute: true PushNodeVisit: env-array-v1-lemon-grape-lion, execute: false PushNodeVisit: secret-v1-orange-blueberry-red, execute: false -THIS_IS_API_KEY_123 +PushNodeVisit: core-secret-get-v1-duck-starfruit-silver, execute: false +THIS_IS_API_KEY_123_FROM_SECRET_ACTCONFIG +ALIAS_FROM_SECRET_ACTCONFIG diff --git a/tests_e2e/references/reference_select-data.sh_l9 b/tests_e2e/references/reference_select-data.sh_l9 index 881307f..3a91386 100644 --- a/tests_e2e/references/reference_select-data.sh_l9 +++ b/tests_e2e/references/reference_select-data.sh_l9 @@ -61,6 +61,7 @@ error: 6: execute 'Print' (print-v1-gold-gold-panda) 7: execute 'Print' (print-v1-gold-gold-panda) 8: execute 'Print' (print-v1-gold-gold-panda) + 9: request input from 'Select Data' (select-v1-grape-peach-snake) error when requesting input from 'Print' (print-v1-gold-gold-panda) values at **first** input port ↳ index out of range: 5, expected 0-4 @@ -72,11 +73,11 @@ github.com/actionforge/actrun-cli/nodes.(*SelectDataNode).OutputValueById github.com/actionforge/actrun-cli/core.(*Inputs).InputValueById inputs.go:364 github.com/actionforge/actrun-cli/core.inputValueById[...] - inputs.go:471 + inputs.go:472 github.com/actionforge/actrun-cli/core.InputValueFromSubInputs[...] - inputs.go:466 + inputs.go:467 github.com/actionforge/actrun-cli/core.InputArrayValueById[...] - inputs.go:548 + inputs.go:549 github.com/actionforge/actrun-cli/nodes.(*PrintNode).ExecuteImpl print@v1.go:27 github.com/actionforge/actrun-cli/core.(*Executions).Execute diff --git a/tests_e2e/references/reference_string-transform.sh_l61 b/tests_e2e/references/reference_string-transform.sh_l61 index 208862d..6c950ff 100644 --- a/tests_e2e/references/reference_string-transform.sh_l61 +++ b/tests_e2e/references/reference_string-transform.sh_l61 @@ -25,6 +25,7 @@ actrun: string-transform.act error: 1: execute 'Start' (start) 2: execute 'Print' (print-v1-coral-banana-goat) + 3: request input from 'String Transform' (string-transform-v1-blue-horse-turquoise) error when requesting input from 'Print' (print-v1-coral-banana-goat) values at **1st** input port ↳ unknown operation 'op_doesnt_exist' @@ -36,11 +37,11 @@ github.com/actionforge/actrun-cli/nodes.(*StringTransform).OutputValueById github.com/actionforge/actrun-cli/core.(*Inputs).InputValueById inputs.go:364 github.com/actionforge/actrun-cli/core.inputValueById[...] - inputs.go:471 + inputs.go:472 github.com/actionforge/actrun-cli/core.InputValueFromSubInputs[...] - inputs.go:466 + inputs.go:467 github.com/actionforge/actrun-cli/core.InputArrayValueById[...] - inputs.go:548 + inputs.go:549 github.com/actionforge/actrun-cli/nodes.(*PrintNode).ExecuteImpl print@v1.go:27 github.com/actionforge/actrun-cli/core.(*Executions).Execute diff --git a/tests_e2e/scripts/chatgpt_simulator.act b/tests_e2e/scripts/chatgpt_simulator.act index 1737ac7..4c4c484 100644 --- a/tests_e2e/scripts/chatgpt_simulator.act +++ b/tests_e2e/scripts/chatgpt_simulator.act @@ -349,7 +349,7 @@ nodes: inputs: value: DONE - id: secret-v1-magenta-grapefruit-bear - type: core/secret@v1 + type: core/secret-get@v1 position: x: -240 y: 320 diff --git a/tests_e2e/scripts/scope.act b/tests_e2e/scripts/scope.act index 8db8944..bc83796 100644 --- a/tests_e2e/scripts/scope.act +++ b/tests_e2e/scripts/scope.act @@ -113,10 +113,13 @@ nodes: float(S3) float(S4) - if all_strings_different(S1, S2, S3, S4): - print("good, all random numbers are different") + if S1 == S2: + print("error, first and second random number must be different since they come from different nodes") + sys.exit(1) + elif S2 == S3 or S2 == S4: + print("good, random number S1 is different to the others, and S2, S3 and S4 are the same") else: - print("error, some strings are the same!", S1, S2, S3, S4) + print("error, these randpm numbers should have been the same", "S2", S2, "S3", S3, "S4", S4) sys.exit(1) shell: python - id: env-array-v1-pink-date-pomegranate diff --git a/tests_e2e/scripts/secret.act b/tests_e2e/scripts/secret.act index 31ef090..9ef9126 100644 --- a/tests_e2e/scripts/secret.act +++ b/tests_e2e/scripts/secret.act @@ -15,14 +15,17 @@ nodes: script: |- import os, sys sys.stdout.write(os.environ["FOO"] + "\n") + sys.stdout.write(os.environ["FOO_ALIAS"] + "\n") - id: secret-v1-orange-blueberry-red - type: core/secret@v1 + type: core/secret-get@v1 position: x: -70 - y: 560 + y: 580 inputs: name: API_KEY_123 prefix: FOO= + label: '' + comment: new core/secret-get@v1 - id: env-array-v1-lemon-grape-lion type: core/env-array@v1 position: @@ -30,6 +33,17 @@ nodes: y: 570 inputs: env[0]: '' + env[1]: '' + - id: core-secret-get-v1-duck-starfruit-silver + type: core/secret-get@v1 + position: + x: -60 + y: 820 + inputs: + name: API_KEY_ALIAS + prefix: FOO_ALIAS= + label: '' + comment: old core/secret@v1 connections: - src: node: env-array-v1-lemon-grape-lion @@ -43,6 +57,12 @@ connections: dst: node: env-array-v1-lemon-grape-lion port: env[0] + - src: + node: core-secret-get-v1-duck-starfruit-silver + port: secret + dst: + node: env-array-v1-lemon-grape-lion + port: env[1] executions: - src: node: start diff --git a/tests_e2e/scripts/secret.actconfig b/tests_e2e/scripts/secret.actconfig index 9db5e7b..8171028 100644 --- a/tests_e2e/scripts/secret.actconfig +++ b/tests_e2e/scripts/secret.actconfig @@ -1,3 +1,4 @@ secrets: - API_KEY_123: THIS_IS_API_KEY_123 + API_KEY_123: THIS_IS_API_KEY_123_FROM_SECRET_ACTCONFIG + API_KEY_ALIAS: ALIAS_FROM_SECRET_ACTCONFIG THIS_IS_IGNORED: "this_is_ignored_because_it_doesn't_exist" \ No newline at end of file diff --git a/tests_e2e/scripts/secret.sh b/tests_e2e/scripts/secret.sh index 62f37ee..798dda4 100644 --- a/tests_e2e/scripts/secret.sh +++ b/tests_e2e/scripts/secret.sh @@ -7,11 +7,13 @@ cp $GRAPH_FILE $TEST_NAME.act cp $CONFIG_FILE $TEST_NAME.actconfig export ACT_GRAPH_FILE=$TEST_NAME.act -export ACT_INPUT_SECRET_API_KEY_123=THIS_IS_A_SECRET +export ACT_INPUT_SECRET_API_KEY_123=THIS_IS_A_SECRET_FROM_BASH +export ACT_INPUT_SECRET_API_KEY_ALIAS=THIS_IS_A_SECRET_2_FROM_BASH #! test actrun unset ACT_INPUT_SECRET_API_KEY_123 +unset ACT_INPUT_SECRET_API_KEY_ALIAS -export ACT_INPUT_SECRETS='{"API_KEY_123": "THIS_IS_ANOTHER_SECRET"}' +export ACT_INPUT_SECRETS='{"API_KEY_ALIAS": "THIS_IS_ANOTHER_SECRET_2_FROM_BASH", "API_KEY_123": "THIS_IS_ANOTHER_SECRET_FROM_BASH"}' #! test actrun unset ACT_INPUT_SECRETS diff --git a/tests_e2e/scripts/secret_leak.act b/tests_e2e/scripts/secret_leak.act index b8e6f3d..53c69b6 100644 --- a/tests_e2e/scripts/secret_leak.act +++ b/tests_e2e/scripts/secret_leak.act @@ -26,7 +26,7 @@ nodes: inputs: values[0]: null - id: core-secret-v1-blackberry-indigo-durian - type: core/secret@v1 + type: core/secret-get@v1 position: x: 30 y: 250