diff --git a/.changeset/perfect-dancers-guess.md b/.changeset/perfect-dancers-guess.md new file mode 100644 index 00000000000..6ee4099c45a --- /dev/null +++ b/.changeset/perfect-dancers-guess.md @@ -0,0 +1,5 @@ +--- +"chainlink": patch +--- + +#internal Rename workflow tags to labels diff --git a/core/services/workflows/models_yaml.go b/core/services/workflows/models_yaml.go index 3d65e24a814..280a895f1b8 100644 --- a/core/services/workflows/models_yaml.go +++ b/core/services/workflows/models_yaml.go @@ -172,8 +172,8 @@ type stepDefinitionYaml struct { // // Eventually, we might support minor version and specific version pins. This will allow workflow authors to have flexibility when selecting the version, and node operators will be able to determine when they should update their capabilities. // - // There are two ways to specify a type - using a string as a fully qualified ID or a structured table. When using a table, tags are ordered alphanumerically and joined into a string following a - // {type}:{tag1_key}_{tag1_value}:{tag2_key}_{tag2_value}@{version} + // There are two ways to specify a type - using a string as a fully qualified ID or a structured table. When using a table, labels are ordered alphanumerically and joined into a string following a + // {name}:{label1_key}_{label1_value}:{label2_key}_{label2_value}@{version} // pattern. // // The “type” supports [a-z0-9_-:] characters followed by an @ and [semver regex] at the end. @@ -191,7 +191,7 @@ type stepDefinitionYaml struct { // type: // name: read_chain // version: 1 - // tags: + // labels: // chain: ethereum // network: mainnet // @@ -319,22 +319,22 @@ func (stepDefinitionType) JSONSchema() *jsonschema.Schema { type stepDefinitionTableType struct { Name string `json:"name"` Version string `json:"version" jsonschema:"pattern=(0|[1-9]\\d*)(?:-((?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$"` - Tags map[string]string `json:"tags"` + Labels map[string]string `json:"labels"` } // String returns the string representation of a stepDefinitionTableType. // // It follows the format: // -// {name}:{tag1_key}_{tag1_value}:{tag2_key}_{tag2_value}@{version} +// {name}:{label1_key}_{label1_value}:{label2_key}_{label2_value}@{version} // -// where tags are ordered alphanumerically. +// where labels are ordered alphanumerically. func (s stepDefinitionTableType) String() string { - tags := make([]string, 0, len(s.Tags)) - for k, v := range s.Tags { - tags = append(tags, fmt.Sprintf("%s_%s", k, v)) + labels := make([]string, 0, len(s.Labels)) + for k, v := range s.Labels { + labels = append(labels, fmt.Sprintf("%s_%s", k, v)) } - slices.Sort(tags) + slices.Sort(labels) - return fmt.Sprintf("%s:%s@%s", s.Name, strings.Join(tags, ":"), s.Version) + return fmt.Sprintf("%s:%s@%s", s.Name, strings.Join(labels, ":"), s.Version) } diff --git a/core/services/workflows/testdata/fixtures/workflows/marshalling/workflow_2.yaml b/core/services/workflows/testdata/fixtures/workflows/marshalling/workflow_2.yaml index f43cd291703..50a598d0bc9 100644 --- a/core/services/workflows/testdata/fixtures/workflows/marshalling/workflow_2.yaml +++ b/core/services/workflows/testdata/fixtures/workflows/marshalling/workflow_2.yaml @@ -9,7 +9,7 @@ - type: name: trigger_test version: "2" - tags: + labels: chain: ethereum aaShouldBeFirst: "true" network: mainnet diff --git a/core/services/workflows/testdata/fixtures/workflows/workflow_schema.json b/core/services/workflows/testdata/fixtures/workflows/workflow_schema.json index 2cb02c7921d..83ecd42ecb9 100644 --- a/core/services/workflows/testdata/fixtures/workflows/workflow_schema.json +++ b/core/services/workflows/testdata/fixtures/workflows/workflow_schema.json @@ -23,7 +23,7 @@ "type": "string", "pattern": "(0|[1-9]\\d*)(?:-((?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$" }, - "tags": { + "labels": { "additionalProperties": { "type": "string" }, @@ -35,7 +35,7 @@ "required": [ "name", "version", - "tags" + "labels" ] } ],