Skip to content

Commit 1a7f94b

Browse files
committed
add configuration as concept 8
1 parent c0b02d8 commit 1a7f94b

File tree

3 files changed

+100
-8
lines changed

3 files changed

+100
-8
lines changed
Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
<mxfile host="Electron" agent="Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) draw.io/27.0.9 Chrome/134.0.6998.205 Electron/35.4.0 Safari/537.36" version="27.0.9">
2+
<diagram name="Page-1" id="IgljjqXF11xHlQnlV1vm">
3+
<mxGraphModel dx="2066" dy="2388" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="827" pageHeight="1169" math="0" shadow="0">
4+
<root>
5+
<mxCell id="0" />
6+
<mxCell id="1" parent="0" />
7+
<mxCell id="ghchXokQqMajBl4t-yi9-3" value="" style="endArrow=none;dashed=1;html=1;rounded=0;strokeWidth=1;" parent="1" edge="1">
8+
<mxGeometry width="50" height="50" relative="1" as="geometry">
9+
<mxPoint x="160" y="-40" as="sourcePoint" />
10+
<mxPoint x="160" y="240" as="targetPoint" />
11+
</mxGeometry>
12+
</mxCell>
13+
<mxCell id="QjxQf7h-RPmqD-Jpzl0V-6" value="" style="endArrow=none;dashed=1;html=1;rounded=0;strokeWidth=1;" parent="1" edge="1">
14+
<mxGeometry width="50" height="50" relative="1" as="geometry">
15+
<mxPoint x="480" y="-40" as="sourcePoint" />
16+
<mxPoint x="480" y="240" as="targetPoint" />
17+
</mxGeometry>
18+
</mxCell>
19+
<mxCell id="QjxQf7h-RPmqD-Jpzl0V-7" value="" style="endArrow=none;html=1;rounded=0;strokeWidth=1;" parent="1" edge="1">
20+
<mxGeometry width="50" height="50" relative="1" as="geometry">
21+
<mxPoint x="640" y="-40" as="sourcePoint" />
22+
<mxPoint x="640" y="240" as="targetPoint" />
23+
</mxGeometry>
24+
</mxCell>
25+
<mxCell id="QjxQf7h-RPmqD-Jpzl0V-1" value="Auto" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontStyle=1;fontSize=14;" parent="1" vertex="1">
26+
<mxGeometry x="50" y="-30" width="60" height="30" as="geometry" />
27+
</mxCell>
28+
<mxCell id="QjxQf7h-RPmqD-Jpzl0V-2" value="File A" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontStyle=1;fontSize=14;" parent="1" vertex="1">
29+
<mxGeometry x="229" y="-30" width="60" height="30" as="geometry" />
30+
</mxCell>
31+
<mxCell id="QjxQf7h-RPmqD-Jpzl0V-3" value="File B" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontStyle=1;fontSize=14;" parent="1" vertex="1">
32+
<mxGeometry x="349" y="-30" width="60" height="30" as="geometry" />
33+
</mxCell>
34+
<mxCell id="QjxQf7h-RPmqD-Jpzl0V-4" value="Runtime" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontStyle=1;fontSize=14;" parent="1" vertex="1">
35+
<mxGeometry x="532" y="-30" width="60" height="30" as="geometry" />
36+
</mxCell>
37+
<mxCell id="QjxQf7h-RPmqD-Jpzl0V-5" value="Actual" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontStyle=1;fontSize=14;" parent="1" vertex="1">
38+
<mxGeometry x="710" y="-30" width="60" height="30" as="geometry" />
39+
</mxCell>
40+
<mxCell id="QjxQf7h-RPmqD-Jpzl0V-8" value="" style="endArrow=none;html=1;rounded=0;strokeWidth=1;" parent="1" edge="1">
41+
<mxGeometry width="50" height="50" relative="1" as="geometry">
42+
<mxPoint x="10" as="sourcePoint" />
43+
<mxPoint x="820" as="targetPoint" />
44+
</mxGeometry>
45+
</mxCell>
46+
<mxCell id="sAZw095eo5NpUbxJhi_2-5" value="Toggle 1" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;" parent="1" vertex="1">
47+
<mxGeometry x="50" y="20" width="60" height="30" as="geometry" />
48+
</mxCell>
49+
<mxCell id="QjxQf7h-RPmqD-Jpzl0V-11" value="Toggle 1" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;" parent="1" vertex="1">
50+
<mxGeometry x="229" y="20" width="60" height="30" as="geometry" />
51+
</mxCell>
52+
<mxCell id="QjxQf7h-RPmqD-Jpzl0V-12" value="Toggle 1" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;" parent="1" vertex="1">
53+
<mxGeometry x="532" y="20" width="60" height="30" as="geometry" />
54+
</mxCell>
55+
<mxCell id="QjxQf7h-RPmqD-Jpzl0V-13" value="Toggle 1&lt;br&gt;from Runtime" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;" parent="1" vertex="1">
56+
<mxGeometry x="690" y="20" width="100" height="30" as="geometry" />
57+
</mxCell>
58+
<mxCell id="QjxQf7h-RPmqD-Jpzl0V-14" value="Toggle 2" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;" parent="1" vertex="1">
59+
<mxGeometry x="50" y="70" width="60" height="30" as="geometry" />
60+
</mxCell>
61+
<mxCell id="QjxQf7h-RPmqD-Jpzl0V-15" value="Toggle 2&lt;br&gt;from Auto" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;" parent="1" vertex="1">
62+
<mxGeometry x="690" y="70" width="100" height="30" as="geometry" />
63+
</mxCell>
64+
<mxCell id="QjxQf7h-RPmqD-Jpzl0V-16" value="Toggle 3" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;" parent="1" vertex="1">
65+
<mxGeometry x="229" y="120" width="60" height="30" as="geometry" />
66+
</mxCell>
67+
<mxCell id="QjxQf7h-RPmqD-Jpzl0V-17" value="Toggle 3" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;" parent="1" vertex="1">
68+
<mxGeometry x="349" y="120" width="60" height="30" as="geometry" />
69+
</mxCell>
70+
<mxCell id="QjxQf7h-RPmqD-Jpzl0V-18" value="Toggle 3&lt;br&gt;from File B" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;" parent="1" vertex="1">
71+
<mxGeometry x="710" y="120" width="60" height="30" as="geometry" />
72+
</mxCell>
73+
<mxCell id="QjxQf7h-RPmqD-Jpzl0V-20" value="Toggle 4" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;" parent="1" vertex="1">
74+
<mxGeometry x="349" y="170" width="60" height="30" as="geometry" />
75+
</mxCell>
76+
<mxCell id="QjxQf7h-RPmqD-Jpzl0V-21" value="Toggle 4&lt;br&gt;from Runtime" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;" parent="1" vertex="1">
77+
<mxGeometry x="700" y="170" width="80" height="30" as="geometry" />
78+
</mxCell>
79+
<mxCell id="QjxQf7h-RPmqD-Jpzl0V-22" value="Toggle 4" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;" parent="1" vertex="1">
80+
<mxGeometry x="532" y="170" width="60" height="30" as="geometry" />
81+
</mxCell>
82+
<mxCell id="wsoxGE0fdQEzw4RMzBQQ-12" value="..." style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontStyle=1;fontSize=14;" vertex="1" parent="1">
83+
<mxGeometry x="409" y="-33" width="60" height="30" as="geometry" />
84+
</mxCell>
85+
</root>
86+
</mxGraphModel>
87+
</diagram>
88+
</mxfile>
20.5 KB
Loading

docs/concepts/index.md

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ Initialization broadly has this workflow:
3232
After initialization, usage code can rely on always getting at least the fallback values (including invalid values) or,
3333
if possible, validated values from Redis.
3434

35-
## Configuration
35+
## Layered Configuration
3636

3737
We define three layers for toggle configurations: auto, files, and runtime. You can think of each layer as one or more
3838
Javascript objects that map feature toggle keys to their respective configurations.
@@ -47,23 +47,27 @@ Javascript objects that map feature toggle keys to their respective configuratio
4747
- _runtime_: are configurations passed just-in-time for initialization. This layer takes precedence over auto and
4848
files.
4949

50+
The relevant configuration setting for each level is listed here:
51+
5052
| layer | cds-plugin mode: cds.env.featureToggles | library mode: initialization(options) |
5153
| ------- | --------------------------------------- | ------------------------------------- |
5254
| auto | happens automatically | `options.configAuto` |
5355
| files | `featureToggles.configFile` or | `options.configFile` or |
5456
| | `featureToggles.configFiles` | `options.configFiles` |
5557
| runtime | `featureToggles.config` | `options.config` |
5658

57-
This approach allows you to override toggle configurations at each level. For a given toggle, the _last occurrence_ of
58-
its configuration will override all previous occurrences. To make the actual configuration clear, you can use
59-
the `/rest/feature/state`, or `/rest/feature/redisRead` endpoints, or their underlying library counterpart
59+
This layered approach allows you to override toggle configurations at each level. For a given toggle, the _last
60+
occurrence_ of its configuration will override all previous occurrences. To make the actual configuration clear, you
61+
can use the `/rest/feature/state`, or `/rest/feature/redisRead` endpoints, or their underlying library counterpart
6062
`toggles.getFeaturesInfos()`.
6163

64+
| ![](concepts-configuration.png) |
65+
| :-----------------------------: |
66+
| _Layered Configuration_ |
67+
6268
{: .info }
63-
// TODO
64-
The toggle configurations in different layers can will be mixed together
65-
The override of a toggle configuration is never partial. In other words, you need to define all intended properties,
66-
for example _validations_, for each occurrence.
69+
The override of a specific toggle configuration is never partial. In other words, you need to define all intended
70+
properties, for example _validations_, for each occurrence.
6771

6872
## Single Key Approach
6973

0 commit comments

Comments
 (0)