@radicaltools/cli 0.3.0 → 0.3.1
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 +121 -16
- package/dist/hub-catalogue/concern/concern-api-collections.radical +1136 -0
- package/dist/hub-catalogue/concern/concern-api-errors.radical +1180 -0
- package/dist/hub-catalogue/concern/concern-api-evolution.radical +449 -210
- package/dist/hub-catalogue/concern/concern-api-idempotency.radical +1218 -0
- package/dist/hub-catalogue/concern/concern-api-resource-design.radical +1102 -0
- package/dist/hub-catalogue/concern/concern-api-style-guide.radical +1210 -0
- package/dist/hub-catalogue/concern/concern-architecture-style.radical +287 -131
- package/dist/hub-catalogue/concern/concern-audit-trail.radical +1096 -0
- package/dist/hub-catalogue/concern/concern-authentication.radical +247 -37
- package/dist/hub-catalogue/concern/concern-authorization.radical +311 -89
- package/dist/hub-catalogue/concern/concern-availability.radical +287 -63
- package/dist/hub-catalogue/concern/concern-backend-stack.radical +300 -381
- package/dist/hub-catalogue/concern/concern-backup-recovery.radical +385 -129
- package/dist/hub-catalogue/concern/concern-caching.radical +1294 -0
- package/dist/hub-catalogue/concern/concern-capacity.radical +194 -81
- package/dist/hub-catalogue/concern/concern-code-documentation.radical +1397 -0
- package/dist/hub-catalogue/concern/concern-code-quality-gate.radical +1409 -0
- package/dist/hub-catalogue/concern/concern-code-review-branching.radical +1416 -0
- package/dist/hub-catalogue/concern/concern-code-style.radical +1058 -0
- package/dist/hub-catalogue/concern/concern-communication-style.radical +473 -167
- package/dist/hub-catalogue/concern/concern-data-classification.radical +970 -0
- package/dist/hub-catalogue/concern/concern-data-consistency.radical +339 -308
- package/dist/hub-catalogue/concern/concern-data-store.radical +480 -158
- package/dist/hub-catalogue/concern/concern-decomposition.radical +260 -85
- package/dist/hub-catalogue/concern/concern-definition-of-done.radical +1214 -0
- package/dist/hub-catalogue/concern/concern-delivery-metrics.radical +966 -0
- package/dist/hub-catalogue/concern/concern-dependency-hygiene.radical +1345 -0
- package/dist/hub-catalogue/concern/concern-deployment.radical +343 -92
- package/dist/hub-catalogue/concern/concern-encryption.radical +339 -76
- package/dist/hub-catalogue/concern/concern-error-handling-logging.radical +1197 -0
- package/dist/hub-catalogue/concern/concern-eu-dora.radical +1321 -0
- package/dist/hub-catalogue/concern/concern-frontend-stack.radical +467 -160
- package/dist/hub-catalogue/concern/concern-incident-management.radical +1204 -0
- package/dist/hub-catalogue/concern/concern-infrastructure.radical +1300 -268
- package/dist/hub-catalogue/concern/concern-integration-resilience.radical +88 -51
- package/dist/hub-catalogue/concern/concern-messaging.radical +173 -140
- package/dist/hub-catalogue/concern/concern-module-boundaries.radical +162 -159
- package/dist/hub-catalogue/concern/concern-observability.radical +224 -275
- package/dist/hub-catalogue/concern/concern-operational-readiness.radical +1249 -0
- package/dist/hub-catalogue/concern/concern-personal-data.radical +637 -122
- package/dist/hub-catalogue/concern/concern-quality-priorities.radical +1091 -0
- package/dist/hub-catalogue/concern/concern-rate-limiting.radical +433 -141
- package/dist/hub-catalogue/concern/concern-release-versioning.radical +1358 -0
- package/dist/hub-catalogue/concern/concern-retention.radical +1399 -0
- package/dist/hub-catalogue/concern/concern-secrets.radical +332 -74
- package/dist/hub-catalogue/concern/concern-secure-coding.radical +1379 -0
- package/dist/hub-catalogue/concern/concern-secure-development.radical +1245 -0
- package/dist/hub-catalogue/concern/concern-security-detection.radical +1153 -0
- package/dist/hub-catalogue/concern/concern-supply-chain.radical +257 -183
- package/dist/hub-catalogue/concern/concern-technical-debt.radical +1450 -0
- package/dist/hub-catalogue/concern/concern-technology-lifecycle.radical +1145 -0
- package/dist/hub-catalogue/concern/concern-tenant-isolation.radical +271 -137
- package/dist/hub-catalogue/concern/concern-test-strategy.radical +243 -224
- package/dist/hub-catalogue/concern/concern-threat-modelling.radical +1143 -0
- package/dist/index.js +3680 -2074
- package/package.json +1 -1
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"id": "concern-deployment",
|
|
4
4
|
"category": "concern",
|
|
5
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.",
|
|
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 and their removal, the time to roll back, and the release cadence measured with the DORA metrics.",
|
|
7
7
|
"tags": [
|
|
8
8
|
"operations",
|
|
9
9
|
"deployment",
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"id": "deployment",
|
|
20
20
|
"trigger": "LIST NODES WHERE (type = \"container\" OR type = \"webapp\") AND external != true",
|
|
21
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": "
|
|
22
|
+
"group": "sdlc"
|
|
23
23
|
},
|
|
24
24
|
"sources": [
|
|
25
25
|
{
|
|
@@ -49,6 +49,22 @@
|
|
|
49
49
|
{
|
|
50
50
|
"title": "Argo Rollouts documentation",
|
|
51
51
|
"url": "https://argo-rollouts.readthedocs.io/en/stable/"
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
"title": "Kubernetes documentation: Deployments",
|
|
55
|
+
"url": "https://kubernetes.io/docs/concepts/workloads/controllers/deployment/"
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
"title": "Kubernetes documentation: Pod Lifecycle (termination of pods)",
|
|
59
|
+
"url": "https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/"
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
"title": "AWS Well-Architected Framework, Reliability Pillar",
|
|
63
|
+
"url": "https://docs.aws.amazon.com/wellarchitected/latest/reliability-pillar/welcome.html"
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
"title": "flagd: flag definitions",
|
|
67
|
+
"url": "https://flagd.dev/reference/flag-definitions/"
|
|
52
68
|
}
|
|
53
69
|
],
|
|
54
70
|
"templateParams": [
|
|
@@ -72,7 +88,7 @@
|
|
|
72
88
|
{
|
|
73
89
|
"value": "canary",
|
|
74
90
|
"label": "a canary with automatic analysis",
|
|
75
|
-
"description": "The new version gets 5 %, then 25 %, then 50 % of traffic; at each step its
|
|
91
|
+
"description": "The new version gets 5 %, then 25 %, then 50 % of traffic; at each step its success rate and latency are compared with the stable version 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
92
|
}
|
|
77
93
|
]
|
|
78
94
|
},
|
|
@@ -80,7 +96,7 @@
|
|
|
80
96
|
"key": "MIGRATIONS",
|
|
81
97
|
"title": "Schema changes",
|
|
82
98
|
"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.",
|
|
99
|
+
"hint": "During a rollout and after a rollback, the previous version runs against the new schema. A change it cannot read makes rollback impossible. The migration tool itself is decided in the Data store pack.",
|
|
84
100
|
"defaultValue": "expand",
|
|
85
101
|
"options": [
|
|
86
102
|
{
|
|
@@ -90,7 +106,7 @@
|
|
|
90
106
|
},
|
|
91
107
|
{
|
|
92
108
|
"value": "window",
|
|
93
|
-
"label": "
|
|
109
|
+
"label": "a maintenance window",
|
|
94
110
|
"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
111
|
},
|
|
96
112
|
{
|
|
@@ -104,17 +120,17 @@
|
|
|
104
120
|
"key": "FLAGS",
|
|
105
121
|
"title": "Feature flags",
|
|
106
122
|
"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.",
|
|
123
|
+
"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. A flag left behind after its rollout is a debt item, removed by a deadline.",
|
|
108
124
|
"defaultValue": "yes",
|
|
109
125
|
"options": [
|
|
110
126
|
{
|
|
111
127
|
"value": "yes",
|
|
112
|
-
"label": "
|
|
128
|
+
"label": "feature flags",
|
|
113
129
|
"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
130
|
},
|
|
115
131
|
{
|
|
116
132
|
"value": "no",
|
|
117
|
-
"label": "no
|
|
133
|
+
"label": "no flags: a deploy is a release",
|
|
118
134
|
"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
135
|
}
|
|
120
136
|
]
|
|
@@ -123,12 +139,12 @@
|
|
|
123
139
|
"key": "CADENCE",
|
|
124
140
|
"title": "Cadence",
|
|
125
141
|
"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
|
|
142
|
+
"hint": "Smaller, more frequent releases fail less often and are easier to undo (DORA). The cadence sets the targets for the DORA metrics.",
|
|
127
143
|
"defaultValue": "continuous",
|
|
128
144
|
"options": [
|
|
129
145
|
{
|
|
130
146
|
"value": "continuous",
|
|
131
|
-
"label": "
|
|
147
|
+
"label": "continuous deployment of every merge",
|
|
132
148
|
"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
149
|
},
|
|
134
150
|
{
|
|
@@ -143,6 +159,24 @@
|
|
|
143
159
|
"label": "How fast must a bad release be undone (minutes)?",
|
|
144
160
|
"defaultValue": "15",
|
|
145
161
|
"type": "number"
|
|
162
|
+
},
|
|
163
|
+
{
|
|
164
|
+
"key": "CANARY_SUCCESS_PERCENT",
|
|
165
|
+
"label": "Lowest success rate a canary step may show (%); at or above the availability objective decided in the Availability pack",
|
|
166
|
+
"defaultValue": "99",
|
|
167
|
+
"type": "number"
|
|
168
|
+
},
|
|
169
|
+
{
|
|
170
|
+
"key": "WINDOW_MINUTES",
|
|
171
|
+
"label": "How long is a maintenance window for an offline migration (minutes)? Only with migrations in a maintenance window",
|
|
172
|
+
"defaultValue": "120",
|
|
173
|
+
"type": "number"
|
|
174
|
+
},
|
|
175
|
+
{
|
|
176
|
+
"key": "FLAG_AGE_DAYS",
|
|
177
|
+
"label": "Most days a flag may stay after its feature reached all users. Only with feature flags",
|
|
178
|
+
"defaultValue": "90",
|
|
179
|
+
"type": "number"
|
|
146
180
|
}
|
|
147
181
|
]
|
|
148
182
|
},
|
|
@@ -155,7 +189,7 @@
|
|
|
155
189
|
"y": 0,
|
|
156
190
|
"kind": "brief",
|
|
157
191
|
"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
|
|
192
|
+
"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, a feature must be switchable without a deploy where the team decides so, and the team must know how often it ships and how long a change takes to reach users."
|
|
159
193
|
},
|
|
160
194
|
{
|
|
161
195
|
"id": "req-rollback",
|
|
@@ -175,8 +209,8 @@
|
|
|
175
209
|
"x": 260,
|
|
176
210
|
"y": 130,
|
|
177
211
|
"ears_type": "ubiquitous",
|
|
178
|
-
"action": "
|
|
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,
|
|
212
|
+
"action": "leave the load balancer and let its requests in flight finish, for up to 30 seconds, before an instance stops, and receive traffic on a new instance only once its readiness check (decided in the Observability pack) passes, so that a deployment under steady load fails 0 requests",
|
|
213
|
+
"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 Lifecycle: termination of pods)."
|
|
180
214
|
},
|
|
181
215
|
{
|
|
182
216
|
"id": "req-rolling",
|
|
@@ -186,8 +220,8 @@
|
|
|
186
220
|
"y": 260,
|
|
187
221
|
"ears_type": "event-driven",
|
|
188
222
|
"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
|
|
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).",
|
|
223
|
+
"action": "replace instances one at a time, starting each new one before an old one stops, and halt the rollout when new instances fail to become ready for 5 minutes or the error rate rises above its service level",
|
|
224
|
+
"rationale": "A rolling update that removes capacity first, or carries on past failing instances, turns a bad version into an outage (Kubernetes documentation, Deployments: rolling update strategy and progress deadline).",
|
|
191
225
|
"hubWhen": {
|
|
192
226
|
"STRATEGY": [
|
|
193
227
|
"rolling"
|
|
@@ -218,7 +252,7 @@
|
|
|
218
252
|
"y": 520,
|
|
219
253
|
"ears_type": "event-driven",
|
|
220
254
|
"trigger": "a new version rolls out",
|
|
221
|
-
"action": "send it 5 %, 25 % and 50 % of traffic in turn for 10 minutes each,
|
|
255
|
+
"action": "send it 5 %, 25 % and 50 % of traffic in turn for 10 minutes each, measure its success rate and 95th percentile latency at every step, and roll back automatically when the success rate drops below {{CANARY_SUCCESS_PERCENT}} % or the 95th percentile is more than 20 % above the stable version's",
|
|
222
256
|
"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
257
|
"hubWhen": {
|
|
224
258
|
"STRATEGY": [
|
|
@@ -249,8 +283,8 @@
|
|
|
249
283
|
"y": 780,
|
|
250
284
|
"ears_type": "state-driven",
|
|
251
285
|
"precondition": "a schema change cannot run while the element serves",
|
|
252
|
-
"action": "run it only in
|
|
253
|
-
"rationale": "An offline migration that overruns its window, or cannot be undone, is an outage without an end; the rehearsal tells how long
|
|
286
|
+
"action": "run it only in the announced maintenance window of {{WINDOW_MINUTES}} minutes, after a rehearsal on a restored copy of production in which the migration and the way back (the restore) each finished within half the window, and with a backup taken just before it",
|
|
287
|
+
"rationale": "An offline migration that overruns its window, or cannot be undone, is an outage without an end; the rehearsal tells how long each takes (AWS Well-Architected Reliability Pillar, REL 8: implement change).",
|
|
254
288
|
"hubWhen": {
|
|
255
289
|
"MIGRATIONS": [
|
|
256
290
|
"window"
|
|
@@ -264,7 +298,7 @@
|
|
|
264
298
|
"x": 260,
|
|
265
299
|
"y": 910,
|
|
266
300
|
"ears_type": "ubiquitous",
|
|
267
|
-
"action": "keep no database schema of its own, leaving every stored state to services that own their migrations",
|
|
301
|
+
"action": "keep no database schema of its own and depend on no database client or migration tool, leaving every stored state to services that own their migrations",
|
|
268
302
|
"rationale": "An element without a schema can always be rolled back; this keeps it that way until the decision changes.",
|
|
269
303
|
"hubWhen": {
|
|
270
304
|
"MIGRATIONS": [
|
|
@@ -279,7 +313,7 @@
|
|
|
279
313
|
"x": 260,
|
|
280
314
|
"y": 1040,
|
|
281
315
|
"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,
|
|
316
|
+
"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, apply a changed flag within 60 seconds, and remove each flag within {{FLAG_AGE_DAYS}} days of its feature reaching all users",
|
|
283
317
|
"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
318
|
"hubWhen": {
|
|
285
319
|
"FLAGS": [
|
|
@@ -287,14 +321,29 @@
|
|
|
287
321
|
]
|
|
288
322
|
}
|
|
289
323
|
},
|
|
324
|
+
{
|
|
325
|
+
"id": "req-no-flags",
|
|
326
|
+
"type": "requirement",
|
|
327
|
+
"label": "No flags: deploys are releases",
|
|
328
|
+
"x": 260,
|
|
329
|
+
"y": 1170,
|
|
330
|
+
"ears_type": "ubiquitous",
|
|
331
|
+
"action": "make every deployed change live for everyone at once, depend on no feature flag SDK or provider, and keep work too large to finish in one change on its branch until it is",
|
|
332
|
+
"rationale": "Without flags, a flag SDK that arrives unnoticed is a release process nobody decided; this keeps the decision true until it is superseded.",
|
|
333
|
+
"hubWhen": {
|
|
334
|
+
"FLAGS": [
|
|
335
|
+
"no"
|
|
336
|
+
]
|
|
337
|
+
}
|
|
338
|
+
},
|
|
290
339
|
{
|
|
291
340
|
"id": "req-continuous",
|
|
292
341
|
"type": "requirement",
|
|
293
342
|
"label": "Every merge deployed",
|
|
294
343
|
"x": 260,
|
|
295
|
-
"y":
|
|
344
|
+
"y": 1300,
|
|
296
345
|
"ears_type": "ubiquitous",
|
|
297
|
-
"action": "deploy every change merged to the main branch to production through the automated pipeline within 1 day,
|
|
346
|
+
"action": "deploy every change merged to the main branch to production through the automated pipeline within 1 day, and recover from a failed deployment within {{ROLLBACK_MINUTES}} minutes by rolling back",
|
|
298
347
|
"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
348
|
"hubWhen": {
|
|
300
349
|
"CADENCE": [
|
|
@@ -307,10 +356,10 @@
|
|
|
307
356
|
"type": "requirement",
|
|
308
357
|
"label": "Weekly release train",
|
|
309
358
|
"x": 260,
|
|
310
|
-
"y":
|
|
359
|
+
"y": 1430,
|
|
311
360
|
"ears_type": "event-driven",
|
|
312
361
|
"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
|
|
362
|
+
"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 recover from a failed deployment within {{ROLLBACK_MINUTES}} minutes by rolling back",
|
|
314
363
|
"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
364
|
"hubWhen": {
|
|
316
365
|
"CADENCE": [
|
|
@@ -334,7 +383,7 @@
|
|
|
334
383
|
"label": "Release under load",
|
|
335
384
|
"x": 520,
|
|
336
385
|
"y": 130,
|
|
337
|
-
"given": "steady traffic at the usual rate",
|
|
386
|
+
"given": "steady traffic at the usual rate against staging",
|
|
338
387
|
"when": "a new version is deployed",
|
|
339
388
|
"then": "no request fails because of the deployment"
|
|
340
389
|
},
|
|
@@ -374,7 +423,7 @@
|
|
|
374
423
|
"label": "Bad canary rolled back",
|
|
375
424
|
"x": 520,
|
|
376
425
|
"y": 520,
|
|
377
|
-
"given": "a version that fails
|
|
426
|
+
"given": "a version that fails more than 100 minus {{CANARY_SUCCESS_PERCENT}} % of requests",
|
|
378
427
|
"when": "it reaches the 5 % step",
|
|
379
428
|
"then": "the analysis fails and all traffic returns to the stable version within {{ROLLBACK_MINUTES}} minutes",
|
|
380
429
|
"hubWhen": {
|
|
@@ -404,8 +453,8 @@
|
|
|
404
453
|
"label": "Rehearsal decides",
|
|
405
454
|
"x": 520,
|
|
406
455
|
"y": 780,
|
|
407
|
-
"given": "an offline migration planned for
|
|
408
|
-
"when": "its rehearsal on a copy of production takes
|
|
456
|
+
"given": "an offline migration planned for the {{WINDOW_MINUTES}}-minute window",
|
|
457
|
+
"when": "its rehearsal on a copy of production takes longer than half the window",
|
|
409
458
|
"then": "it is not run in that window until it is made faster or the window longer",
|
|
410
459
|
"hubWhen": {
|
|
411
460
|
"MIGRATIONS": [
|
|
@@ -420,7 +469,7 @@
|
|
|
420
469
|
"x": 520,
|
|
421
470
|
"y": 910,
|
|
422
471
|
"given": "the element's repository",
|
|
423
|
-
"when": "
|
|
472
|
+
"when": "its dependencies are searched for database clients and migration tools, and its tree for a migrations directory",
|
|
424
473
|
"then": "there are none",
|
|
425
474
|
"hubWhen": {
|
|
426
475
|
"MIGRATIONS": [
|
|
@@ -443,12 +492,27 @@
|
|
|
443
492
|
]
|
|
444
493
|
}
|
|
445
494
|
},
|
|
495
|
+
{
|
|
496
|
+
"id": "sc-no-flags",
|
|
497
|
+
"type": "scenario",
|
|
498
|
+
"label": "No flag SDK",
|
|
499
|
+
"x": 520,
|
|
500
|
+
"y": 1170,
|
|
501
|
+
"given": "the element's repository",
|
|
502
|
+
"when": "its dependencies are searched for feature flag SDKs and providers",
|
|
503
|
+
"then": "there are none",
|
|
504
|
+
"hubWhen": {
|
|
505
|
+
"FLAGS": [
|
|
506
|
+
"no"
|
|
507
|
+
]
|
|
508
|
+
}
|
|
509
|
+
},
|
|
446
510
|
{
|
|
447
511
|
"id": "sc-continuous",
|
|
448
512
|
"type": "scenario",
|
|
449
513
|
"label": "Merge reaches production",
|
|
450
514
|
"x": 520,
|
|
451
|
-
"y":
|
|
515
|
+
"y": 1300,
|
|
452
516
|
"given": "a change merged to the main branch in the morning",
|
|
453
517
|
"when": "the day ends",
|
|
454
518
|
"then": "it is in production, deployed by the pipeline",
|
|
@@ -463,7 +527,7 @@
|
|
|
463
527
|
"type": "scenario",
|
|
464
528
|
"label": "Train leaves on time",
|
|
465
529
|
"x": 520,
|
|
466
|
-
"y":
|
|
530
|
+
"y": 1430,
|
|
467
531
|
"given": "changes merged before Tuesday's cut-off",
|
|
468
532
|
"when": "the release train runs",
|
|
469
533
|
"then": "they are in production by Thursday",
|
|
@@ -482,8 +546,8 @@
|
|
|
482
546
|
"concern": "deployment",
|
|
483
547
|
"status": "accepted",
|
|
484
548
|
"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,
|
|
549
|
+
"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. The snippets of this pack assume the element is deployed to the shop namespace as order-api; rename them for yours.",
|
|
550
|
+
"decision": "New versions roll out as a rolling update: on Kubernetes a Deployment with maxUnavailable 0 and maxSurge 1, a preStop delay, a progress deadline of 5 minutes and the readiness probes decided in the Observability pack; 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
551
|
"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
552
|
"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
553
|
"hubWhen": {
|
|
@@ -501,7 +565,7 @@
|
|
|
501
565
|
"concern": "deployment",
|
|
502
566
|
"status": "accepted",
|
|
503
567
|
"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.",
|
|
568
|
+
"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. The snippets of this pack assume the element is deployed to the shop namespace as order-api; rename them for yours.",
|
|
505
569
|
"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
570
|
"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
571
|
"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.",
|
|
@@ -520,8 +584,8 @@
|
|
|
520
584
|
"concern": "deployment",
|
|
521
585
|
"status": "accepted",
|
|
522
586
|
"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
|
|
587
|
+
"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. The snippets of this pack assume the element is deployed to the shop namespace as order-api; rename them for yours.",
|
|
588
|
+
"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 from Prometheus (or the metrics backend): the canary's success rate must stay at or above {{CANARY_SUCCESS_PERCENT}} % and its 95th percentile latency within 20 % of the stable version's, or the rollout aborts. 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
589
|
"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
590
|
"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
591
|
"hubWhen": {
|
|
@@ -539,8 +603,8 @@
|
|
|
539
603
|
"concern": "deployment",
|
|
540
604
|
"status": "accepted",
|
|
541
605
|
"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
|
|
606
|
+
"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. The snippets of this pack assume the element is deployed to the shop namespace as order-api; rename them for yours.",
|
|
607
|
+
"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 the migration tool decided in the Data store pack (Flyway, Liquibase, Atlas, or the framework's own), which records what ran. A linter in CI refuses destructive or backward-incompatible changes (Atlas migrate lint, or Squawk for PostgreSQL).",
|
|
544
608
|
"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
609
|
"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
610
|
"hubWhen": {
|
|
@@ -558,8 +622,8 @@
|
|
|
558
622
|
"concern": "deployment",
|
|
559
623
|
"status": "accepted",
|
|
560
624
|
"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
|
|
625
|
+
"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. The snippets of this pack assume the element is deployed to the shop namespace as order-api; rename them for yours.",
|
|
626
|
+
"decision": "Schema changes that cannot run online are made in an announced maintenance window of {{WINDOW_MINUTES}} minutes 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 migration and the way back (restoring that backup) each finished within half the window in the rehearsal. Just before the window a fresh backup is taken. Changes that can run online still ship as expand and contract. Migrations run with the tool decided in the Data store pack (Flyway, Liquibase, Atlas or the framework's own), from the pipeline, never by hand.",
|
|
563
627
|
"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
628
|
"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
629
|
"hubWhen": {
|
|
@@ -568,18 +632,75 @@
|
|
|
568
632
|
]
|
|
569
633
|
}
|
|
570
634
|
},
|
|
635
|
+
{
|
|
636
|
+
"id": "adr-no-schema",
|
|
637
|
+
"type": "adr",
|
|
638
|
+
"label": "No schema of its own",
|
|
639
|
+
"x": 780,
|
|
640
|
+
"y": 650,
|
|
641
|
+
"concern": "deployment",
|
|
642
|
+
"status": "accepted",
|
|
643
|
+
"date": "",
|
|
644
|
+
"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. The snippets of this pack assume the element is deployed to the shop namespace as order-api; rename them for yours. Here the element stores nothing of its own: every state it touches lives in a service that owns its migrations.",
|
|
645
|
+
"decision": "The element keeps no database schema and depends on no database client or migration tool; a dependency rule in CI fails the build when one arrives. State it needs lives in services that own their migrations and are reached through their APIs. Adding a store of its own supersedes this decision and brings the schema change question back.",
|
|
646
|
+
"consequences": "• Rollback never waits on a database: the previous version always runs.\n• A feature that needs state of its own has to supersede this decision first, or put the state in a service that owns it.\n• Nothing to migrate, back up or rehearse for this element.",
|
|
647
|
+
"alternatives": "1. Expand and contract migrations: for when the element gets a store of its own.\n2. A cache or local file as hidden state: works until a second instance or a rollback shows it was a schema after all.",
|
|
648
|
+
"hubWhen": {
|
|
649
|
+
"MIGRATIONS": [
|
|
650
|
+
"none"
|
|
651
|
+
]
|
|
652
|
+
}
|
|
653
|
+
},
|
|
654
|
+
{
|
|
655
|
+
"id": "adr-flags",
|
|
656
|
+
"type": "adr",
|
|
657
|
+
"label": "Features released behind flags",
|
|
658
|
+
"x": 780,
|
|
659
|
+
"y": 780,
|
|
660
|
+
"concern": "deployment",
|
|
661
|
+
"status": "accepted",
|
|
662
|
+
"date": "",
|
|
663
|
+
"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. The snippets of this pack assume the element is deployed to the shop namespace as order-api; rename them for yours.",
|
|
664
|
+
"decision": "Deploying is separate from releasing: unfinished or risky features ship switched off behind a feature flag and are turned on per environment and per share of users without a deploy. Flags are read through the OpenFeature SDK with one provider for the organisation (LaunchDarkly, Unleash, ConfigCat, or flagd with the flag definitions in the repository); choose by whether a hosted provider is allowed to hold the targeting data, and by cost per seat. A changed flag takes effect within 60 seconds on every instance. A flag whose feature has reached all users is a debt item: it is removed, with the code path behind it, within {{FLAG_AGE_DAYS}} days, and a test fails the build on an older one. Turning a flag off is the first rollback for a released feature; the deployment rollback is the second.",
|
|
665
|
+
"consequences": "• Code reaches production continuously; releases are business decisions, made in the flag tool.\n• Every flag doubles the paths to test until it is removed; the {{FLAG_AGE_DAYS}}-day removal is what keeps the count down.\n• The provider is on the request path or in the SDK's cache: its outage must leave the element on the last known flags.\n• Who may flip a flag in production is an access decision, written down next to the flags.",
|
|
666
|
+
"alternatives": "1. No flags, a deploy is a release: simpler, but every merge is visible to everyone at once.\n2. Flags in configuration files or environment variables: no provider, but changing one is a deploy.",
|
|
667
|
+
"hubWhen": {
|
|
668
|
+
"FLAGS": [
|
|
669
|
+
"yes"
|
|
670
|
+
]
|
|
671
|
+
}
|
|
672
|
+
},
|
|
673
|
+
{
|
|
674
|
+
"id": "adr-no-flags",
|
|
675
|
+
"type": "adr",
|
|
676
|
+
"label": "A deploy is a release",
|
|
677
|
+
"x": 780,
|
|
678
|
+
"y": 910,
|
|
679
|
+
"concern": "deployment",
|
|
680
|
+
"status": "accepted",
|
|
681
|
+
"date": "",
|
|
682
|
+
"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. The snippets of this pack assume the element is deployed to the shop namespace as order-api; rename them for yours. Here the team keeps changes small enough to finish in one change and trusts the rollback, so it does without flags.",
|
|
683
|
+
"decision": "There are no feature flags: what is merged and deployed is live for everyone. Unfinished work stays on a branch until it is small enough to ship whole, or ships dark behind a route nobody links to. Rolling back a release is the only way to take a feature back, within {{ROLLBACK_MINUTES}} minutes. This decision is superseded when a feature has to reach some users before others, or be released at a business date apart from its deploy.",
|
|
684
|
+
"consequences": "• No flag provider, no flag clean-up, one path to test.\n• A feature cannot be switched off without rolling back everything deployed with it.\n• Features that take weeks need long-lived branches or dark routes, both of which hide integration problems.",
|
|
685
|
+
"alternatives": "1. Feature flags through OpenFeature with a provider: releases apart from deploys, at the cost of flags and their removal.\n2. Flags in configuration: a half-way that still needs a deploy to flip.",
|
|
686
|
+
"hubWhen": {
|
|
687
|
+
"FLAGS": [
|
|
688
|
+
"no"
|
|
689
|
+
]
|
|
690
|
+
}
|
|
691
|
+
},
|
|
571
692
|
{
|
|
572
693
|
"id": "adr-continuous",
|
|
573
694
|
"type": "adr",
|
|
574
695
|
"label": "Continuous deployment",
|
|
575
696
|
"x": 780,
|
|
576
|
-
"y":
|
|
697
|
+
"y": 1040,
|
|
577
698
|
"concern": "deployment",
|
|
578
699
|
"status": "accepted",
|
|
579
700
|
"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
|
|
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.",
|
|
701
|
+
"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. The snippets of this pack assume the element is deployed to the shop namespace as order-api; rename them for yours.",
|
|
702
|
+
"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 and the rollout strategy above as the safety net. Feature flags: {{FLAGS}}; what is not ready for users either ships switched off behind a flag or stays small enough to finish in one change. The DORA metrics: a weekly job checks deployment frequency (a production deployment on at least 5 days a week) and lead time (every merge in production within 1 day); the change failure rate and the recovery time ({{ROLLBACK_MINUTES}} minutes by rollback) come from the incident tracker and the rollback drill, and all four are reviewed every month (Apache DevLake, Sleuth, LinearB or the CI system's own reports).",
|
|
703
|
+
"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 or to dark routes, not to deploys.",
|
|
583
704
|
"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
705
|
"hubWhen": {
|
|
585
706
|
"CADENCE": [
|
|
@@ -592,12 +713,12 @@
|
|
|
592
713
|
"type": "adr",
|
|
593
714
|
"label": "Weekly release train",
|
|
594
715
|
"x": 780,
|
|
595
|
-
"y":
|
|
716
|
+
"y": 1170,
|
|
596
717
|
"concern": "deployment",
|
|
597
718
|
"status": "accepted",
|
|
598
719
|
"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
|
|
720
|
+
"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. The snippets of this pack assume the element is deployed to the shop namespace as order-api; rename them for yours.",
|
|
721
|
+
"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. Feature flags: {{FLAGS}}. The DORA metrics: a weekly job checks deployment frequency (at least one production release every 7 days) and lead time (every merge in production within 7 days); the change failure rate and the recovery time ({{ROLLBACK_MINUTES}} minutes by rollback) come from the incident tracker and the rollback drill, and all four are reviewed every month (Apache DevLake, Sleuth, LinearB or the CI system's own reports).",
|
|
601
722
|
"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
723
|
"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
724
|
"hubWhen": {
|
|
@@ -612,19 +733,38 @@
|
|
|
612
733
|
"label": "Rollback drilled",
|
|
613
734
|
"x": 1040,
|
|
614
735
|
"y": 0,
|
|
615
|
-
"
|
|
616
|
-
"
|
|
617
|
-
"
|
|
736
|
+
"characteristic": "reliability",
|
|
737
|
+
"scope": "holistic",
|
|
738
|
+
"cadence": "triggered",
|
|
739
|
+
"trigger": "weekly",
|
|
740
|
+
"invocation": "automated",
|
|
741
|
+
"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; on a managed runtime, the platform's rollback command (az webapp deployment slot swap, gcloud run services update-traffic).\n\nThreshold: Rollback of the staging deployment to the previous version completes within {{ROLLBACK_MINUTES}} minutes, every week\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```"
|
|
742
|
+
},
|
|
743
|
+
{
|
|
744
|
+
"id": "ff-graceful",
|
|
745
|
+
"type": "fitness-fn",
|
|
746
|
+
"label": "Deploy under load drops nothing",
|
|
747
|
+
"x": 1040,
|
|
748
|
+
"y": 130,
|
|
749
|
+
"characteristic": "reliability",
|
|
750
|
+
"scope": "holistic",
|
|
751
|
+
"cadence": "triggered",
|
|
752
|
+
"trigger": "deploy",
|
|
753
|
+
"invocation": "automated",
|
|
754
|
+
"description": "The staging pipeline starts a k6 run at a steady rate, deploys the new version while it runs, and lets the run end two minutes after the rollout finished; the threshold fails the run, and the pipeline, on any failed request. It catches instances stopped with requests in flight and traffic routed before readiness.\n\nThreshold: 0 failed requests (connection errors, 502, 503, 504) in a k6 run that spans a staging deployment at a steady rate\n\nTool: Grafana k6, started by the staging deploy job\n\n```js\n// k6 run --env BASE_URL=https://staging.shop.example deploy-under-load.js &\n// then, in the same job: kubectl -n shop-staging set image deployment/order-api order-api=$IMAGE\n// && kubectl -n shop-staging rollout status deployment/order-api --timeout=4m; wait (the k6 exit code fails the job)\nimport http from 'k6/http'\n\nexport const options = {\n scenarios: {\n steady: { executor: 'constant-arrival-rate', rate: 50, timeUnit: '1s', duration: '6m', preAllocatedVUs: 100, maxVUs: 500 },\n },\n thresholds: {\n http_req_failed: ['rate==0'], // one connection reset or 5xx during the rollout fails the run\n },\n}\n\nexport default function () {\n http.get(`${__ENV.BASE_URL}/orders?page=1`)\n}\n```"
|
|
618
755
|
},
|
|
619
756
|
{
|
|
620
757
|
"id": "ff-rolling",
|
|
621
758
|
"type": "fitness-fn",
|
|
622
759
|
"label": "Rolling update keeps capacity",
|
|
623
760
|
"x": 1040,
|
|
624
|
-
"y":
|
|
625
|
-
"
|
|
626
|
-
"
|
|
627
|
-
"
|
|
761
|
+
"y": 260,
|
|
762
|
+
"characteristic": "reliability",
|
|
763
|
+
"scope": "atomic",
|
|
764
|
+
"cadence": "triggered",
|
|
765
|
+
"trigger": "pull-request",
|
|
766
|
+
"invocation": "automated",
|
|
767
|
+
"description": "A policy over the Kubernetes manifests fails the pipeline when a Deployment could remove capacity during a rollout, stop an instance without a preStop delay, or carry on forever past failing instances. Liveness and readiness probes are checked by the Observability pack's policy.\n\nThreshold: 0 Deployments with a Recreate strategy, maxUnavailable above 0, maxSurge of 0, a progress deadline above 300 s, or a container without a preStop hook\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 input.spec.strategy.type == \"Recreate\"\n msg := sprintf(\"%s: strategy Recreate stops every instance first; use RollingUpdate\", [input.metadata.name])\n}\n\ndeny contains msg if {\n input.kind == \"Deployment\"\n unavailable := object.get(input.spec, [\"strategy\", \"rollingUpdate\", \"maxUnavailable\"], \"25%\")\n not unavailable in {0, \"0\", \"0%\"}\n msg := sprintf(\"%s: set strategy.rollingUpdate.maxUnavailable to 0 (is %v)\", [input.metadata.name, unavailable])\n}\n\ndeny contains msg if {\n input.kind == \"Deployment\"\n surge := object.get(input.spec, [\"strategy\", \"rollingUpdate\", \"maxSurge\"], \"25%\")\n surge in {0, \"0\", \"0%\"}\n msg := sprintf(\"%s: set strategy.rollingUpdate.maxSurge to 1 or more\", [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.lifecycle.preStop\n msg := sprintf(\"%s: container %s has no lifecycle.preStop (a sleep that lets the load balancer drain it)\", [input.metadata.name, c.name])\n}\n```",
|
|
628
768
|
"hubWhen": {
|
|
629
769
|
"STRATEGY": [
|
|
630
770
|
"rolling"
|
|
@@ -636,10 +776,13 @@
|
|
|
636
776
|
"type": "fitness-fn",
|
|
637
777
|
"label": "Switch gated by smoke tests",
|
|
638
778
|
"x": 1040,
|
|
639
|
-
"y":
|
|
640
|
-
"
|
|
641
|
-
"
|
|
642
|
-
"
|
|
779
|
+
"y": 390,
|
|
780
|
+
"characteristic": "reliability",
|
|
781
|
+
"scope": "holistic",
|
|
782
|
+
"cadence": "triggered",
|
|
783
|
+
"trigger": "deploy",
|
|
784
|
+
"invocation": "automated",
|
|
785
|
+
"description": "The Rollout runs a k6 smoke-test job against the preview service before promotion; a failed job aborts the release with the live version untouched. The script comes from a ConfigMap mounted into the job. The previous version is scaled down only an hour after the switch.\n\nThreshold: Traffic switches only after the smoke-test job passes against the preview service; the previous version is kept for 3600 s 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: v1\nkind: ConfigMap\nmetadata: { name: smoke-tests, namespace: shop }\ndata:\n smoke.js: |\n import http from 'k6/http'\n import { check } from 'k6'\n export const options = { vus: 1, iterations: 10, thresholds: { checks: ['rate==1'] } }\n export default function () {\n const res = http.get(`${__ENV.BASE_URL}/orders?page=1`)\n check(res, { 'orders answer 200': (r) => r.status === 200 })\n }\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 volumes: [{ name: tests, configMap: { name: smoke-tests } }]\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 volumeMounts: [{ name: tests, mountPath: /tests }]\n```",
|
|
643
786
|
"hubWhen": {
|
|
644
787
|
"STRATEGY": [
|
|
645
788
|
"bluegreen"
|
|
@@ -651,10 +794,13 @@
|
|
|
651
794
|
"type": "fitness-fn",
|
|
652
795
|
"label": "Canary analysis aborts bad versions",
|
|
653
796
|
"x": 1040,
|
|
654
|
-
"y":
|
|
655
|
-
"
|
|
656
|
-
"
|
|
657
|
-
"
|
|
797
|
+
"y": 520,
|
|
798
|
+
"characteristic": "reliability",
|
|
799
|
+
"scope": "holistic",
|
|
800
|
+
"cadence": "triggered",
|
|
801
|
+
"trigger": "deploy",
|
|
802
|
+
"invocation": "automated",
|
|
803
|
+
"description": "The Rollout shifts traffic in steps and runs an analysis from the first step on, measured every minute: the canary's success rate against {{CANARY_SUCCESS_PERCENT}} %, and the ratio of the canary's 95th percentile to the stable version's against 1.2. A second failed measurement of either aborts the rollout and returns all traffic to the stable version. Flagger's Canary resource with metric templates does the same.\n\nThreshold: A canary step fails at a success rate below {{CANARY_SUCCESS_PERCENT}} % or a 95th percentile more than 20 % above the stable version's; a second failed measurement aborts the rollout\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:\n - { name: canary, value: order-api-canary }\n - { name: stable, value: order-api }\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: canary }, { name: stable }]\n metrics:\n - name: success-rate\n interval: 1m\n failureLimit: 1 # a second failed measurement fails the analysis\n successCondition: result[0] * 100 >= {{CANARY_SUCCESS_PERCENT}}\n provider:\n prometheus:\n address: http://prometheus.monitoring:9090\n query: |\n sum(rate(http_server_request_duration_seconds_count{service=\"{{args.canary}}\",http_response_status_code!~\"5..\"}[2m]))\n / sum(rate(http_server_request_duration_seconds_count{service=\"{{args.canary}}\"}[2m]))\n - name: p95-vs-stable\n interval: 1m\n failureLimit: 1\n successCondition: result[0] <= 1.2 # canary p95 at most 20 % above the stable p95\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.canary}}\"}[2m])))\n / histogram_quantile(0.95, sum by (le) (rate(http_server_request_duration_seconds_bucket{service=\"{{args.stable}}\"}[2m])))\n```",
|
|
658
804
|
"hubWhen": {
|
|
659
805
|
"STRATEGY": [
|
|
660
806
|
"canary"
|
|
@@ -666,10 +812,13 @@
|
|
|
666
812
|
"type": "fitness-fn",
|
|
667
813
|
"label": "Migrations stay compatible",
|
|
668
814
|
"x": 1040,
|
|
669
|
-
"y":
|
|
670
|
-
"
|
|
671
|
-
"
|
|
672
|
-
"
|
|
815
|
+
"y": 650,
|
|
816
|
+
"characteristic": "compatibility",
|
|
817
|
+
"scope": "atomic",
|
|
818
|
+
"cadence": "triggered",
|
|
819
|
+
"trigger": "pull-request",
|
|
820
|
+
"invocation": "automated",
|
|
821
|
+
"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\nThreshold: 0 destructive or backward-incompatible statements (drop, rename, type change) in a migration that is not a marked contract step\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
822
|
"hubWhen": {
|
|
674
823
|
"MIGRATIONS": [
|
|
675
824
|
"expand"
|
|
@@ -681,40 +830,103 @@
|
|
|
681
830
|
"type": "fitness-fn",
|
|
682
831
|
"label": "Offline migration rehearsed",
|
|
683
832
|
"x": 1040,
|
|
684
|
-
"y":
|
|
685
|
-
"
|
|
686
|
-
"
|
|
687
|
-
"
|
|
833
|
+
"y": 780,
|
|
834
|
+
"characteristic": "reliability",
|
|
835
|
+
"scope": "atomic",
|
|
836
|
+
"cadence": "triggered",
|
|
837
|
+
"trigger": "deploy",
|
|
838
|
+
"invocation": "automated",
|
|
839
|
+
"description": "A pipeline job restores the latest backup into a rehearsal database, runs the pending migrations against it and times them, then restores the backup again (the way back) and times that; it fails when either took longer than half the window. The production job runs only after an approval in a protected environment, takes a backup first, and only follows a passed rehearsal.\n\nThreshold: In the rehearsal on a restored copy of production, the migration and the restore each finish within half of {{WINDOW_MINUTES}} minutes; the production run needs an approved environment\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 half=$(( {{WINDOW_MINUTES}} * 30 )) # seconds: half of {{WINDOW_MINUTES}} minutes\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 \"Migration took $took s\"\n test \"$took\" -le \"$half\" || { echo \"::error::Migration longer than half the window\"; exit 1; }\n start=$(date +%s)\n pg_restore --clean --no-owner -d \"$REHEARSAL_DB_URL\" backups/latest.dump\n took=$(( $(date +%s) - start ))\n echo \"The way back (restore) took $took s\"\n test \"$took\" -le \"$half\" || { echo \"::error::Restore longer than half the window\"; exit 1; }\n migrate:\n needs: rehearse\n runs-on: ubuntu-latest\n environment: production-maintenance # required reviewers; the window is announced\n steps:\n - run: |\n ./scripts/backup-now.sh\n flyway -url=\"$PROD_JDBC_URL\" -locations=filesystem:migrations migrate\n```",
|
|
688
840
|
"hubWhen": {
|
|
689
841
|
"MIGRATIONS": [
|
|
690
842
|
"window"
|
|
691
843
|
]
|
|
692
844
|
}
|
|
693
845
|
},
|
|
846
|
+
{
|
|
847
|
+
"id": "ff-no-schema",
|
|
848
|
+
"type": "fitness-fn",
|
|
849
|
+
"label": "No database client arrives",
|
|
850
|
+
"x": 1040,
|
|
851
|
+
"y": 910,
|
|
852
|
+
"characteristic": "maintainability",
|
|
853
|
+
"scope": "atomic",
|
|
854
|
+
"cadence": "triggered",
|
|
855
|
+
"trigger": "pull-request",
|
|
856
|
+
"invocation": "automated",
|
|
857
|
+
"description": "A dependency rule fails the build when a database driver, ORM or migration tool is added, which would mean a schema arrived without its decision; a pipeline step fails on a migrations directory. For Python, Go or the JVM, the same rule goes in the dependency allow-list of the build (pip-audit --require-hashes with a constraints file, go.mod review, a Gradle dependency verification).\n\nThreshold: 0 dependencies on a database client or migration tool, and no migrations directory in the repository\n\nTool: dependency-cruiser; for Python: a constraints file reviewed in CI; for Go: go.mod reviewed in CI\n\n```js\n// .dependency-cruiser.cjs\nmodule.exports = {\n forbidden: [{\n name: 'no-schema-of-its-own',\n comment: 'ADR No schema of its own: supersede it before adding a database client or a migration tool',\n severity: 'error',\n from: {},\n to: { path: 'node_modules/(pg|mysql2|mongodb|mongoose|@prisma/client|prisma|knex|typeorm|sequelize|drizzle-orm|node-pg-migrate|umzug)(/|$)' },\n }],\n}\n// CI, after depcruise: test ! -e migrations -a ! -e prisma/migrations -a ! -e db/migrate\n```",
|
|
858
|
+
"hubWhen": {
|
|
859
|
+
"MIGRATIONS": [
|
|
860
|
+
"none"
|
|
861
|
+
]
|
|
862
|
+
}
|
|
863
|
+
},
|
|
694
864
|
{
|
|
695
865
|
"id": "ff-flag-age",
|
|
696
866
|
"type": "fitness-fn",
|
|
697
867
|
"label": "Stale flags removed",
|
|
698
868
|
"x": 1040,
|
|
699
|
-
"y":
|
|
700
|
-
"
|
|
701
|
-
"
|
|
702
|
-
"
|
|
869
|
+
"y": 1040,
|
|
870
|
+
"characteristic": "maintainability",
|
|
871
|
+
"scope": "atomic",
|
|
872
|
+
"cadence": "triggered",
|
|
873
|
+
"trigger": "pull-request",
|
|
874
|
+
"invocation": "automated",
|
|
875
|
+
"description": "A test reads the flagd flag definitions kept in the repository, treats a flag as fully released when it is enabled with defaultVariant on and no targeting, takes the date its defaultVariant line last changed from git blame, and fails for every flag released longer than {{FLAG_AGE_DAYS}} days ago, so that it is removed with the code path behind it. The checkout needs the history (fetch-depth: 0). With a hosted provider, read the flags and their last change from its API instead.\n\nThreshold: 0 flags on for everyone for more than {{FLAG_AGE_DAYS}} days\n\nTool: Vitest over flagd (OpenFeature) flag definitions, with git blame\n\n```ts\nimport { execFileSync } from 'node:child_process'\nimport { readFileSync } from 'node:fs'\n\nconst FILE = 'flags/flags.flagd.json'\nconst text = readFileSync(FILE, 'utf8')\nconst lines = text.split('\\n')\nconst { flags } = JSON.parse(text) as {\n flags: Record<string, { state: 'ENABLED' | 'DISABLED'; defaultVariant?: string; targeting?: unknown }>\n}\nconst MAX_DAYS = {{FLAG_AGE_DAYS}}\n\n/** When the given line of the file last changed, from git blame. */\nconst changedAt = (line: number): number => {\n const blame = execFileSync('git', ['blame', '--porcelain', `-L${line},${line}`, '--', FILE], { encoding: 'utf8' })\n return Number(/^committer-time (\\d+)$/m.exec(blame)![1]) * 1000\n}\n\nit.each(Object.entries(flags))('flag %s is removed in time after its full release', (key, flag) => {\n const released = flag.state === 'ENABLED' && flag.defaultVariant === 'on' && !flag.targeting\n if (!released) return\n const start = lines.findIndex((l) => l.includes(`\"${key}\"`))\n const line = lines.findIndex((l, i) => i > start && l.includes('\"defaultVariant\"')) + 1\n const days = (Date.now() - changedAt(line)) / 86_400_000\n expect(days, `remove flag ${key}: on for everyone for ${Math.floor(days)} days`).toBeLessThanOrEqual(MAX_DAYS)\n})\n```",
|
|
703
876
|
"hubWhen": {
|
|
704
877
|
"FLAGS": [
|
|
705
878
|
"yes"
|
|
706
879
|
]
|
|
707
880
|
}
|
|
708
881
|
},
|
|
882
|
+
{
|
|
883
|
+
"id": "ff-flag-propagation",
|
|
884
|
+
"type": "fitness-fn",
|
|
885
|
+
"label": "Flag changes take effect in time",
|
|
886
|
+
"x": 1040,
|
|
887
|
+
"y": 1170,
|
|
888
|
+
"characteristic": "flexibility",
|
|
889
|
+
"scope": "holistic",
|
|
890
|
+
"cadence": "triggered",
|
|
891
|
+
"trigger": "deploy",
|
|
892
|
+
"invocation": "automated",
|
|
893
|
+
"description": "An integration test against the staging element turns a flag on and then off at its source (the flag definitions file flagd watches, or the provider's API with a hosted provider) and polls the element until its answer changes, failing past 60 seconds.\n\nThreshold: A flag turned off reaches the element within 60 seconds, with no deployment\n\nTool: Vitest against staging, writing the flagd flag definitions (or the provider's API)\n\n```ts\nimport { readFileSync, writeFileSync } from 'node:fs'\n\nconst FLAGS = process.env.FLAGS_FILE ?? 'flags/flags.flagd.json' // the file flagd syncs from\nconst BASE_URL = process.env.BASE_URL!\nconst FLAG = 'new-checkout'\n\nconst setDefault = (variant: 'on' | 'off'): void => {\n const doc = JSON.parse(readFileSync(FLAGS, 'utf8'))\n doc.flags[FLAG].defaultVariant = variant\n writeFileSync(FLAGS, JSON.stringify(doc, null, 2))\n}\nconst until = async (ok: () => Promise<boolean>, ms: number): Promise<void> => {\n const end = Date.now() + ms\n while (!(await ok())) {\n if (Date.now() > end) throw new Error(`not applied within ${ms} ms`)\n await new Promise((r) => setTimeout(r, 1000))\n }\n}\nconst seen = async (): Promise<string | null> => (await fetch(`${BASE_URL}/checkout`)).headers.get('x-feature-new-checkout')\n\nit('a flag turned off reaches the element within 60 seconds', async () => {\n setDefault('on')\n await until(async () => (await seen()) === 'on', 60_000)\n const started = Date.now()\n setDefault('off')\n await until(async () => (await seen()) === 'off', 60_000)\n expect(Date.now() - started).toBeLessThanOrEqual(60_000)\n})\n```",
|
|
894
|
+
"hubWhen": {
|
|
895
|
+
"FLAGS": [
|
|
896
|
+
"yes"
|
|
897
|
+
]
|
|
898
|
+
}
|
|
899
|
+
},
|
|
900
|
+
{
|
|
901
|
+
"id": "ff-no-flags",
|
|
902
|
+
"type": "fitness-fn",
|
|
903
|
+
"label": "No flag SDK arrives",
|
|
904
|
+
"x": 1040,
|
|
905
|
+
"y": 1300,
|
|
906
|
+
"characteristic": "maintainability",
|
|
907
|
+
"scope": "atomic",
|
|
908
|
+
"cadence": "triggered",
|
|
909
|
+
"trigger": "pull-request",
|
|
910
|
+
"invocation": "automated",
|
|
911
|
+
"description": "A dependency rule fails the build when a feature flag SDK or a provider's client is added, which would mean releases became separate from deploys without the decision being superseded. For Python, Go or the JVM, the same rule goes in the dependency review of the build.\n\nThreshold: 0 dependencies on a feature flag SDK or provider client\n\nTool: dependency-cruiser; for Python: a constraints file reviewed in CI; for Go: go.mod reviewed in CI\n\n```js\n// .dependency-cruiser.cjs\nmodule.exports = {\n forbidden: [{\n name: 'no-feature-flags',\n comment: 'ADR A deploy is a release: supersede it before adding feature flags',\n severity: 'error',\n from: {},\n to: { path: 'node_modules/(@openfeature/|launchdarkly-node-server-sdk|@launchdarkly/|unleash-client|configcat-node|flagsmith-nodejs|@growthbook/)' },\n }],\n}\n```",
|
|
912
|
+
"hubWhen": {
|
|
913
|
+
"FLAGS": [
|
|
914
|
+
"no"
|
|
915
|
+
]
|
|
916
|
+
}
|
|
917
|
+
},
|
|
709
918
|
{
|
|
710
919
|
"id": "ff-dora-continuous",
|
|
711
920
|
"type": "fitness-fn",
|
|
712
|
-
"label": "Deploys daily",
|
|
921
|
+
"label": "Deploys daily, merges live within a day",
|
|
713
922
|
"x": 1040,
|
|
714
|
-
"y":
|
|
715
|
-
"
|
|
716
|
-
"
|
|
717
|
-
"
|
|
923
|
+
"y": 1430,
|
|
924
|
+
"characteristic": "maintainability",
|
|
925
|
+
"scope": "atomic",
|
|
926
|
+
"cadence": "triggered",
|
|
927
|
+
"trigger": "weekly",
|
|
928
|
+
"invocation": "automated",
|
|
929
|
+
"description": "A weekly job reads the repository's production deployments and merged pull requests of the last 7 days: it fails below 5 deployment days, and when any merge waited more than 24 hours for the first production deployment after it. Change failure rate and recovery come from the incident tracker and the rollback drill, reviewed monthly.\n\nThreshold: Production deployments on at least 5 days of every week; the longest lead time from merge to production in the last 7 days at most 24 hours\n\nTool: GitHub CLI and jq in a scheduled GitHub Actions job\n\n```yaml\nname: dora-weekly\non:\n schedule: [{ cron: '0 7 * * 1' }]\njobs:\n frequency-and-lead-time:\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 gh api \"repos/${{ github.repository }}/deployments?environment=production&per_page=100\" \\\n --jq \"[.[] | select(.created_at > \\\"$since\\\") | .created_at]\" > deploys.json\n days=$(jq 'map(.[0:10]) | unique | length' deploys.json)\n echo \"Days with a production deployment in the last 7: $days\"\n test \"$days\" -ge 5\n # lead time: from each merge of the last 7 days to the first production deployment after it\n gh pr list --state merged --search \"merged:>=$(date -u -d '-7 days' +%F)\" --limit 200 --json mergedAt \\\n | jq -e --slurpfile deploys deploys.json '\n [.[] | .mergedAt as $m | ($deploys[0] | map(select(. >= $m)) | min) as $d\n | select($d != null) | (($d | fromdateiso8601) - ($m | fromdateiso8601)) / 3600]\n | (max // 0) as $worst | \"Longest lead time: \\($worst | floor) h\" | stderr | $worst <= 24'\n```",
|
|
718
930
|
"hubWhen": {
|
|
719
931
|
"CADENCE": [
|
|
720
932
|
"continuous"
|
|
@@ -724,12 +936,15 @@
|
|
|
724
936
|
{
|
|
725
937
|
"id": "ff-dora-train",
|
|
726
938
|
"type": "fitness-fn",
|
|
727
|
-
"label": "Train leaves weekly",
|
|
939
|
+
"label": "Train leaves weekly, merges live within a week",
|
|
728
940
|
"x": 1040,
|
|
729
|
-
"y":
|
|
730
|
-
"
|
|
731
|
-
"
|
|
732
|
-
"
|
|
941
|
+
"y": 1560,
|
|
942
|
+
"characteristic": "maintainability",
|
|
943
|
+
"scope": "atomic",
|
|
944
|
+
"cadence": "triggered",
|
|
945
|
+
"trigger": "weekly",
|
|
946
|
+
"invocation": "automated",
|
|
947
|
+
"description": "A weekly job reads the repository's production deployments and merged pull requests: it fails when no production deployment happened in the last 7 days, and when any merge of the last 14 days waited more than 7 days for the first production deployment after it. Change failure rate and recovery come from the incident tracker and the rollback drill, reviewed monthly.\n\nThreshold: At least 1 production deployment in every 7 days; the longest lead time from merge to production in the last 14 days at most 7 days\n\nTool: GitHub CLI and jq in a scheduled GitHub Actions job\n\n```yaml\nname: dora-weekly\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 '-14 days' +%FT%TZ)\n gh api \"repos/${{ github.repository }}/deployments?environment=production&per_page=100\" \\\n --jq \"[.[] | select(.created_at > \\\"$since\\\") | .created_at]\" > deploys.json\n week=$(date -u -d '-7 days' +%FT%TZ)\n n=$(jq --arg week \"$week\" 'map(select(. > $week)) | length' deploys.json)\n echo \"Production deployments in the last 7 days: $n\"\n test \"$n\" -ge 1\n gh pr list --state merged --search \"merged:>=$(date -u -d '-14 days' +%F)\" --limit 300 --json mergedAt \\\n | jq -e --slurpfile deploys deploys.json '\n [.[] | .mergedAt as $m | ($deploys[0] | map(select(. >= $m)) | min) as $d\n | select($d != null) | (($d | fromdateiso8601) - ($m | fromdateiso8601)) / 86400]\n | (max // 0) as $worst | \"Longest lead time: \\($worst | floor) days\" | stderr | $worst <= 7'\n```",
|
|
733
948
|
"hubWhen": {
|
|
734
949
|
"CADENCE": [
|
|
735
950
|
"train"
|
|
@@ -792,6 +1007,12 @@
|
|
|
792
1007
|
"targetId": "need",
|
|
793
1008
|
"relationType": "derives"
|
|
794
1009
|
},
|
|
1010
|
+
{
|
|
1011
|
+
"id": "req-no-flags--derives--need",
|
|
1012
|
+
"sourceId": "req-no-flags",
|
|
1013
|
+
"targetId": "need",
|
|
1014
|
+
"relationType": "derives"
|
|
1015
|
+
},
|
|
795
1016
|
{
|
|
796
1017
|
"id": "req-continuous--derives--need",
|
|
797
1018
|
"sourceId": "req-continuous",
|
|
@@ -858,6 +1079,12 @@
|
|
|
858
1079
|
"targetId": "req-flags",
|
|
859
1080
|
"relationType": "verifies"
|
|
860
1081
|
},
|
|
1082
|
+
{
|
|
1083
|
+
"id": "sc-no-flags--verifies--req-no-flags",
|
|
1084
|
+
"sourceId": "sc-no-flags",
|
|
1085
|
+
"targetId": "req-no-flags",
|
|
1086
|
+
"relationType": "verifies"
|
|
1087
|
+
},
|
|
861
1088
|
{
|
|
862
1089
|
"id": "sc-continuous--verifies--req-continuous",
|
|
863
1090
|
"sourceId": "sc-continuous",
|
|
@@ -888,6 +1115,24 @@
|
|
|
888
1115
|
"targetId": "adr-canary",
|
|
889
1116
|
"relationType": "implements"
|
|
890
1117
|
},
|
|
1118
|
+
{
|
|
1119
|
+
"id": "ff-graceful--implements--adr-rolling",
|
|
1120
|
+
"sourceId": "ff-graceful",
|
|
1121
|
+
"targetId": "adr-rolling",
|
|
1122
|
+
"relationType": "implements"
|
|
1123
|
+
},
|
|
1124
|
+
{
|
|
1125
|
+
"id": "ff-graceful--implements--adr-bluegreen",
|
|
1126
|
+
"sourceId": "ff-graceful",
|
|
1127
|
+
"targetId": "adr-bluegreen",
|
|
1128
|
+
"relationType": "implements"
|
|
1129
|
+
},
|
|
1130
|
+
{
|
|
1131
|
+
"id": "ff-graceful--implements--adr-canary",
|
|
1132
|
+
"sourceId": "ff-graceful",
|
|
1133
|
+
"targetId": "adr-canary",
|
|
1134
|
+
"relationType": "implements"
|
|
1135
|
+
},
|
|
891
1136
|
{
|
|
892
1137
|
"id": "ff-rolling--implements--adr-rolling",
|
|
893
1138
|
"sourceId": "ff-rolling",
|
|
@@ -919,21 +1164,27 @@
|
|
|
919
1164
|
"relationType": "implements"
|
|
920
1165
|
},
|
|
921
1166
|
{
|
|
922
|
-
"id": "ff-
|
|
923
|
-
"sourceId": "ff-
|
|
924
|
-
"targetId": "adr-
|
|
1167
|
+
"id": "ff-no-schema--implements--adr-no-schema",
|
|
1168
|
+
"sourceId": "ff-no-schema",
|
|
1169
|
+
"targetId": "adr-no-schema",
|
|
925
1170
|
"relationType": "implements"
|
|
926
1171
|
},
|
|
927
1172
|
{
|
|
928
|
-
"id": "ff-flag-age--implements--adr-
|
|
1173
|
+
"id": "ff-flag-age--implements--adr-flags",
|
|
929
1174
|
"sourceId": "ff-flag-age",
|
|
930
|
-
"targetId": "adr-
|
|
1175
|
+
"targetId": "adr-flags",
|
|
931
1176
|
"relationType": "implements"
|
|
932
1177
|
},
|
|
933
1178
|
{
|
|
934
|
-
"id": "ff-flag-
|
|
935
|
-
"sourceId": "ff-flag-
|
|
936
|
-
"targetId": "adr-
|
|
1179
|
+
"id": "ff-flag-propagation--implements--adr-flags",
|
|
1180
|
+
"sourceId": "ff-flag-propagation",
|
|
1181
|
+
"targetId": "adr-flags",
|
|
1182
|
+
"relationType": "implements"
|
|
1183
|
+
},
|
|
1184
|
+
{
|
|
1185
|
+
"id": "ff-no-flags--implements--adr-no-flags",
|
|
1186
|
+
"sourceId": "ff-no-flags",
|
|
1187
|
+
"targetId": "adr-no-flags",
|
|
937
1188
|
"relationType": "implements"
|
|
938
1189
|
},
|
|
939
1190
|
{
|