@intentius/terragucci 0.2.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.
@@ -0,0 +1,429 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://intentius.io/terragucci/schemas/report/v1/report.schema.json",
4
+ "title": "terragucci.report/v1",
5
+ "description": "One terragucci run's plan report. A minor version only adds fields.",
6
+ "type": "object",
7
+ "required": ["schema", "minor", "run", "change_set", "unit", "units", "totals", "groups", "roots", "waves", "named", "holes", "redaction"],
8
+ "properties": {
9
+ "schema": { "const": "terragucci.report/v1" },
10
+ "minor": { "type": "integer", "minimum": 0 },
11
+ "run": {
12
+ "type": "object",
13
+ "required": ["project", "commit", "stage", "binary", "runtime", "started", "finished"],
14
+ "properties": {
15
+ "project": { "type": "string" },
16
+ "commit": { "type": "string" },
17
+ "base": { "type": "string" },
18
+ "stage": { "enum": ["tf-plan", "tf-apply", "tf-drift"] },
19
+ "wave": { "type": "integer" },
20
+ "binary": { "type": "string" },
21
+ "runtime": { "type": "string" },
22
+ "started": { "type": "string" },
23
+ "finished": { "type": "string" },
24
+ "job_url": { "type": "string" },
25
+ "terragucci": { "type": "string" },
26
+ "commit_url": { "type": "string", "description": "The commit's page on the forge (minor 4)." },
27
+ "pull_request": { "type": "string", "description": "The pull or merge request the run planned, by number (minor 4)." },
28
+ "pull_request_url": { "type": "string", "description": "The pull or merge request's page (minor 4)." },
29
+ "report_url": { "type": "string", "description": "Where this report.html is served, when reports.url names the bucket's address (minor 4)." },
30
+ "trace_id": { "type": "string", "description": "The run's trace id, when the stage sent a trace (minor 4)." },
31
+ "trace_url": { "type": "string", "description": "The trace in a viewer, from telemetry.trace_url (minor 4)." }
32
+ }
33
+ },
34
+ "change_set": { "type": "string" },
35
+ "unit": { "enum": ["member", "instance"] },
36
+ "units": { "type": "integer" },
37
+ "totals": { "type": "object", "additionalProperties": { "type": "integer" } },
38
+ "groups": {
39
+ "type": "array",
40
+ "items": {
41
+ "type": "object",
42
+ "required": ["id", "units", "outlier", "noChanges", "changes", "destroys", "varies", "fold", "why"],
43
+ "properties": {
44
+ "id": { "type": "string" },
45
+ "resource": { "type": "string" },
46
+ "units": { "type": "array", "items": { "type": "string" } },
47
+ "outlier": { "type": "boolean" },
48
+ "noChanges": { "type": "boolean" },
49
+ "changes": { "type": "array", "items": { "$ref": "#/$defs/summaryChange" } },
50
+ "extends": { "type": "string" },
51
+ "plus": { "type": "array", "items": { "$ref": "#/$defs/summaryChange" } },
52
+ "destroys": { "type": "integer" },
53
+ "varies": {
54
+ "type": "array",
55
+ "items": {
56
+ "type": "object",
57
+ "required": ["address", "paths"],
58
+ "properties": { "address": { "type": "string" }, "paths": { "type": "array", "items": { "type": "string" } } }
59
+ }
60
+ },
61
+ "fold": { "$ref": "#/$defs/fold" },
62
+ "why": { "type": "array", "items": { "type": "string" } }
63
+ }
64
+ }
65
+ },
66
+ "roots": {
67
+ "type": "array",
68
+ "items": {
69
+ "type": "object",
70
+ "required": ["path", "status", "plan_digest", "counts", "plan", "changes", "highlights", "fold", "why"],
71
+ "properties": {
72
+ "path": { "type": "string" },
73
+ "terragrunt": {
74
+ "description": "Set when the root is a Terragrunt unit (minor 1).",
75
+ "type": "object",
76
+ "required": ["stack", "selection", "provisional", "run_result"],
77
+ "properties": {
78
+ "stack": { "type": "string" },
79
+ "selection": { "type": "string" },
80
+ "provisional": { "type": "boolean" },
81
+ "run_result": { "type": "string" }
82
+ }
83
+ },
84
+ "status": { "enum": ["planned", "failed"] },
85
+ "error": { "type": "string" },
86
+ "plan_digest": { "type": ["string", "null"] },
87
+ "counts": { "type": "object", "additionalProperties": { "type": "integer" } },
88
+ "group": { "type": "string" },
89
+ "plan": {
90
+ "type": "object",
91
+ "properties": { "text": { "type": "string" }, "json": { "type": "string" } }
92
+ },
93
+ "job_url": { "type": "string" },
94
+ "changes": {
95
+ "type": "array",
96
+ "items": {
97
+ "type": "object",
98
+ "required": ["address", "type", "action", "attributes", "fold"],
99
+ "properties": {
100
+ "address": { "type": "string" },
101
+ "type": { "type": "string" },
102
+ "action": { "$ref": "#/$defs/action" },
103
+ "disruption": { "type": "string" },
104
+ "deposed": { "type": "string" },
105
+ "module": { "type": "string" },
106
+ "index": { "type": ["string", "integer"] },
107
+ "attributes": {
108
+ "type": "array",
109
+ "items": {
110
+ "type": "object",
111
+ "required": ["path"],
112
+ "properties": {
113
+ "path": { "type": "string" },
114
+ "before": {},
115
+ "after": {},
116
+ "unknown": { "const": true },
117
+ "sensitive": { "const": true },
118
+ "forcesReplacement": { "const": true }
119
+ }
120
+ }
121
+ },
122
+ "replace_paths": { "type": "array", "items": { "type": "array", "items": { "type": ["string", "integer"] } } },
123
+ "importing": { "type": "string" },
124
+ "write_only": { "type": "array", "items": { "type": "string" } },
125
+ "kind": { "enum": ["tags", "description", "unknown"] },
126
+ "fold": { "$ref": "#/$defs/fold" },
127
+ "why": { "type": "string" }
128
+ }
129
+ }
130
+ },
131
+ "highlights": {
132
+ "type": "array",
133
+ "items": {
134
+ "type": "object",
135
+ "required": ["address", "type", "action", "why"],
136
+ "properties": {
137
+ "address": { "type": "string" },
138
+ "type": { "type": "string" },
139
+ "action": { "$ref": "#/$defs/action" },
140
+ "why": { "type": "string" }
141
+ }
142
+ }
143
+ },
144
+ "fold": { "$ref": "#/$defs/fold" },
145
+ "why": { "type": "array", "items": { "type": "string" } },
146
+ "timings": { "$ref": "#/$defs/rootTimings" },
147
+ "policy": {
148
+ "description": "What the policy found in the root's plan (minor 6). A denied root is failed and keeps its changes.",
149
+ "type": "object",
150
+ "required": ["result", "denials", "warnings"],
151
+ "properties": {
152
+ "result": { "enum": ["passed", "denied", "error"] },
153
+ "denials": { "type": "array", "items": { "type": "string" } },
154
+ "warnings": { "type": "array", "items": { "type": "string" } },
155
+ "error": { "type": "string" }
156
+ }
157
+ }
158
+ }
159
+ }
160
+ },
161
+ "waves": {
162
+ "type": "array",
163
+ "items": {
164
+ "type": "object",
165
+ "required": ["number", "roots", "set_digest", "approval"],
166
+ "properties": {
167
+ "number": { "type": "integer" },
168
+ "roots": { "type": "array", "items": { "type": "string" } },
169
+ "set_digest": { "type": ["string", "null"] },
170
+ "approval": { "enum": ["not-requested", "waiting", "approved", "not-required"] },
171
+ "gate": {
172
+ "type": "object",
173
+ "required": ["branch", "path"],
174
+ "properties": { "branch": { "type": "string" }, "path": { "type": "string" } }
175
+ }
176
+ }
177
+ }
178
+ },
179
+ "named": {
180
+ "type": "array",
181
+ "items": {
182
+ "type": "object",
183
+ "required": ["root", "action"],
184
+ "properties": {
185
+ "root": { "type": "string" },
186
+ "address": { "type": "string" },
187
+ "type": { "type": "string" },
188
+ "action": { "enum": ["delete", "replace", "refused", "forget", "import"] },
189
+ "deposed": { "type": "string" },
190
+ "replace_paths": { "type": "array", "items": { "type": "array", "items": { "type": ["string", "integer"] } } },
191
+ "reason": { "type": "string" }
192
+ }
193
+ }
194
+ },
195
+ "holes": {
196
+ "type": "array",
197
+ "items": {
198
+ "type": "object",
199
+ "required": ["root", "address", "reason"],
200
+ "properties": {
201
+ "root": { "type": "string" },
202
+ "address": { "type": "string" },
203
+ "type": { "type": "string" },
204
+ "reason": { "type": "string" }
205
+ }
206
+ }
207
+ },
208
+ "policy": {
209
+ "description": "The run's policy check, when policy is on (minor 6).",
210
+ "type": "object",
211
+ "required": ["engine", "input", "from", "denied", "warnings"],
212
+ "properties": {
213
+ "engine": { "enum": ["conftest", "opa"] },
214
+ "input": { "enum": ["plan", "hcp"] },
215
+ "namespace": { "type": "string" },
216
+ "from": { "enum": ["checkout", "base"] },
217
+ "denied": { "type": "array", "items": { "type": "string" } },
218
+ "warnings": { "type": "integer" }
219
+ }
220
+ },
221
+ "intent": {
222
+ "description": "The description check's decision (minor 5). Written by respond description; absent when it did not run.",
223
+ "type": "object",
224
+ "required": ["status", "flagged", "decision", "state_digest", "unmentioned"],
225
+ "properties": {
226
+ "status": { "type": "string" },
227
+ "flagged": { "type": "boolean" },
228
+ "decision": { "type": "string" },
229
+ "probability": { "type": "number" },
230
+ "threshold": { "type": "number" },
231
+ "model": { "type": "string" },
232
+ "state_digest": { "type": "string" },
233
+ "unmentioned": { "type": "array", "items": { "type": "string" } }
234
+ }
235
+ },
236
+ "mock_reads": {
237
+ "description": "Terragrunt dependencies that would have planned on mock_outputs (minor 1).",
238
+ "type": "array",
239
+ "items": {
240
+ "type": "object",
241
+ "required": ["unit", "dependency", "upstream", "reason"],
242
+ "properties": {
243
+ "unit": { "type": "string" },
244
+ "dependency": { "type": "string" },
245
+ "upstream": { "type": "string" },
246
+ "reason": { "enum": ["no-outputs", "partial", "skip-outputs", "disabled"] },
247
+ "keys": { "type": "array", "items": { "type": "string" } }
248
+ }
249
+ }
250
+ },
251
+ "deferred": {
252
+ "description": "Terragrunt units that plan after the units they wait for apply (minor 1).",
253
+ "type": "array",
254
+ "items": {
255
+ "type": "object",
256
+ "required": ["unit", "after", "why", "previewed"],
257
+ "properties": {
258
+ "unit": { "type": "string" },
259
+ "after": { "type": "array", "items": { "type": "string" } },
260
+ "why": { "type": "string" },
261
+ "previewed": { "type": "boolean" }
262
+ }
263
+ }
264
+ },
265
+ "redaction": {
266
+ "type": "object",
267
+ "required": ["marker", "values"],
268
+ "properties": {
269
+ "marker": { "const": "(sensitive, redacted by terragucci)" },
270
+ "values": { "type": "integer" }
271
+ }
272
+ },
273
+ "tips": {
274
+ "type": "array",
275
+ "items": {
276
+ "type": "object",
277
+ "required": ["rule", "message", "url"],
278
+ "properties": {
279
+ "rule": { "type": "string" },
280
+ "root": { "type": "string" },
281
+ "message": { "type": "string" },
282
+ "url": { "type": "string" }
283
+ }
284
+ }
285
+ },
286
+ "timings": {
287
+ "description": "Where the run spent its time, from the binary's spans (minor 2).",
288
+ "type": "object",
289
+ "required": ["roots", "resources"],
290
+ "properties": {
291
+ "roots": {
292
+ "type": "array",
293
+ "items": {
294
+ "type": "object",
295
+ "required": ["root", "seconds", "detail"],
296
+ "properties": {
297
+ "root": { "type": "string" },
298
+ "seconds": { "type": "number" },
299
+ "plan_seconds": { "type": "number" },
300
+ "apply_seconds": { "type": "number" },
301
+ "source": { "$ref": "#/$defs/timingSource" },
302
+ "detail": { "$ref": "#/$defs/timingDetail" }
303
+ }
304
+ }
305
+ },
306
+ "resources": {
307
+ "type": "array",
308
+ "items": {
309
+ "type": "object",
310
+ "required": ["root", "address", "ms"],
311
+ "properties": {
312
+ "root": { "type": "string" },
313
+ "address": { "type": "string" },
314
+ "type": { "type": "string" },
315
+ "ms": { "type": "number" }
316
+ }
317
+ }
318
+ },
319
+ "note": { "type": "string" }
320
+ }
321
+ }
322
+ },
323
+ "$defs": {
324
+ "timingDetail": { "enum": ["resources", "aggregate", "none"] },
325
+ "timingSource": { "description": "binary: terragucci timed each run of the binary; terragrunt: from Terragrunt's run report (minor 3).", "enum": ["binary", "terragrunt"] },
326
+ "rootTimings": {
327
+ "description": "Where a root's plan spent its time, from the binary's spans (minor 2).",
328
+ "type": "object",
329
+ "required": ["seconds", "spans", "detail", "resources", "provider_calls", "provider_init", "lock_waits", "aggregates"],
330
+ "properties": {
331
+ "seconds": { "type": "number" },
332
+ "plan_seconds": { "type": "number" },
333
+ "apply_seconds": { "description": "On a tf-apply wave, the binary's apply run alone (minor 3).", "type": "number" },
334
+ "source": { "$ref": "#/$defs/timingSource" },
335
+ "spans": { "type": "integer" },
336
+ "detail": { "$ref": "#/$defs/timingDetail" },
337
+ "note": { "type": "string" },
338
+ "resources": {
339
+ "type": "array",
340
+ "items": {
341
+ "type": "object",
342
+ "required": ["address", "ms"],
343
+ "properties": {
344
+ "address": { "type": "string" },
345
+ "type": { "type": "string" },
346
+ "action": { "type": "string" },
347
+ "provider": { "type": "string" },
348
+ "ms": { "type": "number" },
349
+ "refresh_ms": { "type": "number" }
350
+ }
351
+ }
352
+ },
353
+ "provider_calls": {
354
+ "type": "array",
355
+ "items": {
356
+ "type": "object",
357
+ "required": ["method", "ms"],
358
+ "properties": {
359
+ "method": { "type": "string" },
360
+ "provider": { "type": "string" },
361
+ "type": { "type": "string" },
362
+ "address": { "type": "string" },
363
+ "ms": { "type": "number" }
364
+ }
365
+ }
366
+ },
367
+ "provider_init": {
368
+ "type": "array",
369
+ "items": {
370
+ "type": "object",
371
+ "required": ["provider", "count", "ms", "max_ms"],
372
+ "properties": {
373
+ "provider": { "type": "string" },
374
+ "count": { "type": "integer" },
375
+ "ms": { "type": "number" },
376
+ "max_ms": { "type": "number" }
377
+ }
378
+ }
379
+ },
380
+ "lock_waits": {
381
+ "type": "array",
382
+ "items": {
383
+ "type": "object",
384
+ "required": ["ms"],
385
+ "properties": {
386
+ "backend": { "type": "string" },
387
+ "operation": { "type": "string" },
388
+ "attempts": { "type": "integer" },
389
+ "ms": { "type": "number" }
390
+ }
391
+ }
392
+ },
393
+ "aggregates": {
394
+ "type": "array",
395
+ "items": {
396
+ "type": "object",
397
+ "required": ["of", "count", "detailed", "ms", "max_ms"],
398
+ "properties": {
399
+ "of": { "type": "string" },
400
+ "kind": { "type": "string" },
401
+ "type": { "type": "string" },
402
+ "provider": { "type": "string" },
403
+ "method": { "type": "string" },
404
+ "count": { "type": "integer" },
405
+ "detailed": { "type": "integer" },
406
+ "ms": { "type": "number" },
407
+ "max_ms": { "type": "number" },
408
+ "slowest": { "type": "string" },
409
+ "groups": { "type": "integer" }
410
+ }
411
+ }
412
+ }
413
+ }
414
+ },
415
+ "action": { "enum": ["create", "update", "replace", "delete", "read", "no-op", "forget"] },
416
+ "fold": { "enum": ["open", "folded"] },
417
+ "summaryChange": {
418
+ "type": "object",
419
+ "required": ["line", "action", "count"],
420
+ "properties": {
421
+ "line": { "type": "string" },
422
+ "action": { "$ref": "#/$defs/action" },
423
+ "count": { "type": "integer" },
424
+ "differsFrom": { "type": "string" },
425
+ "differsIn": { "type": "array", "items": { "type": "string" } }
426
+ }
427
+ }
428
+ }
429
+ }