Files
tasks/common/dynamicconfig/config/testConfig.yaml
David ReissandGitHub 8fe5b5f5a6 Add generic typed settings (#5939)
## What changed?
Add more flexible generic typed dynamic config. This can be used to
replace lists and maps in a convenient and safe way.
A lot of the work is done by
https://pkg.go.dev/github.com/mitchellh/mapstructure to convert from the
output of yaml.Unmarshal to arbitrary structs.
I'll follow up this PR with another one to convert most of our current
uses of maps to structs.

## Why?
Support more data types and remove a bunch of boilerplate code.

## How did you test it?
unit tests
2024-05-17 15:28:13 -07:00

110 lines
2.3 KiB
YAML

frontend.namespaceCount:
- value:
NamespaceId: 1
constraints: {}
TestCaseInsensitivePropertykEy:
- value: true
constraints: {}
testGetBoolPropertyKey:
- value: false
constraints: {}
- value: true
constraints:
namespace: global-samples-namespace
- value: true
constraints:
namespace: samples-namespace
testGetDurationPropertyKey:
- value: 1m
constraints: {}
- value: wrong duration string
constraints:
namespace: samples-namespace
taskQueueName: longIdleTimeTaskqueue
- value: 2
constraints:
namespace: samples-namespace
- value: true
constraints:
namespace: broken-namespace
testGetFloat64PropertyKey:
- value: 12
constraints: {}
- value: wrong type
constraints:
namespace: samples-namespace
testGetIntPropertyKey:
- value: 1000
constraints: {}
- value: 1000.1
constraints:
namespace: global-samples-namespace
- value: 1001
constraints:
namespace: global-samples-namespace
taskQueueName: test-tq
taskType: Workflow
- value: 1002
constraints:
namespace: global-samples-namespace
taskQueueName: test-tq
taskType: Activity
- value: 1003
constraints:
namespace: global-samples-namespace
taskQueueName: test-tq
- value: 1004
constraints:
namespace: another-namespace
- value: 1005
constraints:
taskQueueName: other-test-tq
testGetMapPropertyKey:
- value:
key1: "1"
key2: 1
key3:
- false
- key4: true
key5: 2.1
constraints: {}
- value: "1"
constraints:
namespace: random-namespace
testGetTypedPropertyKey:
- value:
number: 23.2 # note field is int
days: "6d"
inner:
key1: 12345 # note field is float
key2: true
testGetStringPropertyKey:
- value: some random string
constraints: {}
- value: constrained-string
constraints:
namespace: random-namespace
testGetDurationPropertyFilteredByTaskTypeKey:
- value: 10s
constraints:
historytasktype: ActivityRetryTimer
- value: 10s
constraints:
historytasktype: 1
testGetIntPropertyFilteredByDestinationKey:
- value: 10
constraints: {}
- value: 20
constraints:
namespace: test-namespace
destination: test-destination-1
- value: 30
constraints:
namespace: test-namespace
- value: 40
constraints:
destination: test-destination-1
- value: 50
constraints:
destination: test-destination-2