@radicaltools/cli 0.1.0 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +335 -25
- package/dist/hub-catalogue/concern/concern-api-evolution.radical +935 -0
- package/dist/hub-catalogue/concern/concern-architecture-style.radical +1112 -0
- package/dist/hub-catalogue/concern/concern-authentication.radical +685 -0
- package/dist/hub-catalogue/concern/concern-authorization.radical +1464 -0
- package/dist/hub-catalogue/concern/concern-availability.radical +804 -0
- package/dist/hub-catalogue/concern/concern-backend-stack.radical +1118 -0
- package/dist/hub-catalogue/concern/concern-backup-recovery.radical +1304 -0
- package/dist/hub-catalogue/concern/concern-capacity.radical +802 -0
- package/dist/hub-catalogue/concern/concern-communication-style.radical +1202 -0
- package/dist/hub-catalogue/concern/concern-data-consistency.radical +1081 -0
- package/dist/hub-catalogue/concern/concern-data-store.radical +960 -0
- package/dist/hub-catalogue/concern/concern-decomposition.radical +1143 -0
- package/dist/hub-catalogue/concern/concern-deployment.radical +952 -0
- package/dist/hub-catalogue/concern/concern-encryption.radical +1055 -0
- package/dist/hub-catalogue/concern/concern-frontend-stack.radical +1340 -0
- package/dist/hub-catalogue/concern/concern-infrastructure.radical +1151 -0
- package/dist/hub-catalogue/concern/concern-integration-resilience.radical +1079 -0
- package/dist/hub-catalogue/concern/concern-messaging.radical +940 -0
- package/dist/hub-catalogue/concern/concern-module-boundaries.radical +864 -0
- package/dist/hub-catalogue/concern/concern-observability.radical +1048 -0
- package/dist/hub-catalogue/concern/concern-personal-data.radical +1434 -0
- package/dist/hub-catalogue/concern/concern-rate-limiting.radical +1153 -0
- package/dist/hub-catalogue/concern/concern-secrets.radical +1026 -0
- package/dist/hub-catalogue/concern/concern-supply-chain.radical +1312 -0
- package/dist/hub-catalogue/concern/concern-tenant-isolation.radical +1306 -0
- package/dist/hub-catalogue/concern/concern-test-strategy.radical +1193 -0
- package/dist/index.js +9643 -1332
- package/package.json +6 -3
|
@@ -0,0 +1,952 @@
|
|
|
1
|
+
{
|
|
2
|
+
"hub": {
|
|
3
|
+
"id": "concern-deployment",
|
|
4
|
+
"category": "concern",
|
|
5
|
+
"name": "Deployment and rollback",
|
|
6
|
+
"description": "How a change reaches production and how it is undone: the rollout strategy and its automatic checks, database migrations that keep rollback possible, feature flags, the time to roll back, and the release cadence measured with the DORA metrics.",
|
|
7
|
+
"tags": [
|
|
8
|
+
"operations",
|
|
9
|
+
"deployment",
|
|
10
|
+
"rollback",
|
|
11
|
+
"canary",
|
|
12
|
+
"blue-green",
|
|
13
|
+
"migrations",
|
|
14
|
+
"feature-flags",
|
|
15
|
+
"dora"
|
|
16
|
+
],
|
|
17
|
+
"requiredMetamodel": "c4-ddd-governance-builtin",
|
|
18
|
+
"concern": {
|
|
19
|
+
"id": "deployment",
|
|
20
|
+
"trigger": "LIST NODES WHERE (type = \"container\" OR type = \"webapp\") AND external != true",
|
|
21
|
+
"why": "these elements are deployed and changed in production, so how a change rolls out, and how it is taken back, has to be decided.",
|
|
22
|
+
"group": "operations"
|
|
23
|
+
},
|
|
24
|
+
"sources": [
|
|
25
|
+
{
|
|
26
|
+
"title": "DORA: DevOps Research and Assessment",
|
|
27
|
+
"url": "https://dora.dev/"
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
"title": "Google SRE workbook: Canarying Releases",
|
|
31
|
+
"url": "https://sre.google/workbook/canarying-releases/"
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
"title": "Martin Fowler: Parallel Change (expand and contract)",
|
|
35
|
+
"url": "https://martinfowler.com/bliki/ParallelChange.html"
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
"title": "Martin Fowler: Blue Green Deployment",
|
|
39
|
+
"url": "https://martinfowler.com/bliki/BlueGreenDeployment.html"
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
"title": "Pete Hodgson: Feature Toggles (aka Feature Flags)",
|
|
43
|
+
"url": "https://martinfowler.com/articles/feature-toggles.html"
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
"title": "The Twelve-Factor App, V. Build, release, run",
|
|
47
|
+
"url": "https://12factor.net/build-release-run"
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
"title": "Argo Rollouts documentation",
|
|
51
|
+
"url": "https://argo-rollouts.readthedocs.io/en/stable/"
|
|
52
|
+
}
|
|
53
|
+
],
|
|
54
|
+
"templateParams": [
|
|
55
|
+
{
|
|
56
|
+
"key": "STRATEGY",
|
|
57
|
+
"title": "Rollout",
|
|
58
|
+
"label": "How does a new version roll out?",
|
|
59
|
+
"hint": "This decides how many users a bad version reaches before it is stopped, and how fast it is undone.",
|
|
60
|
+
"defaultValue": "canary",
|
|
61
|
+
"options": [
|
|
62
|
+
{
|
|
63
|
+
"value": "rolling",
|
|
64
|
+
"label": "a rolling update",
|
|
65
|
+
"description": "Instances are replaced a few at a time; old and new versions serve together for minutes. Pick it for small teams and internal services, when both versions can run side by side and the error rate is watched during the rollout."
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
"value": "bluegreen",
|
|
69
|
+
"label": "blue-green",
|
|
70
|
+
"description": "The new version starts beside the old one, is smoke-tested, and all traffic switches at once; switching back takes seconds. Pick it when versions must not serve together, or rollback must be instant, and double capacity during a release is affordable."
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
"value": "canary",
|
|
74
|
+
"label": "a canary with automatic analysis",
|
|
75
|
+
"description": "The new version gets 5 %, then 25 %, then 50 % of traffic; at each step its error rate and latency are compared with the stable one and a worse canary is rolled back by itself. Pick it with enough traffic to judge a step (about 100 requests per step or more) and metrics per version."
|
|
76
|
+
}
|
|
77
|
+
]
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
"key": "MIGRATIONS",
|
|
81
|
+
"title": "Schema changes",
|
|
82
|
+
"label": "How do database schema changes ship?",
|
|
83
|
+
"hint": "During a rollout and after a rollback, the previous version runs against the new schema. A change it cannot read makes rollback impossible.",
|
|
84
|
+
"defaultValue": "expand",
|
|
85
|
+
"options": [
|
|
86
|
+
{
|
|
87
|
+
"value": "expand",
|
|
88
|
+
"label": "expand and contract",
|
|
89
|
+
"description": "Every change is backward compatible for one release: add, migrate data, switch the code, and remove the old only a release later. Pick it whenever the element owns a schema and versions run side by side, which a rolling update and a canary always do."
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
"value": "window",
|
|
93
|
+
"label": "in a maintenance window",
|
|
94
|
+
"description": "Changes that cannot be made online run with the element stopped, in an announced window, after a rehearsal on a copy of production. Pick it only for a large one-off change (a type change on a huge table, a database upgrade) and when downtime is acceptable."
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
"value": "none",
|
|
98
|
+
"label": "no schema of its own",
|
|
99
|
+
"description": "The element keeps no database schema; any state lives in services that own their migrations. Pick it for web front ends, gateways and stateless workers."
|
|
100
|
+
}
|
|
101
|
+
]
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
"key": "FLAGS",
|
|
105
|
+
"title": "Feature flags",
|
|
106
|
+
"label": "Is deploying separate from releasing?",
|
|
107
|
+
"hint": "With feature flags, code reaches production switched off and is turned on for some users, then all, without a deploy; turning it off is the fastest rollback.",
|
|
108
|
+
"defaultValue": "yes",
|
|
109
|
+
"options": [
|
|
110
|
+
{
|
|
111
|
+
"value": "yes",
|
|
112
|
+
"label": "yes, behind feature flags",
|
|
113
|
+
"description": "Unfinished or risky features ship switched off and are turned on per environment or share of users through OpenFeature with a provider (LaunchDarkly, Unleash, flagd, ConfigCat). Pick it with trunk-based development, several changes in flight, or features released at a business date."
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
"value": "no",
|
|
117
|
+
"label": "no, a deploy is a release",
|
|
118
|
+
"description": "What is merged and deployed is live for everyone. Pick it for small teams with fast rollback and features small enough to finish in one change; it avoids the cost of flags and their clean-up."
|
|
119
|
+
}
|
|
120
|
+
]
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
"key": "CADENCE",
|
|
124
|
+
"title": "Cadence",
|
|
125
|
+
"label": "How often does it release?",
|
|
126
|
+
"hint": "Smaller, more frequent releases fail less often and are easier to undo (DORA). The cadence sets the targets for the four DORA metrics.",
|
|
127
|
+
"defaultValue": "continuous",
|
|
128
|
+
"options": [
|
|
129
|
+
{
|
|
130
|
+
"value": "continuous",
|
|
131
|
+
"label": "continuously, every merge",
|
|
132
|
+
"description": "Every change merged to the main branch goes to production through the pipeline, the same day. Pick it with a test suite and rollout checks the team trusts, and a product where small changes can reach users at any time."
|
|
133
|
+
},
|
|
134
|
+
{
|
|
135
|
+
"value": "train",
|
|
136
|
+
"label": "a weekly release train",
|
|
137
|
+
"description": "Changes merged before a weekly cut-off are released together. Pick it when releases need coordination (app stores, customers told in advance, a regulated sign-off), or while the pipeline's checks are not yet trusted."
|
|
138
|
+
}
|
|
139
|
+
]
|
|
140
|
+
},
|
|
141
|
+
{
|
|
142
|
+
"key": "ROLLBACK_MINUTES",
|
|
143
|
+
"label": "How fast must a bad release be undone (minutes)?",
|
|
144
|
+
"defaultValue": "15",
|
|
145
|
+
"type": "number"
|
|
146
|
+
}
|
|
147
|
+
]
|
|
148
|
+
},
|
|
149
|
+
"nodes": [
|
|
150
|
+
{
|
|
151
|
+
"id": "need",
|
|
152
|
+
"type": "need",
|
|
153
|
+
"label": "Changes ship safely and undo quickly",
|
|
154
|
+
"x": 0,
|
|
155
|
+
"y": 0,
|
|
156
|
+
"kind": "brief",
|
|
157
|
+
"source": "Hub concern pack: Deployment and rollback",
|
|
158
|
+
"description": "The team changes this element often while people use it. A change must reach production without an outage, a bad change must be stopped before it reaches most users and be undone within minutes, the database must never block a rollback, and the team must know how often it ships and how often shipping goes wrong."
|
|
159
|
+
},
|
|
160
|
+
{
|
|
161
|
+
"id": "req-rollback",
|
|
162
|
+
"type": "requirement",
|
|
163
|
+
"label": "Bad release undone fast",
|
|
164
|
+
"x": 260,
|
|
165
|
+
"y": 0,
|
|
166
|
+
"ears_type": "event-driven",
|
|
167
|
+
"trigger": "a release raises the error rate or latency above its service level, or a person decides to roll it back",
|
|
168
|
+
"action": "restore the previous version within {{ROLLBACK_MINUTES}} minutes with one action, using the artifact already built for it and no rebuild",
|
|
169
|
+
"rationale": "Most outages start with a change; how long they last is how long the change takes to undo (DORA, failed deployment recovery time; The Twelve-Factor App, V)."
|
|
170
|
+
},
|
|
171
|
+
{
|
|
172
|
+
"id": "req-graceful",
|
|
173
|
+
"type": "requirement",
|
|
174
|
+
"label": "Deploys drop no requests",
|
|
175
|
+
"x": 260,
|
|
176
|
+
"y": 130,
|
|
177
|
+
"ears_type": "ubiquitous",
|
|
178
|
+
"action": "take an instance out of the load balancer and let its requests in flight finish, for up to 30 seconds, before stopping it, and send traffic to a new instance only once its readiness check passes",
|
|
179
|
+
"rationale": "Requests cut off at shutdown and traffic sent to instances still starting are the errors every deployment causes unless they are designed out (Kubernetes documentation, pod termination)."
|
|
180
|
+
},
|
|
181
|
+
{
|
|
182
|
+
"id": "req-rolling",
|
|
183
|
+
"type": "requirement",
|
|
184
|
+
"label": "Rolling update keeps capacity",
|
|
185
|
+
"x": 260,
|
|
186
|
+
"y": 260,
|
|
187
|
+
"ears_type": "event-driven",
|
|
188
|
+
"trigger": "a new version rolls out",
|
|
189
|
+
"action": "replace instances one at a time, starting each new one before an old one stops, and halt the rollout when new instances fail readiness for 5 minutes or the error rate rises above its service level",
|
|
190
|
+
"rationale": "A rolling update that removes capacity first, or carries on past failing instances, turns a bad version into an outage (Kubernetes documentation, Deployments).",
|
|
191
|
+
"hubWhen": {
|
|
192
|
+
"STRATEGY": [
|
|
193
|
+
"rolling"
|
|
194
|
+
]
|
|
195
|
+
}
|
|
196
|
+
},
|
|
197
|
+
{
|
|
198
|
+
"id": "req-bluegreen",
|
|
199
|
+
"type": "requirement",
|
|
200
|
+
"label": "Switch after smoke tests",
|
|
201
|
+
"x": 260,
|
|
202
|
+
"y": 390,
|
|
203
|
+
"ears_type": "event-driven",
|
|
204
|
+
"trigger": "a new version is deployed beside the live one",
|
|
205
|
+
"action": "run smoke tests against it before any user traffic reaches it, switch all traffic at once only when they pass, and keep the previous version running for 60 minutes to switch back to",
|
|
206
|
+
"rationale": "Blue-green buys an instant rollback by keeping the old version warm; the smoke tests decide the switch (Martin Fowler, Blue Green Deployment).",
|
|
207
|
+
"hubWhen": {
|
|
208
|
+
"STRATEGY": [
|
|
209
|
+
"bluegreen"
|
|
210
|
+
]
|
|
211
|
+
}
|
|
212
|
+
},
|
|
213
|
+
{
|
|
214
|
+
"id": "req-canary",
|
|
215
|
+
"type": "requirement",
|
|
216
|
+
"label": "Canary judged automatically",
|
|
217
|
+
"x": 260,
|
|
218
|
+
"y": 520,
|
|
219
|
+
"ears_type": "event-driven",
|
|
220
|
+
"trigger": "a new version rolls out",
|
|
221
|
+
"action": "send it 5 %, 25 % and 50 % of traffic in turn for 10 minutes each, compare its success rate and 95th percentile latency with the stable version at every step, and roll back automatically when the success rate drops below 99 % or the latency is 20 % worse",
|
|
222
|
+
"rationale": "A canary limits a bad version to a small share of users, and an automatic judgement stops it faster than a person watching dashboards (Google SRE workbook, Canarying Releases).",
|
|
223
|
+
"hubWhen": {
|
|
224
|
+
"STRATEGY": [
|
|
225
|
+
"canary"
|
|
226
|
+
]
|
|
227
|
+
}
|
|
228
|
+
},
|
|
229
|
+
{
|
|
230
|
+
"id": "req-expand-contract",
|
|
231
|
+
"type": "requirement",
|
|
232
|
+
"label": "Schema changes stay compatible",
|
|
233
|
+
"x": 260,
|
|
234
|
+
"y": 650,
|
|
235
|
+
"ears_type": "ubiquitous",
|
|
236
|
+
"action": "change the schema only in backward-compatible steps (add, migrate data, switch the code, and remove the old at least one release later), so that the previous version keeps working against the new schema",
|
|
237
|
+
"rationale": "During a rollout and after a rollback, the previous version runs against the new schema; a rename or a drop in one step breaks it (Martin Fowler, Parallel Change).",
|
|
238
|
+
"hubWhen": {
|
|
239
|
+
"MIGRATIONS": [
|
|
240
|
+
"expand"
|
|
241
|
+
]
|
|
242
|
+
}
|
|
243
|
+
},
|
|
244
|
+
{
|
|
245
|
+
"id": "req-migration-window",
|
|
246
|
+
"type": "requirement",
|
|
247
|
+
"label": "Offline migrations rehearsed",
|
|
248
|
+
"x": 260,
|
|
249
|
+
"y": 780,
|
|
250
|
+
"ears_type": "state-driven",
|
|
251
|
+
"precondition": "a schema change cannot run while the element serves",
|
|
252
|
+
"action": "run it only in an announced maintenance window, after a rehearsal on a restored copy of production that finished within half the window, and with a backup taken just before it and a tested way back",
|
|
253
|
+
"rationale": "An offline migration that overruns its window, or cannot be undone, is an outage without an end; the rehearsal tells how long it takes (AWS Well-Architected REL 8).",
|
|
254
|
+
"hubWhen": {
|
|
255
|
+
"MIGRATIONS": [
|
|
256
|
+
"window"
|
|
257
|
+
]
|
|
258
|
+
}
|
|
259
|
+
},
|
|
260
|
+
{
|
|
261
|
+
"id": "req-no-schema",
|
|
262
|
+
"type": "requirement",
|
|
263
|
+
"label": "No schema of its own",
|
|
264
|
+
"x": 260,
|
|
265
|
+
"y": 910,
|
|
266
|
+
"ears_type": "ubiquitous",
|
|
267
|
+
"action": "keep no database schema of its own, leaving every stored state to services that own their migrations",
|
|
268
|
+
"rationale": "An element without a schema can always be rolled back; this keeps it that way until the decision changes.",
|
|
269
|
+
"hubWhen": {
|
|
270
|
+
"MIGRATIONS": [
|
|
271
|
+
"none"
|
|
272
|
+
]
|
|
273
|
+
}
|
|
274
|
+
},
|
|
275
|
+
{
|
|
276
|
+
"id": "req-flags",
|
|
277
|
+
"type": "requirement",
|
|
278
|
+
"label": "Features behind flags",
|
|
279
|
+
"x": 260,
|
|
280
|
+
"y": 1040,
|
|
281
|
+
"ears_type": "ubiquitous",
|
|
282
|
+
"action": "ship unfinished or risky features switched off behind a flag that can be turned on and off per environment and per share of users without a deploy, take effect within 60 seconds, and remove each flag within 30 days of the feature reaching all users",
|
|
283
|
+
"rationale": "Flags separate deploying from releasing and make switching a feature off the fastest rollback; flags left behind become untested branches (Pete Hodgson, Feature Toggles).",
|
|
284
|
+
"hubWhen": {
|
|
285
|
+
"FLAGS": [
|
|
286
|
+
"yes"
|
|
287
|
+
]
|
|
288
|
+
}
|
|
289
|
+
},
|
|
290
|
+
{
|
|
291
|
+
"id": "req-continuous",
|
|
292
|
+
"type": "requirement",
|
|
293
|
+
"label": "Every merge deployed",
|
|
294
|
+
"x": 260,
|
|
295
|
+
"y": 1170,
|
|
296
|
+
"ears_type": "ubiquitous",
|
|
297
|
+
"action": "deploy every change merged to the main branch to production through the automated pipeline within 1 day, keeping the change failure rate under 15 % and recovering from a failed deployment within 1 hour",
|
|
298
|
+
"rationale": "DORA's research ties on-demand deployment and lead times under a day to fewer failed changes and faster recovery (DORA, the four key metrics).",
|
|
299
|
+
"hubWhen": {
|
|
300
|
+
"CADENCE": [
|
|
301
|
+
"continuous"
|
|
302
|
+
]
|
|
303
|
+
}
|
|
304
|
+
},
|
|
305
|
+
{
|
|
306
|
+
"id": "req-train",
|
|
307
|
+
"type": "requirement",
|
|
308
|
+
"label": "Weekly release train",
|
|
309
|
+
"x": 260,
|
|
310
|
+
"y": 1300,
|
|
311
|
+
"ears_type": "event-driven",
|
|
312
|
+
"trigger": "the weekly cut-off passes",
|
|
313
|
+
"action": "release every change merged before it to production within 2 working days, keeping the lead time from merge to production under 7 days and the change failure rate under 15 %",
|
|
314
|
+
"rationale": "A fixed weekly train keeps batches small enough to undo; DORA's metrics show whether it is getting slower or failing more (DORA, the four key metrics).",
|
|
315
|
+
"hubWhen": {
|
|
316
|
+
"CADENCE": [
|
|
317
|
+
"train"
|
|
318
|
+
]
|
|
319
|
+
}
|
|
320
|
+
},
|
|
321
|
+
{
|
|
322
|
+
"id": "sc-rollback",
|
|
323
|
+
"type": "scenario",
|
|
324
|
+
"label": "Rollback timed",
|
|
325
|
+
"x": 520,
|
|
326
|
+
"y": 0,
|
|
327
|
+
"given": "a release that raises the error rate",
|
|
328
|
+
"when": "the rollback is started",
|
|
329
|
+
"then": "the previous version serves all traffic within {{ROLLBACK_MINUTES}} minutes and nothing was rebuilt"
|
|
330
|
+
},
|
|
331
|
+
{
|
|
332
|
+
"id": "sc-graceful",
|
|
333
|
+
"type": "scenario",
|
|
334
|
+
"label": "Release under load",
|
|
335
|
+
"x": 520,
|
|
336
|
+
"y": 130,
|
|
337
|
+
"given": "steady traffic at the usual rate",
|
|
338
|
+
"when": "a new version is deployed",
|
|
339
|
+
"then": "no request fails because of the deployment"
|
|
340
|
+
},
|
|
341
|
+
{
|
|
342
|
+
"id": "sc-rolling",
|
|
343
|
+
"type": "scenario",
|
|
344
|
+
"label": "Broken version halts",
|
|
345
|
+
"x": 520,
|
|
346
|
+
"y": 260,
|
|
347
|
+
"given": "a version whose instances never become ready",
|
|
348
|
+
"when": "it rolls out",
|
|
349
|
+
"then": "the rollout stops after 5 minutes with the old instances still serving",
|
|
350
|
+
"hubWhen": {
|
|
351
|
+
"STRATEGY": [
|
|
352
|
+
"rolling"
|
|
353
|
+
]
|
|
354
|
+
}
|
|
355
|
+
},
|
|
356
|
+
{
|
|
357
|
+
"id": "sc-bluegreen",
|
|
358
|
+
"type": "scenario",
|
|
359
|
+
"label": "Failed smoke test",
|
|
360
|
+
"x": 520,
|
|
361
|
+
"y": 390,
|
|
362
|
+
"given": "a new version whose checkout smoke test fails",
|
|
363
|
+
"when": "it is deployed beside the live one",
|
|
364
|
+
"then": "no user traffic reaches it and the live version keeps serving",
|
|
365
|
+
"hubWhen": {
|
|
366
|
+
"STRATEGY": [
|
|
367
|
+
"bluegreen"
|
|
368
|
+
]
|
|
369
|
+
}
|
|
370
|
+
},
|
|
371
|
+
{
|
|
372
|
+
"id": "sc-canary",
|
|
373
|
+
"type": "scenario",
|
|
374
|
+
"label": "Bad canary rolled back",
|
|
375
|
+
"x": 520,
|
|
376
|
+
"y": 520,
|
|
377
|
+
"given": "a version that fails 3 % of requests",
|
|
378
|
+
"when": "it reaches the 5 % step",
|
|
379
|
+
"then": "the analysis fails and all traffic returns to the stable version within {{ROLLBACK_MINUTES}} minutes",
|
|
380
|
+
"hubWhen": {
|
|
381
|
+
"STRATEGY": [
|
|
382
|
+
"canary"
|
|
383
|
+
]
|
|
384
|
+
}
|
|
385
|
+
},
|
|
386
|
+
{
|
|
387
|
+
"id": "sc-expand-contract",
|
|
388
|
+
"type": "scenario",
|
|
389
|
+
"label": "Rollback after migration",
|
|
390
|
+
"x": 520,
|
|
391
|
+
"y": 650,
|
|
392
|
+
"given": "a release that added a column and a migration that filled it",
|
|
393
|
+
"when": "the release is rolled back",
|
|
394
|
+
"then": "the previous version runs against the new schema without errors",
|
|
395
|
+
"hubWhen": {
|
|
396
|
+
"MIGRATIONS": [
|
|
397
|
+
"expand"
|
|
398
|
+
]
|
|
399
|
+
}
|
|
400
|
+
},
|
|
401
|
+
{
|
|
402
|
+
"id": "sc-migration-window",
|
|
403
|
+
"type": "scenario",
|
|
404
|
+
"label": "Rehearsal decides",
|
|
405
|
+
"x": 520,
|
|
406
|
+
"y": 780,
|
|
407
|
+
"given": "an offline migration planned for a two-hour window",
|
|
408
|
+
"when": "its rehearsal on a copy of production takes 90 minutes",
|
|
409
|
+
"then": "it is not run in that window until it is made faster or the window longer",
|
|
410
|
+
"hubWhen": {
|
|
411
|
+
"MIGRATIONS": [
|
|
412
|
+
"window"
|
|
413
|
+
]
|
|
414
|
+
}
|
|
415
|
+
},
|
|
416
|
+
{
|
|
417
|
+
"id": "sc-no-schema",
|
|
418
|
+
"type": "scenario",
|
|
419
|
+
"label": "Nothing to migrate",
|
|
420
|
+
"x": 520,
|
|
421
|
+
"y": 910,
|
|
422
|
+
"given": "the element's repository",
|
|
423
|
+
"when": "it is searched for migrations and database clients",
|
|
424
|
+
"then": "there are none",
|
|
425
|
+
"hubWhen": {
|
|
426
|
+
"MIGRATIONS": [
|
|
427
|
+
"none"
|
|
428
|
+
]
|
|
429
|
+
}
|
|
430
|
+
},
|
|
431
|
+
{
|
|
432
|
+
"id": "sc-flags",
|
|
433
|
+
"type": "scenario",
|
|
434
|
+
"label": "Feature switched off",
|
|
435
|
+
"x": 520,
|
|
436
|
+
"y": 1040,
|
|
437
|
+
"given": "a feature turned on for 10 % of users",
|
|
438
|
+
"when": "its flag is turned off",
|
|
439
|
+
"then": "within 60 seconds no user sees it, and nothing was deployed",
|
|
440
|
+
"hubWhen": {
|
|
441
|
+
"FLAGS": [
|
|
442
|
+
"yes"
|
|
443
|
+
]
|
|
444
|
+
}
|
|
445
|
+
},
|
|
446
|
+
{
|
|
447
|
+
"id": "sc-continuous",
|
|
448
|
+
"type": "scenario",
|
|
449
|
+
"label": "Merge reaches production",
|
|
450
|
+
"x": 520,
|
|
451
|
+
"y": 1170,
|
|
452
|
+
"given": "a change merged to the main branch in the morning",
|
|
453
|
+
"when": "the day ends",
|
|
454
|
+
"then": "it is in production, deployed by the pipeline",
|
|
455
|
+
"hubWhen": {
|
|
456
|
+
"CADENCE": [
|
|
457
|
+
"continuous"
|
|
458
|
+
]
|
|
459
|
+
}
|
|
460
|
+
},
|
|
461
|
+
{
|
|
462
|
+
"id": "sc-train",
|
|
463
|
+
"type": "scenario",
|
|
464
|
+
"label": "Train leaves on time",
|
|
465
|
+
"x": 520,
|
|
466
|
+
"y": 1300,
|
|
467
|
+
"given": "changes merged before Tuesday's cut-off",
|
|
468
|
+
"when": "the release train runs",
|
|
469
|
+
"then": "they are in production by Thursday",
|
|
470
|
+
"hubWhen": {
|
|
471
|
+
"CADENCE": [
|
|
472
|
+
"train"
|
|
473
|
+
]
|
|
474
|
+
}
|
|
475
|
+
},
|
|
476
|
+
{
|
|
477
|
+
"id": "adr-rolling",
|
|
478
|
+
"type": "adr",
|
|
479
|
+
"label": "Rolling updates",
|
|
480
|
+
"x": 780,
|
|
481
|
+
"y": 0,
|
|
482
|
+
"concern": "deployment",
|
|
483
|
+
"status": "accepted",
|
|
484
|
+
"date": "",
|
|
485
|
+
"context": "This element is changed and deployed while people use it. The forces: most outages start with a change, so how a change reaches production decides much of the availability; a release that cannot be undone quickly turns a small mistake into a long outage; old and new versions run side by side during most deployments and both must work against the same database; a schema change that the previous version cannot read makes rollback impossible; small, frequent changes fail less often and are easier to undo than large, rare ones (DORA); and deploying is not the same as releasing: code can be in production without users seeing it.",
|
|
486
|
+
"decision": "New versions roll out as a rolling update: on Kubernetes a Deployment with maxUnavailable 0 and maxSurge 1, readiness probes, a preStop delay and a progress deadline of 5 minutes; on other platforms the equivalent (ECS rolling deployments with the deployment circuit breaker, Azure App Service or Cloud Run revisions). The pipeline watches the error rate during the rollout and runs kubectl rollout undo (or the platform's rollback) when it rises. The previous version's image stays in the registry, so rollback takes {{ROLLBACK_MINUTES}} minutes at most. Schema changes: {{MIGRATIONS}}. Feature flags: {{FLAGS}}. Cadence: {{CADENCE}}.",
|
|
487
|
+
"consequences": "• Nothing to install beyond the platform; the cheapest strategy.\n• Old and new versions serve together for minutes: both must work with the same schema and messages.\n• A bad version reaches a growing share of users until someone or something notices.\n• Rollback is another rolling update, minutes rather than seconds.",
|
|
488
|
+
"alternatives": "1. Canary with automatic analysis: limits a bad version to 5 % of traffic, but needs Argo Rollouts or Flagger and metrics per version.\n2. Blue-green: instant switch back, at double capacity during each release.",
|
|
489
|
+
"hubWhen": {
|
|
490
|
+
"STRATEGY": [
|
|
491
|
+
"rolling"
|
|
492
|
+
]
|
|
493
|
+
}
|
|
494
|
+
},
|
|
495
|
+
{
|
|
496
|
+
"id": "adr-bluegreen",
|
|
497
|
+
"type": "adr",
|
|
498
|
+
"label": "Blue-green deployments",
|
|
499
|
+
"x": 780,
|
|
500
|
+
"y": 130,
|
|
501
|
+
"concern": "deployment",
|
|
502
|
+
"status": "accepted",
|
|
503
|
+
"date": "",
|
|
504
|
+
"context": "This element is changed and deployed while people use it. The forces: most outages start with a change, so how a change reaches production decides much of the availability; a release that cannot be undone quickly turns a small mistake into a long outage; old and new versions run side by side during most deployments and both must work against the same database; a schema change that the previous version cannot read makes rollback impossible; small, frequent changes fail less often and are easier to undo than large, rare ones (DORA); and deploying is not the same as releasing: code can be in production without users seeing it.",
|
|
505
|
+
"decision": "New versions deploy beside the live one and take traffic all at once after their smoke tests pass: on Kubernetes with Argo Rollouts (blueGreen strategy with pre-promotion analysis), elsewhere with AWS CodeDeploy blue/green, Azure App Service deployment slots or two target groups behind the load balancer. The previous version keeps running for 60 minutes after the switch, so switching back takes seconds and always within {{ROLLBACK_MINUTES}} minutes. Schema changes: {{MIGRATIONS}}. Feature flags: {{FLAGS}}. Cadence: {{CADENCE}}. Choose the tool by the platform the element runs on.",
|
|
506
|
+
"consequences": "• Rollback is a switch: seconds, not a redeploy.\n• Users never see two versions at once, but the database does: the schema must still suit both.\n• Double the capacity during each release, and a full environment to warm up.\n• All users get the new version at once; smoke tests are the only gate before them.",
|
|
507
|
+
"alternatives": "1. Canary: exposes a bad version to a few users first, with gradual traffic shifting.\n2. Rolling update: no extra capacity, but rollback is slower and versions mix.",
|
|
508
|
+
"hubWhen": {
|
|
509
|
+
"STRATEGY": [
|
|
510
|
+
"bluegreen"
|
|
511
|
+
]
|
|
512
|
+
}
|
|
513
|
+
},
|
|
514
|
+
{
|
|
515
|
+
"id": "adr-canary",
|
|
516
|
+
"type": "adr",
|
|
517
|
+
"label": "Canary with automatic analysis",
|
|
518
|
+
"x": 780,
|
|
519
|
+
"y": 260,
|
|
520
|
+
"concern": "deployment",
|
|
521
|
+
"status": "accepted",
|
|
522
|
+
"date": "",
|
|
523
|
+
"context": "This element is changed and deployed while people use it. The forces: most outages start with a change, so how a change reaches production decides much of the availability; a release that cannot be undone quickly turns a small mistake into a long outage; old and new versions run side by side during most deployments and both must work against the same database; a schema change that the previous version cannot read makes rollback impossible; small, frequent changes fail less often and are easier to undo than large, rare ones (DORA); and deploying is not the same as releasing: code can be in production without users seeing it.",
|
|
524
|
+
"decision": "New versions roll out as a canary: 5 %, 25 %, 50 %, then 100 % of traffic, 10 minutes per step, with an automatic analysis at every step that compares the canary's success rate and 95th percentile latency (from Prometheus or the metrics backend) with the stable version and aborts on a worse result. Tooling: Argo Rollouts or Flagger on Kubernetes, with traffic split by the ingress or service mesh (NGINX, Istio, Linkerd, Gateway API); AWS CodeDeploy or App Mesh canaries on ECS and Lambda. Choose Argo Rollouts when the team already uses Argo CD, Flagger when it uses Flux. An abort returns all traffic to the stable version within {{ROLLBACK_MINUTES}} minutes. Schema changes: {{MIGRATIONS}}. Feature flags: {{FLAGS}}. Cadence: {{CADENCE}}.",
|
|
525
|
+
"consequences": "• A bad version reaches 5 % of users for minutes, not everyone.\n• Rollback is automatic and does not wait for a person.\n• Needs metrics per version and enough traffic for the analysis to be meaningful; at low traffic the steps judge noise.\n• A rollout takes 30 minutes or more; urgent fixes need a documented fast path.",
|
|
526
|
+
"alternatives": "1. Rolling update with a person watching: simpler, but slower to notice and a bad version reaches everyone.\n2. Blue-green: instant switch back, but everyone gets the new version at once.",
|
|
527
|
+
"hubWhen": {
|
|
528
|
+
"STRATEGY": [
|
|
529
|
+
"canary"
|
|
530
|
+
]
|
|
531
|
+
}
|
|
532
|
+
},
|
|
533
|
+
{
|
|
534
|
+
"id": "adr-expand-contract",
|
|
535
|
+
"type": "adr",
|
|
536
|
+
"label": "Expand and contract migrations",
|
|
537
|
+
"x": 780,
|
|
538
|
+
"y": 390,
|
|
539
|
+
"concern": "deployment",
|
|
540
|
+
"status": "accepted",
|
|
541
|
+
"date": "",
|
|
542
|
+
"context": "This element is changed and deployed while people use it. The forces: most outages start with a change, so how a change reaches production decides much of the availability; a release that cannot be undone quickly turns a small mistake into a long outage; old and new versions run side by side during most deployments and both must work against the same database; a schema change that the previous version cannot read makes rollback impossible; small, frequent changes fail less often and are easier to undo than large, rare ones (DORA); and deploying is not the same as releasing: code can be in production without users seeing it.",
|
|
543
|
+
"decision": "Schema changes ship as expand and contract: a migration only adds (columns, tables, indexes built concurrently), data is backfilled in batches, the code switches over in a later release, and removals come at least one release after nothing reads the old shape. Migrations run as a separate pipeline step before the new version rolls out, with a migration tool that records what ran: Flyway, Liquibase, Atlas, or the framework's own (Entity Framework, Alembic, Prisma Migrate). A linter in CI refuses destructive or backward-incompatible changes (Atlas migrate lint, or Squawk for PostgreSQL).",
|
|
544
|
+
"consequences": "• The previous version always runs against the current schema, so rollback never waits on the database.\n• A rename or type change takes two or three releases instead of one.\n• Old columns linger until the contract step; someone has to schedule it.\n• Backfills on large tables run in batches, outside the deployment.",
|
|
545
|
+
"alternatives": "1. Migrations in a maintenance window: one step, but downtime and no quick rollback.\n2. Migrations that run on application start: simple, but every instance races to migrate and a failure blocks the rollout.",
|
|
546
|
+
"hubWhen": {
|
|
547
|
+
"MIGRATIONS": [
|
|
548
|
+
"expand"
|
|
549
|
+
]
|
|
550
|
+
}
|
|
551
|
+
},
|
|
552
|
+
{
|
|
553
|
+
"id": "adr-migration-window",
|
|
554
|
+
"type": "adr",
|
|
555
|
+
"label": "Offline migrations in a window",
|
|
556
|
+
"x": 780,
|
|
557
|
+
"y": 520,
|
|
558
|
+
"concern": "deployment",
|
|
559
|
+
"status": "accepted",
|
|
560
|
+
"date": "",
|
|
561
|
+
"context": "This element is changed and deployed while people use it. The forces: most outages start with a change, so how a change reaches production decides much of the availability; a release that cannot be undone quickly turns a small mistake into a long outage; old and new versions run side by side during most deployments and both must work against the same database; a schema change that the previous version cannot read makes rollback impossible; small, frequent changes fail less often and are easier to undo than large, rare ones (DORA); and deploying is not the same as releasing: code can be in production without users seeing it.",
|
|
562
|
+
"decision": "Schema changes that cannot run online are made in an announced maintenance window with the element stopped. Before the window, the migration is rehearsed on a copy of production restored from the latest backup, and it runs only if the rehearsal finished within half the window. Just before it, a fresh backup is taken; the way back (a down-migration or the restore) is part of the rehearsal. Changes that can run online still ship as expand and contract. Migrations run with Flyway, Liquibase, Atlas or the framework's own tool, from the pipeline, never by hand.",
|
|
563
|
+
"consequences": "• Large or awkward changes can be done in one step.\n• Each window is downtime, announced in advance and counted by users if not by the target.\n• Rollback after the window means restoring the backup and losing what was written since.\n• A copy of production for the rehearsal must be kept safe like production.",
|
|
564
|
+
"alternatives": "1. Expand and contract only: no downtime, but some changes take several releases.\n2. Online schema change tools (gh-ost, pt-online-schema-change, pg_repack): big changes without downtime, with tooling to learn.",
|
|
565
|
+
"hubWhen": {
|
|
566
|
+
"MIGRATIONS": [
|
|
567
|
+
"window"
|
|
568
|
+
]
|
|
569
|
+
}
|
|
570
|
+
},
|
|
571
|
+
{
|
|
572
|
+
"id": "adr-continuous",
|
|
573
|
+
"type": "adr",
|
|
574
|
+
"label": "Continuous deployment",
|
|
575
|
+
"x": 780,
|
|
576
|
+
"y": 650,
|
|
577
|
+
"concern": "deployment",
|
|
578
|
+
"status": "accepted",
|
|
579
|
+
"date": "",
|
|
580
|
+
"context": "This element is changed and deployed while people use it. The forces: most outages start with a change, so how a change reaches production decides much of the availability; a release that cannot be undone quickly turns a small mistake into a long outage; old and new versions run side by side during most deployments and both must work against the same database; a schema change that the previous version cannot read makes rollback impossible; small, frequent changes fail less often and are easier to undo than large, rare ones (DORA); and deploying is not the same as releasing: code can be in production without users seeing it.",
|
|
581
|
+
"decision": "Every change merged to the main branch goes to production through the pipeline without a manual step, the same day: trunk-based development with short-lived branches, the rollout strategy above as the safety net, and feature flags ({{FLAGS}}) for what is not ready. The four DORA metrics are measured from the pipeline and the incident tracker (Apache DevLake, Sleuth, LinearB or the CI system's own reports) and reviewed every month: deployment frequency daily or more, lead time for changes under 1 day, change failure rate under 15 %, failed deployment recovery under 1 hour.",
|
|
582
|
+
"consequences": "• Small batches: each release is easy to understand and to undo.\n• The pipeline's tests and rollout checks are the only gate; their quality is the release process.\n• Users see changes continuously; announcements are tied to flags, not deploys.",
|
|
583
|
+
"alternatives": "1. A weekly release train: more coordination, larger batches.\n2. Manual approval of each production deploy: a person as the gate, slower without being safer.",
|
|
584
|
+
"hubWhen": {
|
|
585
|
+
"CADENCE": [
|
|
586
|
+
"continuous"
|
|
587
|
+
]
|
|
588
|
+
}
|
|
589
|
+
},
|
|
590
|
+
{
|
|
591
|
+
"id": "adr-release-train",
|
|
592
|
+
"type": "adr",
|
|
593
|
+
"label": "Weekly release train",
|
|
594
|
+
"x": 780,
|
|
595
|
+
"y": 780,
|
|
596
|
+
"concern": "deployment",
|
|
597
|
+
"status": "accepted",
|
|
598
|
+
"date": "",
|
|
599
|
+
"context": "This element is changed and deployed while people use it. The forces: most outages start with a change, so how a change reaches production decides much of the availability; a release that cannot be undone quickly turns a small mistake into a long outage; old and new versions run side by side during most deployments and both must work against the same database; a schema change that the previous version cannot read makes rollback impossible; small, frequent changes fail less often and are easier to undo than large, rare ones (DORA); and deploying is not the same as releasing: code can be in production without users seeing it.",
|
|
600
|
+
"decision": "Changes merged before a weekly cut-off are released together within 2 working days, through the same automated pipeline and rollout strategy; urgent fixes can leave outside the train. The four DORA metrics are measured from the pipeline and the incident tracker (Apache DevLake, Sleuth, LinearB or the CI system's own reports) and reviewed every month: at least one production release every 7 days, lead time for changes under 7 days, change failure rate under 15 %, failed deployment recovery under 1 day. Feature flags: {{FLAGS}}.",
|
|
601
|
+
"consequences": "• Releases are predictable for customers, support and app stores.\n• Batches are a week of changes: a failure is harder to pin on one change.\n• Lead time is up to a week by design; moving to continuous deployment later is a change of policy, not of tooling.",
|
|
602
|
+
"alternatives": "1. Continuous deployment: smaller batches and shorter lead time, with full trust in the pipeline.\n2. Monthly or quarterly releases: big batches that fail more often and are hard to undo (DORA).",
|
|
603
|
+
"hubWhen": {
|
|
604
|
+
"CADENCE": [
|
|
605
|
+
"train"
|
|
606
|
+
]
|
|
607
|
+
}
|
|
608
|
+
},
|
|
609
|
+
{
|
|
610
|
+
"id": "ff-rollback-drill",
|
|
611
|
+
"type": "fitness-fn",
|
|
612
|
+
"label": "Rollback drilled",
|
|
613
|
+
"x": 1040,
|
|
614
|
+
"y": 0,
|
|
615
|
+
"category": "operational",
|
|
616
|
+
"threshold": "Rollback of the staging deployment to the previous version completes within {{ROLLBACK_MINUTES}} minutes, every week",
|
|
617
|
+
"description": "A scheduled pipeline rolls the staging deployment back to the previous version and forward again, timing each, and fails past {{ROLLBACK_MINUTES}} minutes. With Argo Rollouts use kubectl argo rollouts undo and status instead.\n\nTool: GitHub Actions scheduled workflow with kubectl\n\n```yaml\nname: rollback-drill\non:\n schedule: [{ cron: '0 9 * * 1' }] # Mondays 09:00\njobs:\n drill:\n runs-on: ubuntu-latest\n environment: staging\n steps:\n - name: Roll back and time it\n run: |\n start=$(date +%s)\n kubectl -n shop-staging rollout undo deployment/order-api\n kubectl -n shop-staging rollout status deployment/order-api --timeout={{ROLLBACK_MINUTES}}m\n echo \"Rolled back in $(( $(date +%s) - start )) s\"\n - name: Roll forward again\n if: always()\n run: |\n kubectl -n shop-staging rollout undo deployment/order-api\n kubectl -n shop-staging rollout status deployment/order-api --timeout={{ROLLBACK_MINUTES}}m\n```"
|
|
618
|
+
},
|
|
619
|
+
{
|
|
620
|
+
"id": "ff-rolling",
|
|
621
|
+
"type": "fitness-fn",
|
|
622
|
+
"label": "Rolling update keeps capacity",
|
|
623
|
+
"x": 1040,
|
|
624
|
+
"y": 130,
|
|
625
|
+
"category": "structural",
|
|
626
|
+
"threshold": "0 Deployments with maxUnavailable above 0, without a readiness probe, or without a progress deadline of at most 300 s",
|
|
627
|
+
"description": "A policy over the Kubernetes manifests fails the pipeline when a Deployment could remove capacity during a rollout, route traffic to instances that are not ready, or carry on forever past failing instances.\n\nTool: Conftest (Open Policy Agent)\n\n```rego\npackage main\n\nimport rego.v1\n\ndeny contains msg if {\n input.kind == \"Deployment\"\n object.get(input.spec, [\"strategy\", \"rollingUpdate\", \"maxUnavailable\"], \"25%\") != 0\n msg := sprintf(\"%s: set strategy.rollingUpdate.maxUnavailable to 0\", [input.metadata.name])\n}\n\ndeny contains msg if {\n input.kind == \"Deployment\"\n object.get(input.spec, \"progressDeadlineSeconds\", 600) > 300\n msg := sprintf(\"%s: set progressDeadlineSeconds to 300 or less\", [input.metadata.name])\n}\n\ndeny contains msg if {\n input.kind == \"Deployment\"\n some c in input.spec.template.spec.containers\n not c.readinessProbe\n msg := sprintf(\"%s: container %s has no readinessProbe\", [input.metadata.name, c.name])\n}\n```",
|
|
628
|
+
"hubWhen": {
|
|
629
|
+
"STRATEGY": [
|
|
630
|
+
"rolling"
|
|
631
|
+
]
|
|
632
|
+
}
|
|
633
|
+
},
|
|
634
|
+
{
|
|
635
|
+
"id": "ff-bluegreen",
|
|
636
|
+
"type": "fitness-fn",
|
|
637
|
+
"label": "Switch gated by smoke tests",
|
|
638
|
+
"x": 1040,
|
|
639
|
+
"y": 260,
|
|
640
|
+
"category": "operational",
|
|
641
|
+
"threshold": "Traffic switches only after the smoke tests pass on the preview; the previous version kept for 3600 s",
|
|
642
|
+
"description": "The Rollout runs a smoke-test job against the preview service before promotion; a failed job aborts the release with the live version untouched. The previous version is scaled down only an hour after the switch.\n\nTool: Argo Rollouts (blueGreen strategy, pre-promotion analysis)\n\n```yaml\napiVersion: argoproj.io/v1alpha1\nkind: Rollout\nmetadata: { name: order-api, namespace: shop }\nspec:\n strategy:\n blueGreen:\n activeService: order-api\n previewService: order-api-preview\n autoPromotionEnabled: true\n scaleDownDelaySeconds: 3600\n prePromotionAnalysis:\n templates: [{ templateName: smoke-tests }]\n---\napiVersion: argoproj.io/v1alpha1\nkind: AnalysisTemplate\nmetadata: { name: smoke-tests, namespace: shop }\nspec:\n metrics:\n - name: smoke\n provider:\n job:\n spec:\n backoffLimit: 0\n template:\n spec:\n restartPolicy: Never\n containers:\n - name: k6\n image: grafana/k6:0.54.0\n args: [run, --env, BASE_URL=http://order-api-preview, /tests/smoke.js]\n```",
|
|
643
|
+
"hubWhen": {
|
|
644
|
+
"STRATEGY": [
|
|
645
|
+
"bluegreen"
|
|
646
|
+
]
|
|
647
|
+
}
|
|
648
|
+
},
|
|
649
|
+
{
|
|
650
|
+
"id": "ff-canary",
|
|
651
|
+
"type": "fitness-fn",
|
|
652
|
+
"label": "Canary analysis aborts bad versions",
|
|
653
|
+
"x": 1040,
|
|
654
|
+
"y": 390,
|
|
655
|
+
"category": "operational",
|
|
656
|
+
"threshold": "A canary step fails at a success rate below 99 % or a 95th percentile above 0.5 s; 0 bad versions promoted past 5 %",
|
|
657
|
+
"description": "The Rollout shifts traffic in steps and runs an analysis from the first step on; two failed measurements abort the rollout and return all traffic to the stable version. Flagger's Canary resource with metric templates does the same.\n\nTool: Argo Rollouts (canary strategy with a Prometheus AnalysisTemplate)\n\n```yaml\napiVersion: argoproj.io/v1alpha1\nkind: Rollout\nmetadata: { name: order-api, namespace: shop }\nspec:\n strategy:\n canary:\n canaryService: order-api-canary\n stableService: order-api\n trafficRouting: { nginx: { stableIngress: order-api } }\n analysis:\n templates: [{ templateName: canary-health }]\n startingStep: 1\n args: [{ name: service, value: order-api-canary }]\n steps:\n - setWeight: 5\n - pause: { duration: 10m }\n - setWeight: 25\n - pause: { duration: 10m }\n - setWeight: 50\n - pause: { duration: 10m }\n---\napiVersion: argoproj.io/v1alpha1\nkind: AnalysisTemplate\nmetadata: { name: canary-health, namespace: shop }\nspec:\n args: [{ name: service }]\n metrics:\n - name: success-rate\n interval: 1m\n failureLimit: 2\n successCondition: result[0] >= 0.99\n provider:\n prometheus:\n address: http://prometheus.monitoring:9090\n query: |\n sum(rate(http_server_request_duration_seconds_count{service=\"{{args.service}}\",http_response_status_code!~\"5..\"}[2m]))\n / sum(rate(http_server_request_duration_seconds_count{service=\"{{args.service}}\"}[2m]))\n - name: p95-latency\n interval: 1m\n failureLimit: 2\n successCondition: result[0] <= 0.5\n provider:\n prometheus:\n address: http://prometheus.monitoring:9090\n query: |\n histogram_quantile(0.95, sum by (le) (rate(http_server_request_duration_seconds_bucket{service=\"{{args.service}}\"}[2m])))\n```",
|
|
658
|
+
"hubWhen": {
|
|
659
|
+
"STRATEGY": [
|
|
660
|
+
"canary"
|
|
661
|
+
]
|
|
662
|
+
}
|
|
663
|
+
},
|
|
664
|
+
{
|
|
665
|
+
"id": "ff-migration-lint",
|
|
666
|
+
"type": "fitness-fn",
|
|
667
|
+
"label": "Migrations stay compatible",
|
|
668
|
+
"x": 1040,
|
|
669
|
+
"y": 520,
|
|
670
|
+
"category": "structural",
|
|
671
|
+
"threshold": "0 destructive or backward-incompatible statements (drop, rename, type change) in a migration that is not a marked contract step",
|
|
672
|
+
"description": "Every pull request that adds a migration is linted against the main branch; dropping or renaming a column or table fails the build unless the migration is the contract step of an earlier expand, marked with a lint directive and reviewed.\n\nTool: Atlas (atlas migrate lint); Squawk does the same for PostgreSQL\n\n```hcl\n# atlas.hcl\nlint {\n destructive {\n error = true\n }\n incompatible {\n error = true\n }\n}\n\nenv \"ci\" {\n dev = \"docker://postgres/16/dev\"\n migration {\n dir = \"file://migrations\"\n }\n}\n\n# CI step:\n# atlas migrate lint --env ci --git-base origin/main\n# A reviewed contract step opts out per statement with:\n# -- atlas:nolint destructive\n```",
|
|
673
|
+
"hubWhen": {
|
|
674
|
+
"MIGRATIONS": [
|
|
675
|
+
"expand"
|
|
676
|
+
]
|
|
677
|
+
}
|
|
678
|
+
},
|
|
679
|
+
{
|
|
680
|
+
"id": "ff-migration-rehearsal",
|
|
681
|
+
"type": "fitness-fn",
|
|
682
|
+
"label": "Offline migration rehearsed",
|
|
683
|
+
"x": 1040,
|
|
684
|
+
"y": 650,
|
|
685
|
+
"category": "process",
|
|
686
|
+
"threshold": "Rehearsal on a restored copy of production finishes within half the window (60 minutes for a 2-hour window); the production run needs an approved environment",
|
|
687
|
+
"description": "A pipeline job restores the latest backup into a rehearsal database, runs the pending migrations against it and times them; the production job runs only after an approval in a protected environment and fails if the rehearsal took longer than half the window.\n\nTool: GitHub Actions (protected environment) with pg_restore and Flyway\n\n```yaml\njobs:\n rehearse:\n runs-on: ubuntu-latest\n steps:\n - run: |\n pg_restore --clean --no-owner -d \"$REHEARSAL_DB_URL\" backups/latest.dump\n start=$(date +%s)\n flyway -url=\"$REHEARSAL_JDBC_URL\" -locations=filesystem:migrations migrate\n took=$(( $(date +%s) - start ))\n echo \"Rehearsal took $took s\"\n test \"$took\" -le 3600 || { echo \"::error::Longer than half the window\"; exit 1; }\n migrate:\n needs: rehearse\n runs-on: ubuntu-latest\n environment: production-maintenance # required reviewers, window announced\n steps:\n - run: |\n ./scripts/backup-now.sh\n flyway -url=\"$PROD_JDBC_URL\" -locations=filesystem:migrations migrate\n```",
|
|
688
|
+
"hubWhen": {
|
|
689
|
+
"MIGRATIONS": [
|
|
690
|
+
"window"
|
|
691
|
+
]
|
|
692
|
+
}
|
|
693
|
+
},
|
|
694
|
+
{
|
|
695
|
+
"id": "ff-flag-age",
|
|
696
|
+
"type": "fitness-fn",
|
|
697
|
+
"label": "Stale flags removed",
|
|
698
|
+
"x": 1040,
|
|
699
|
+
"y": 780,
|
|
700
|
+
"category": "structural",
|
|
701
|
+
"threshold": "0 flags fully released for more than 30 days",
|
|
702
|
+
"description": "A test reads the flag definitions kept in the repository and fails for every flag that has been on for all users for more than 30 days, so that it is removed with the code path behind it.\n\nTool: Vitest over flagd (OpenFeature) flag definitions\n\n```ts\nimport { readFileSync } from 'node:fs'\n\nconst { flags } = JSON.parse(readFileSync('flags/flags.flagd.json', 'utf8')) as {\n flags: Record<string, { metadata?: { fullyReleasedAt?: string } }>\n}\nconst MAX_DAYS = 30\n\nit.each(Object.entries(flags))('flag %s is removed within 30 days of full release', (key, flag) => {\n const released = flag.metadata?.fullyReleasedAt\n if (!released) return\n const days = (Date.now() - Date.parse(released)) / 86_400_000\n expect(days, `remove flag ${key}: fully released ${Math.floor(days)} days ago`).toBeLessThanOrEqual(MAX_DAYS)\n})\n```",
|
|
703
|
+
"hubWhen": {
|
|
704
|
+
"FLAGS": [
|
|
705
|
+
"yes"
|
|
706
|
+
]
|
|
707
|
+
}
|
|
708
|
+
},
|
|
709
|
+
{
|
|
710
|
+
"id": "ff-dora-continuous",
|
|
711
|
+
"type": "fitness-fn",
|
|
712
|
+
"label": "Deploys daily",
|
|
713
|
+
"x": 1040,
|
|
714
|
+
"y": 910,
|
|
715
|
+
"category": "process",
|
|
716
|
+
"threshold": "Production deployments on at least 5 days of every week; lead time under 1 day and change failure rate under 15 % in the monthly DORA review",
|
|
717
|
+
"description": "A weekly job counts the days with a production deployment in the last 7 days from the repository's deployments and fails below 5; lead time and change failure rate come from the DORA dashboard (Apache DevLake) in the monthly review.\n\nTool: GitHub CLI in a scheduled GitHub Actions job; Apache DevLake for the DORA dashboard\n\n```yaml\nname: dora-deployment-frequency\non:\n schedule: [{ cron: '0 7 * * 1' }]\njobs:\n frequency:\n runs-on: ubuntu-latest\n steps:\n - env:\n GH_TOKEN: ${{ github.token }}\n run: |\n since=$(date -u -d '-7 days' +%FT%TZ)\n days=$(gh api \"repos/${{ github.repository }}/deployments?environment=production&per_page=100\" \\\n --jq \"[.[] | select(.created_at > \\\"$since\\\") | .created_at[0:10]] | unique | length\")\n echo \"Days with a production deployment in the last 7: $days\"\n test \"$days\" -ge 5\n```",
|
|
718
|
+
"hubWhen": {
|
|
719
|
+
"CADENCE": [
|
|
720
|
+
"continuous"
|
|
721
|
+
]
|
|
722
|
+
}
|
|
723
|
+
},
|
|
724
|
+
{
|
|
725
|
+
"id": "ff-dora-train",
|
|
726
|
+
"type": "fitness-fn",
|
|
727
|
+
"label": "Train leaves weekly",
|
|
728
|
+
"x": 1040,
|
|
729
|
+
"y": 1040,
|
|
730
|
+
"category": "process",
|
|
731
|
+
"threshold": "At least 1 production deployment in every 7 days; lead time under 7 days and change failure rate under 15 % in the monthly DORA review",
|
|
732
|
+
"description": "A weekly job fails when no production deployment happened in the last 7 days; lead time and change failure rate come from the DORA dashboard (Apache DevLake) in the monthly review.\n\nTool: GitHub CLI in a scheduled GitHub Actions job; Apache DevLake for the DORA dashboard\n\n```yaml\nname: dora-release-train\non:\n schedule: [{ cron: '0 7 * * 1' }]\njobs:\n train:\n runs-on: ubuntu-latest\n steps:\n - env:\n GH_TOKEN: ${{ github.token }}\n run: |\n since=$(date -u -d '-7 days' +%FT%TZ)\n n=$(gh api \"repos/${{ github.repository }}/deployments?environment=production&per_page=100\" \\\n --jq \"[.[] | select(.created_at > \\\"$since\\\")] | length\")\n echo \"Production deployments in the last 7 days: $n\"\n test \"$n\" -ge 1\n```",
|
|
733
|
+
"hubWhen": {
|
|
734
|
+
"CADENCE": [
|
|
735
|
+
"train"
|
|
736
|
+
]
|
|
737
|
+
}
|
|
738
|
+
}
|
|
739
|
+
],
|
|
740
|
+
"relations": [
|
|
741
|
+
{
|
|
742
|
+
"id": "req-rollback--derives--need",
|
|
743
|
+
"sourceId": "req-rollback",
|
|
744
|
+
"targetId": "need",
|
|
745
|
+
"relationType": "derives"
|
|
746
|
+
},
|
|
747
|
+
{
|
|
748
|
+
"id": "req-graceful--derives--need",
|
|
749
|
+
"sourceId": "req-graceful",
|
|
750
|
+
"targetId": "need",
|
|
751
|
+
"relationType": "derives"
|
|
752
|
+
},
|
|
753
|
+
{
|
|
754
|
+
"id": "req-rolling--derives--need",
|
|
755
|
+
"sourceId": "req-rolling",
|
|
756
|
+
"targetId": "need",
|
|
757
|
+
"relationType": "derives"
|
|
758
|
+
},
|
|
759
|
+
{
|
|
760
|
+
"id": "req-bluegreen--derives--need",
|
|
761
|
+
"sourceId": "req-bluegreen",
|
|
762
|
+
"targetId": "need",
|
|
763
|
+
"relationType": "derives"
|
|
764
|
+
},
|
|
765
|
+
{
|
|
766
|
+
"id": "req-canary--derives--need",
|
|
767
|
+
"sourceId": "req-canary",
|
|
768
|
+
"targetId": "need",
|
|
769
|
+
"relationType": "derives"
|
|
770
|
+
},
|
|
771
|
+
{
|
|
772
|
+
"id": "req-expand-contract--derives--need",
|
|
773
|
+
"sourceId": "req-expand-contract",
|
|
774
|
+
"targetId": "need",
|
|
775
|
+
"relationType": "derives"
|
|
776
|
+
},
|
|
777
|
+
{
|
|
778
|
+
"id": "req-migration-window--derives--need",
|
|
779
|
+
"sourceId": "req-migration-window",
|
|
780
|
+
"targetId": "need",
|
|
781
|
+
"relationType": "derives"
|
|
782
|
+
},
|
|
783
|
+
{
|
|
784
|
+
"id": "req-no-schema--derives--need",
|
|
785
|
+
"sourceId": "req-no-schema",
|
|
786
|
+
"targetId": "need",
|
|
787
|
+
"relationType": "derives"
|
|
788
|
+
},
|
|
789
|
+
{
|
|
790
|
+
"id": "req-flags--derives--need",
|
|
791
|
+
"sourceId": "req-flags",
|
|
792
|
+
"targetId": "need",
|
|
793
|
+
"relationType": "derives"
|
|
794
|
+
},
|
|
795
|
+
{
|
|
796
|
+
"id": "req-continuous--derives--need",
|
|
797
|
+
"sourceId": "req-continuous",
|
|
798
|
+
"targetId": "need",
|
|
799
|
+
"relationType": "derives"
|
|
800
|
+
},
|
|
801
|
+
{
|
|
802
|
+
"id": "req-train--derives--need",
|
|
803
|
+
"sourceId": "req-train",
|
|
804
|
+
"targetId": "need",
|
|
805
|
+
"relationType": "derives"
|
|
806
|
+
},
|
|
807
|
+
{
|
|
808
|
+
"id": "sc-rollback--verifies--req-rollback",
|
|
809
|
+
"sourceId": "sc-rollback",
|
|
810
|
+
"targetId": "req-rollback",
|
|
811
|
+
"relationType": "verifies"
|
|
812
|
+
},
|
|
813
|
+
{
|
|
814
|
+
"id": "sc-graceful--verifies--req-graceful",
|
|
815
|
+
"sourceId": "sc-graceful",
|
|
816
|
+
"targetId": "req-graceful",
|
|
817
|
+
"relationType": "verifies"
|
|
818
|
+
},
|
|
819
|
+
{
|
|
820
|
+
"id": "sc-rolling--verifies--req-rolling",
|
|
821
|
+
"sourceId": "sc-rolling",
|
|
822
|
+
"targetId": "req-rolling",
|
|
823
|
+
"relationType": "verifies"
|
|
824
|
+
},
|
|
825
|
+
{
|
|
826
|
+
"id": "sc-bluegreen--verifies--req-bluegreen",
|
|
827
|
+
"sourceId": "sc-bluegreen",
|
|
828
|
+
"targetId": "req-bluegreen",
|
|
829
|
+
"relationType": "verifies"
|
|
830
|
+
},
|
|
831
|
+
{
|
|
832
|
+
"id": "sc-canary--verifies--req-canary",
|
|
833
|
+
"sourceId": "sc-canary",
|
|
834
|
+
"targetId": "req-canary",
|
|
835
|
+
"relationType": "verifies"
|
|
836
|
+
},
|
|
837
|
+
{
|
|
838
|
+
"id": "sc-expand-contract--verifies--req-expand-contract",
|
|
839
|
+
"sourceId": "sc-expand-contract",
|
|
840
|
+
"targetId": "req-expand-contract",
|
|
841
|
+
"relationType": "verifies"
|
|
842
|
+
},
|
|
843
|
+
{
|
|
844
|
+
"id": "sc-migration-window--verifies--req-migration-window",
|
|
845
|
+
"sourceId": "sc-migration-window",
|
|
846
|
+
"targetId": "req-migration-window",
|
|
847
|
+
"relationType": "verifies"
|
|
848
|
+
},
|
|
849
|
+
{
|
|
850
|
+
"id": "sc-no-schema--verifies--req-no-schema",
|
|
851
|
+
"sourceId": "sc-no-schema",
|
|
852
|
+
"targetId": "req-no-schema",
|
|
853
|
+
"relationType": "verifies"
|
|
854
|
+
},
|
|
855
|
+
{
|
|
856
|
+
"id": "sc-flags--verifies--req-flags",
|
|
857
|
+
"sourceId": "sc-flags",
|
|
858
|
+
"targetId": "req-flags",
|
|
859
|
+
"relationType": "verifies"
|
|
860
|
+
},
|
|
861
|
+
{
|
|
862
|
+
"id": "sc-continuous--verifies--req-continuous",
|
|
863
|
+
"sourceId": "sc-continuous",
|
|
864
|
+
"targetId": "req-continuous",
|
|
865
|
+
"relationType": "verifies"
|
|
866
|
+
},
|
|
867
|
+
{
|
|
868
|
+
"id": "sc-train--verifies--req-train",
|
|
869
|
+
"sourceId": "sc-train",
|
|
870
|
+
"targetId": "req-train",
|
|
871
|
+
"relationType": "verifies"
|
|
872
|
+
},
|
|
873
|
+
{
|
|
874
|
+
"id": "ff-rollback-drill--implements--adr-rolling",
|
|
875
|
+
"sourceId": "ff-rollback-drill",
|
|
876
|
+
"targetId": "adr-rolling",
|
|
877
|
+
"relationType": "implements"
|
|
878
|
+
},
|
|
879
|
+
{
|
|
880
|
+
"id": "ff-rollback-drill--implements--adr-bluegreen",
|
|
881
|
+
"sourceId": "ff-rollback-drill",
|
|
882
|
+
"targetId": "adr-bluegreen",
|
|
883
|
+
"relationType": "implements"
|
|
884
|
+
},
|
|
885
|
+
{
|
|
886
|
+
"id": "ff-rollback-drill--implements--adr-canary",
|
|
887
|
+
"sourceId": "ff-rollback-drill",
|
|
888
|
+
"targetId": "adr-canary",
|
|
889
|
+
"relationType": "implements"
|
|
890
|
+
},
|
|
891
|
+
{
|
|
892
|
+
"id": "ff-rolling--implements--adr-rolling",
|
|
893
|
+
"sourceId": "ff-rolling",
|
|
894
|
+
"targetId": "adr-rolling",
|
|
895
|
+
"relationType": "implements"
|
|
896
|
+
},
|
|
897
|
+
{
|
|
898
|
+
"id": "ff-bluegreen--implements--adr-bluegreen",
|
|
899
|
+
"sourceId": "ff-bluegreen",
|
|
900
|
+
"targetId": "adr-bluegreen",
|
|
901
|
+
"relationType": "implements"
|
|
902
|
+
},
|
|
903
|
+
{
|
|
904
|
+
"id": "ff-canary--implements--adr-canary",
|
|
905
|
+
"sourceId": "ff-canary",
|
|
906
|
+
"targetId": "adr-canary",
|
|
907
|
+
"relationType": "implements"
|
|
908
|
+
},
|
|
909
|
+
{
|
|
910
|
+
"id": "ff-migration-lint--implements--adr-expand-contract",
|
|
911
|
+
"sourceId": "ff-migration-lint",
|
|
912
|
+
"targetId": "adr-expand-contract",
|
|
913
|
+
"relationType": "implements"
|
|
914
|
+
},
|
|
915
|
+
{
|
|
916
|
+
"id": "ff-migration-rehearsal--implements--adr-migration-window",
|
|
917
|
+
"sourceId": "ff-migration-rehearsal",
|
|
918
|
+
"targetId": "adr-migration-window",
|
|
919
|
+
"relationType": "implements"
|
|
920
|
+
},
|
|
921
|
+
{
|
|
922
|
+
"id": "ff-flag-age--implements--adr-rolling",
|
|
923
|
+
"sourceId": "ff-flag-age",
|
|
924
|
+
"targetId": "adr-rolling",
|
|
925
|
+
"relationType": "implements"
|
|
926
|
+
},
|
|
927
|
+
{
|
|
928
|
+
"id": "ff-flag-age--implements--adr-bluegreen",
|
|
929
|
+
"sourceId": "ff-flag-age",
|
|
930
|
+
"targetId": "adr-bluegreen",
|
|
931
|
+
"relationType": "implements"
|
|
932
|
+
},
|
|
933
|
+
{
|
|
934
|
+
"id": "ff-flag-age--implements--adr-canary",
|
|
935
|
+
"sourceId": "ff-flag-age",
|
|
936
|
+
"targetId": "adr-canary",
|
|
937
|
+
"relationType": "implements"
|
|
938
|
+
},
|
|
939
|
+
{
|
|
940
|
+
"id": "ff-dora-continuous--implements--adr-continuous",
|
|
941
|
+
"sourceId": "ff-dora-continuous",
|
|
942
|
+
"targetId": "adr-continuous",
|
|
943
|
+
"relationType": "implements"
|
|
944
|
+
},
|
|
945
|
+
{
|
|
946
|
+
"id": "ff-dora-train--implements--adr-release-train",
|
|
947
|
+
"sourceId": "ff-dora-train",
|
|
948
|
+
"targetId": "adr-release-train",
|
|
949
|
+
"relationType": "implements"
|
|
950
|
+
}
|
|
951
|
+
]
|
|
952
|
+
}
|