@intentius/terragucci 0.4.4 → 0.4.6
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 +2 -2
- package/dist/audit.schema.json +3 -3
- package/dist/changes.schema.json +28 -1
- package/dist/estate.schema.json +71 -2
- package/dist/history.schema.json +27 -0
- package/dist/report.schema.json +107 -5
- package/dist/run.schema.json +24 -2
- package/dist/state-edges.schema.json +52 -0
- package/dist/state-versions.schema.json +1 -1
- package/dist/terragucci.mjs +764 -499
- package/dist/terragucci.mjs.map +4 -4
- package/dist/terragucci.schema.json +3005 -0
- package/dist/types.d.ts +212 -21
- package/package.json +8 -4
package/README.md
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
# @intentius/terragucci
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
terragucci writes the pipeline that runs the whole lifecycle of your Terraform or Terragrunt repo on GitHub, GitLab or Forgejo.
|
|
4
4
|
|
|
5
5
|
```bash
|
|
6
6
|
npm i -D @intentius/terragucci
|
|
7
7
|
npx terragucci init
|
|
8
8
|
```
|
|
9
9
|
|
|
10
|
-
`init` reads the repo
|
|
10
|
+
`init` reads the repo and writes the pipeline it needs, then reports what it found:
|
|
11
11
|
|
|
12
12
|
```
|
|
13
13
|
found 15 roots in 2 layers, tofu 1.13.1 (.opentofu-version), forge github (the origin remote (github.com))
|
package/dist/audit.schema.json
CHANGED
|
@@ -2,17 +2,17 @@
|
|
|
2
2
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
3
|
"$id": "https://intentius.io/terragucci/schemas/audit/v1/audit.schema.json",
|
|
4
4
|
"title": "terragucci.audit/v1",
|
|
5
|
-
"description": "One line of audit.jsonl at the top of a reports prefix: an approval, apply, policy override, refused wave or state
|
|
5
|
+
"description": "One line of audit.jsonl at the top of a reports prefix: an approval, apply, policy override, refused wave, state migration or state export. Within v1 fields are only added, and an existing field never changes meaning.",
|
|
6
6
|
"type": "object",
|
|
7
7
|
"required": ["schema", "id", "kind", "project", "at", "who", "what", "digest", "result", "evidence"],
|
|
8
8
|
"properties": {
|
|
9
9
|
"schema": { "const": "terragucci.audit/v1" },
|
|
10
10
|
"id": { "type": "string", "description": "sha256: over where the entry came from; the same records give the same id." },
|
|
11
|
-
"kind": { "enum": ["approval-requested", "approval", "approval-revoked", "override-requested", "override", "override-revoked", "apply", "refused", "migration", "unlock"] },
|
|
11
|
+
"kind": { "enum": ["approval-requested", "approval", "approval-revoked", "override-requested", "override", "override-revoked", "apply", "refused", "migration", "unlock", "state-export", "ephemeral-apply", "ephemeral-destroy"] },
|
|
12
12
|
"project": { "type": "string", "description": "<host>/<path> of the repo." },
|
|
13
13
|
"at": { "type": "string", "description": "When it happened, ISO 8601." },
|
|
14
14
|
"who": { "type": ["string", "null"], "description": "The approver, the overrider, whoever removed the line, or for an apply the approver it applied under. Null when nobody did." },
|
|
15
|
-
"what": { "type": "string", "description": "The gate (wave-<k>, or a migration's name) or, for an override, the root." },
|
|
15
|
+
"what": { "type": "string", "description": "The gate (wave-<k>, or a migration's name) or, for an override or a state export, the root." },
|
|
16
16
|
"digest": { "type": ["string", "null"], "description": "The wave's set digest, or the digest an override binds. Null when a root failed to plan." },
|
|
17
17
|
"result": { "type": "string" },
|
|
18
18
|
"evidence": {
|
package/dist/changes.schema.json
CHANGED
|
@@ -25,9 +25,36 @@
|
|
|
25
25
|
"path": { "type": "string", "description": "The wave's run directory, relative to the project's index.json." },
|
|
26
26
|
"plan_digest": { "type": ["string", "null"], "description": "The root's plan digest: the plan that applied." },
|
|
27
27
|
"set_digest": { "type": ["string", "null"], "description": "The wave's set digest, which its approval binds." },
|
|
28
|
-
"pull_request": { "type": "string" }
|
|
28
|
+
"pull_request": { "type": "string" },
|
|
29
|
+
"record_versions": { "$ref": "#/$defs/record_versions" }
|
|
29
30
|
}
|
|
30
31
|
}
|
|
31
32
|
}
|
|
33
|
+
},
|
|
34
|
+
"$defs": {
|
|
35
|
+
"record_versions": {
|
|
36
|
+
"description": "For a choudoufu root: its record's versions once the apply finished, newest first, from choudoufu live-history: each version's id, when it was written, and whether it is current or a delete marker, never what it holds. kept is false for a record store that keeps none (local, kubernetes); error is live-history's error as it printed it (minor 32).",
|
|
37
|
+
"type": "object",
|
|
38
|
+
"required": ["read"],
|
|
39
|
+
"properties": {
|
|
40
|
+
"kept": { "type": "boolean" },
|
|
41
|
+
"store": { "type": "string" },
|
|
42
|
+
"versions": {
|
|
43
|
+
"type": "array",
|
|
44
|
+
"items": {
|
|
45
|
+
"type": "object",
|
|
46
|
+
"required": ["version_id", "last_modified", "current", "deleted"],
|
|
47
|
+
"properties": {
|
|
48
|
+
"version_id": { "type": "string" },
|
|
49
|
+
"last_modified": { "type": "string" },
|
|
50
|
+
"current": { "type": "boolean" },
|
|
51
|
+
"deleted": { "type": "boolean" }
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
"error": { "type": "string" },
|
|
56
|
+
"read": { "type": "string" }
|
|
57
|
+
}
|
|
58
|
+
}
|
|
32
59
|
}
|
|
33
60
|
}
|
package/dist/estate.schema.json
CHANGED
|
@@ -19,7 +19,8 @@
|
|
|
19
19
|
"failed_roots": { "type": "integer" },
|
|
20
20
|
"unreadable": { "type": "integer", "description": "Projects whose index could not be read." },
|
|
21
21
|
"overridden_roots": { "type": "integer", "description": "Roots the newest apply waves applied under a policy override. Absent when none." },
|
|
22
|
-
"resources": { "type": "integer", "description": "Resources across every project's inventory. Absent when no project has one." }
|
|
22
|
+
"resources": { "type": "integer", "description": "Resources across every project's inventory. Absent when no project has one." },
|
|
23
|
+
"ephemeral": { "type": "integer", "description": "Live ephemeral environments across every project. Absent when none is live." }
|
|
23
24
|
}
|
|
24
25
|
},
|
|
25
26
|
"projects": { "type": "array", "items": { "$ref": "#/$defs/project" } },
|
|
@@ -169,6 +170,7 @@
|
|
|
169
170
|
"overridden": { "type": "integer", "description": "Roots the newest commit's apply waves applied under a policy override. Absent when none." },
|
|
170
171
|
"inventory": { "$ref": "#/$defs/inventory", "description": "The resources its roots hold, from its inventory.json. Absent until an apply records them." },
|
|
171
172
|
"states": { "type": "array", "description": "Each root's state versions, from its states.json. Absent until an apply records them.", "items": { "$ref": "#/$defs/stateRoot" } },
|
|
173
|
+
"edges": { "type": "array", "description": "Each cross-state edge, from its edges.json: a consumer root, the producer root whose state it reads, the consumer's last plan and the producer's last apply that changed it. Absent until a run records an edge.", "items": { "$ref": "#/$defs/edge" } },
|
|
172
174
|
"run_view": {
|
|
173
175
|
"type": "object",
|
|
174
176
|
"description": "The run view of the project's newest applied commit, which the dependency graph read: its commit, when a wave last wrote it, and its run.html when the page can link it. Absent until a wave writes one.",
|
|
@@ -178,9 +180,70 @@
|
|
|
178
180
|
"updated": { "type": "string" },
|
|
179
181
|
"page": { "type": "string" }
|
|
180
182
|
}
|
|
183
|
+
},
|
|
184
|
+
"applying": {
|
|
185
|
+
"type": "array",
|
|
186
|
+
"description": "The waves of that run view still applying whose resources are followed (a choudoufu wave): how many are done, in flight and waiting at the last read of the records.",
|
|
187
|
+
"items": {
|
|
188
|
+
"type": "object",
|
|
189
|
+
"required": ["wave", "read", "total", "done", "in_flight", "waiting"],
|
|
190
|
+
"properties": {
|
|
191
|
+
"wave": { "type": "integer" },
|
|
192
|
+
"read": { "type": "string" },
|
|
193
|
+
"total": { "type": "integer" },
|
|
194
|
+
"done": { "type": "integer" },
|
|
195
|
+
"in_flight": { "type": "integer" },
|
|
196
|
+
"waiting": { "type": "integer" }
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
},
|
|
200
|
+
"ephemeral": {
|
|
201
|
+
"type": "array",
|
|
202
|
+
"description": "The live ephemeral environments, from its ephemeral.json: each pull request's copy of the ephemeral roots, their state keys, and when it expires. Absent when none is live.",
|
|
203
|
+
"items": {
|
|
204
|
+
"type": "object",
|
|
205
|
+
"required": ["pull_request", "suffix", "roots", "commit", "applied", "expires", "status"],
|
|
206
|
+
"properties": {
|
|
207
|
+
"pull_request": { "type": "integer" },
|
|
208
|
+
"pull_request_url": { "type": "string" },
|
|
209
|
+
"suffix": { "type": "string", "description": "What the copy's state keys end in: pr-<n>." },
|
|
210
|
+
"roots": { "type": "array", "items": { "type": "object", "required": ["root", "location"], "properties": { "root": { "type": "string" }, "location": { "type": "string" } } } },
|
|
211
|
+
"commit": { "type": "string", "description": "The head the copy last applied from." },
|
|
212
|
+
"applied": { "type": "string" },
|
|
213
|
+
"expires": { "type": "string" },
|
|
214
|
+
"approved_by": { "type": "string" },
|
|
215
|
+
"status": { "enum": ["live", "destroy-failed"] }
|
|
216
|
+
}
|
|
217
|
+
}
|
|
181
218
|
}
|
|
182
219
|
}
|
|
183
220
|
},
|
|
221
|
+
"edgeRun": {
|
|
222
|
+
"type": "object",
|
|
223
|
+
"required": ["stage", "commit", "finished"],
|
|
224
|
+
"properties": {
|
|
225
|
+
"stage": { "type": "string" },
|
|
226
|
+
"commit": { "type": "string" },
|
|
227
|
+
"finished": { "type": "string" },
|
|
228
|
+
"wave": { "type": "integer" },
|
|
229
|
+
"pull_request": { "type": "string" },
|
|
230
|
+
"version_id": { "type": "string" },
|
|
231
|
+
"report": { "type": "string", "description": "The run's report.html, when the page can link it." }
|
|
232
|
+
}
|
|
233
|
+
},
|
|
234
|
+
"edge": {
|
|
235
|
+
"type": "object",
|
|
236
|
+
"description": "One root reading another's state. stale: the producer applied a change after the consumer's last plan; current: the consumer's last plan is newer than that apply; unknown: either run is not recorded.",
|
|
237
|
+
"required": ["consumer", "producer", "via", "status"],
|
|
238
|
+
"properties": {
|
|
239
|
+
"consumer": { "type": "string" },
|
|
240
|
+
"producer": { "type": "string" },
|
|
241
|
+
"via": { "enum": ["terraform_remote_state", "dependency"] },
|
|
242
|
+
"consumer_planned": { "$ref": "#/$defs/edgeRun" },
|
|
243
|
+
"producer_applied": { "$ref": "#/$defs/edgeRun" },
|
|
244
|
+
"status": { "enum": ["current", "stale", "unknown"] }
|
|
245
|
+
}
|
|
246
|
+
},
|
|
184
247
|
"stateRoot": {
|
|
185
248
|
"type": "object",
|
|
186
249
|
"description": "One root's state: where it is, whether its backend keeps versions, and the version ids its applies left, newest first. Never the state's contents.",
|
|
@@ -243,7 +306,13 @@
|
|
|
243
306
|
"address": { "type": "string" },
|
|
244
307
|
"type": { "type": "string" },
|
|
245
308
|
"provider": { "type": "string" },
|
|
246
|
-
"history": { "type": "string", "description": "Its section of history.html, when an apply changed it." }
|
|
309
|
+
"history": { "type": "string", "description": "Its section of history.html, when an apply changed it." },
|
|
310
|
+
"record_versions": {
|
|
311
|
+
"type": "object",
|
|
312
|
+
"description": "A choudoufu record's past versions, from its history: count when the store keeps them, kept false when it keeps none (local, kubernetes), error when they were not listed.",
|
|
313
|
+
"required": ["kept"],
|
|
314
|
+
"properties": { "kept": { "type": "boolean" }, "count": { "type": "integer" }, "error": { "type": "string" } }
|
|
315
|
+
}
|
|
247
316
|
}
|
|
248
317
|
}
|
|
249
318
|
}
|
package/dist/history.schema.json
CHANGED
|
@@ -20,6 +20,7 @@
|
|
|
20
20
|
"root": { "type": "string" },
|
|
21
21
|
"address": { "type": "string" },
|
|
22
22
|
"type": { "type": "string" },
|
|
23
|
+
"record_versions": { "$ref": "#/$defs/record_versions" },
|
|
23
24
|
"applies": {
|
|
24
25
|
"type": "array",
|
|
25
26
|
"description": "Oldest first.",
|
|
@@ -45,5 +46,31 @@
|
|
|
45
46
|
}
|
|
46
47
|
}
|
|
47
48
|
}
|
|
49
|
+
},
|
|
50
|
+
"$defs": {
|
|
51
|
+
"record_versions": {
|
|
52
|
+
"description": "For a choudoufu root: its record's versions as the newest apply that changed it listed them, newest first, from choudoufu live-history: each version's id, when it was written, and whether it is current or a delete marker, never what it holds. kept is false for a record store that keeps none (local, kubernetes); error is live-history's error as it printed it.",
|
|
53
|
+
"type": "object",
|
|
54
|
+
"required": ["read"],
|
|
55
|
+
"properties": {
|
|
56
|
+
"kept": { "type": "boolean" },
|
|
57
|
+
"store": { "type": "string" },
|
|
58
|
+
"versions": {
|
|
59
|
+
"type": "array",
|
|
60
|
+
"items": {
|
|
61
|
+
"type": "object",
|
|
62
|
+
"required": ["version_id", "last_modified", "current", "deleted"],
|
|
63
|
+
"properties": {
|
|
64
|
+
"version_id": { "type": "string" },
|
|
65
|
+
"last_modified": { "type": "string" },
|
|
66
|
+
"current": { "type": "boolean" },
|
|
67
|
+
"deleted": { "type": "boolean" }
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
"error": { "type": "string" },
|
|
72
|
+
"read": { "type": "string" }
|
|
73
|
+
}
|
|
74
|
+
}
|
|
48
75
|
}
|
|
49
76
|
}
|
package/dist/report.schema.json
CHANGED
|
@@ -78,7 +78,16 @@
|
|
|
78
78
|
"properties": {
|
|
79
79
|
"name": { "type": "string" },
|
|
80
80
|
"version": { "type": "string" },
|
|
81
|
-
"pin": { "type": "string" }
|
|
81
|
+
"pin": { "type": "string" },
|
|
82
|
+
"terragrunt": {
|
|
83
|
+
"description": "A Terragrunt unit: the Terragrunt release that ran it, and terragrunt_version_constraint when the unit pinned it (minor 24).",
|
|
84
|
+
"type": "object",
|
|
85
|
+
"required": ["version"],
|
|
86
|
+
"properties": {
|
|
87
|
+
"version": { "type": "string" },
|
|
88
|
+
"pin": { "type": "string" }
|
|
89
|
+
}
|
|
90
|
+
}
|
|
82
91
|
}
|
|
83
92
|
},
|
|
84
93
|
"terragrunt": {
|
|
@@ -87,6 +96,7 @@
|
|
|
87
96
|
"required": ["stack", "selection", "provisional", "run_result"],
|
|
88
97
|
"properties": {
|
|
89
98
|
"stack": { "type": "string" },
|
|
99
|
+
"stack_file": { "description": "The terragrunt.stack.hcl that generates the unit, when an explicit stack does (minor 29).", "type": "string" },
|
|
90
100
|
"selection": { "type": "string" },
|
|
91
101
|
"provisional": { "type": "boolean" },
|
|
92
102
|
"run_result": { "type": "string" }
|
|
@@ -197,10 +207,16 @@
|
|
|
197
207
|
"type": { "type": "string" },
|
|
198
208
|
"actions": { "type": "array", "items": { "enum": ["create", "update", "replace", "delete", "import", "move", "forget"] } },
|
|
199
209
|
"attributes": { "type": "array", "items": { "type": "string" } },
|
|
200
|
-
"previous_address": { "type": "string" }
|
|
210
|
+
"previous_address": { "type": "string" },
|
|
211
|
+
"record_versions": { "$ref": "#/$defs/record_versions" }
|
|
201
212
|
}
|
|
202
213
|
}
|
|
203
214
|
},
|
|
215
|
+
"dependencies": {
|
|
216
|
+
"description": "A Terragrunt unit's dependency and dependencies blocks: the units whose outputs it reads, as plain paths in its terragrunt.hcl (minor 23). For a plain root, the roots waves.after puts before it. Absent when it names none.",
|
|
217
|
+
"type": "array",
|
|
218
|
+
"items": { "type": "string" }
|
|
219
|
+
},
|
|
204
220
|
"state": {
|
|
205
221
|
"description": "On a tf-apply wave, a root that applied or had nothing to apply: the state version its backend holds afterwards, read from the object's metadata, never its contents (minor 20).",
|
|
206
222
|
"type": "object",
|
|
@@ -242,7 +258,20 @@
|
|
|
242
258
|
"why": { "type": "string" }
|
|
243
259
|
}
|
|
244
260
|
}
|
|
245
|
-
}
|
|
261
|
+
},
|
|
262
|
+
"unknown_reads": {
|
|
263
|
+
"description": "Its terraform_remote_state blocks whose state the code does not address, an expression or a value the backend takes from the environment: no edge orders the root after the root that writes that state, so the edge is unknown (minor 30).",
|
|
264
|
+
"type": "array",
|
|
265
|
+
"items": {
|
|
266
|
+
"type": "object",
|
|
267
|
+
"required": ["data", "why"],
|
|
268
|
+
"properties": {
|
|
269
|
+
"data": { "type": "string", "description": "The block's label." },
|
|
270
|
+
"why": { "type": "string" }
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
},
|
|
274
|
+
"unaddressed": { "type": "string", "description": "Why the code does not address the root's own state, when a root of the run reads state through terraform_remote_state: a reader of it is not ordered after it (minor 30)." }
|
|
246
275
|
}
|
|
247
276
|
}
|
|
248
277
|
},
|
|
@@ -305,7 +334,26 @@
|
|
|
305
334
|
},
|
|
306
335
|
"state": { "enum": ["planned", "waiting", "applying", "applied", "refused", "failed"], "description": "Where the wave stands (minor 21): a tf-plan wave is planned; a tf-apply wave waiting, applying, applied, refused or failed." },
|
|
307
336
|
"reads": { "type": "array", "items": { "type": "integer" }, "description": "The waves whose roots' state its roots read (minor 21)." },
|
|
308
|
-
"replans_after": { "type": "array", "items": { "type": "integer" }, "description": "A tf-plan wave whose plans read outputs known only once these waves apply: it plans again after they apply and waits for an approval of that plan; its review digest is null (minor 21)." }
|
|
337
|
+
"replans_after": { "type": "array", "items": { "type": "integer" }, "description": "A tf-plan wave whose plans read outputs known only once these waves apply: it plans again after they apply and waits for an approval of that plan; its review digest is null (minor 21)." },
|
|
338
|
+
"preview": {
|
|
339
|
+
"type": "object",
|
|
340
|
+
"required": ["pull_request", "units"],
|
|
341
|
+
"description": "A tf-apply wave of Terragrunt units: its plans against the preview of them the merged pull request's plan note showed (minor 25).",
|
|
342
|
+
"properties": {
|
|
343
|
+
"pull_request": { "type": "integer" },
|
|
344
|
+
"units": {
|
|
345
|
+
"type": "array",
|
|
346
|
+
"items": {
|
|
347
|
+
"type": "object",
|
|
348
|
+
"required": ["unit"],
|
|
349
|
+
"properties": {
|
|
350
|
+
"unit": { "type": "string" },
|
|
351
|
+
"differences": { "type": "array", "items": { "type": "string" }, "description": "How its plan differs from the preview. Absent when it plans as previewed." }
|
|
352
|
+
}
|
|
353
|
+
}
|
|
354
|
+
}
|
|
355
|
+
}
|
|
356
|
+
}
|
|
309
357
|
}
|
|
310
358
|
}
|
|
311
359
|
},
|
|
@@ -354,7 +402,7 @@
|
|
|
354
402
|
}
|
|
355
403
|
},
|
|
356
404
|
"blast": {
|
|
357
|
-
"description": "A tf-plan run's blast radius (minor 22): the roots whose plan changes a resource or an output, and every root of the repo that reads their state through terraform_remote_state, followed through, nearest first. Absent when no root's plan changes anything,
|
|
405
|
+
"description": "A tf-plan run's blast radius (minor 22): the roots whose plan changes a resource or an output, and every root of the repo that reads their state through terraform_remote_state (in a Terragrunt repo, every unit that depends on them through a dependency or dependencies block), followed through, nearest first. Absent when no root's plan changes anything, and on other stages.",
|
|
358
406
|
"type": "object",
|
|
359
407
|
"required": ["roots", "downstream"],
|
|
360
408
|
"properties": {
|
|
@@ -372,6 +420,36 @@
|
|
|
372
420
|
"planned": { "type": "boolean", "description": "Whether this run planned it." }
|
|
373
421
|
}
|
|
374
422
|
}
|
|
423
|
+
},
|
|
424
|
+
"resources": {
|
|
425
|
+
"description": "The radius by resource (minor 31), when a root is downstream: each resource a plan changes and the resources that depend on it, from the plans' references and the outputs each root reads, nearest first. A changed resource that nothing depends on is left out. Absent in a Terragrunt repo.",
|
|
426
|
+
"type": "array",
|
|
427
|
+
"items": {
|
|
428
|
+
"type": "object",
|
|
429
|
+
"required": ["root", "address", "actions", "reaches"],
|
|
430
|
+
"properties": {
|
|
431
|
+
"root": { "type": "string" },
|
|
432
|
+
"address": { "type": "string", "description": "The changed resource instance's address." },
|
|
433
|
+
"actions": { "type": "array", "items": { "type": "string" } },
|
|
434
|
+
"reaches": {
|
|
435
|
+
"type": "array",
|
|
436
|
+
"items": {
|
|
437
|
+
"type": "object",
|
|
438
|
+
"required": ["root", "address"],
|
|
439
|
+
"properties": {
|
|
440
|
+
"root": { "type": "string" },
|
|
441
|
+
"address": { "type": "string", "description": "Its address in the root's configuration, with no instance key." },
|
|
442
|
+
"through": {
|
|
443
|
+
"type": "object",
|
|
444
|
+
"required": ["root", "output"],
|
|
445
|
+
"description": "In another root: the output it reads, and the root that makes it.",
|
|
446
|
+
"properties": { "root": { "type": "string" }, "output": { "type": "string" } }
|
|
447
|
+
}
|
|
448
|
+
}
|
|
449
|
+
}
|
|
450
|
+
}
|
|
451
|
+
}
|
|
452
|
+
}
|
|
375
453
|
}
|
|
376
454
|
}
|
|
377
455
|
},
|
|
@@ -505,6 +583,30 @@
|
|
|
505
583
|
}
|
|
506
584
|
},
|
|
507
585
|
"$defs": {
|
|
586
|
+
"record_versions": {
|
|
587
|
+
"description": "For a choudoufu root: its record's versions once the apply finished, newest first, from choudoufu live-history: each version's id, when it was written, and whether it is current or a delete marker, never what it holds. kept is false for a record store that keeps none (local, kubernetes); error is live-history's error as it printed it (minor 32).",
|
|
588
|
+
"type": "object",
|
|
589
|
+
"required": ["read"],
|
|
590
|
+
"properties": {
|
|
591
|
+
"kept": { "type": "boolean" },
|
|
592
|
+
"store": { "type": "string" },
|
|
593
|
+
"versions": {
|
|
594
|
+
"type": "array",
|
|
595
|
+
"items": {
|
|
596
|
+
"type": "object",
|
|
597
|
+
"required": ["version_id", "last_modified", "current", "deleted"],
|
|
598
|
+
"properties": {
|
|
599
|
+
"version_id": { "type": "string" },
|
|
600
|
+
"last_modified": { "type": "string" },
|
|
601
|
+
"current": { "type": "boolean" },
|
|
602
|
+
"deleted": { "type": "boolean" }
|
|
603
|
+
}
|
|
604
|
+
}
|
|
605
|
+
},
|
|
606
|
+
"error": { "type": "string" },
|
|
607
|
+
"read": { "type": "string" }
|
|
608
|
+
}
|
|
609
|
+
},
|
|
508
610
|
"resource": {
|
|
509
611
|
"type": "object",
|
|
510
612
|
"required": ["address", "type", "provider"],
|
package/dist/run.schema.json
CHANGED
|
@@ -30,10 +30,10 @@
|
|
|
30
30
|
"root": { "type": "string" },
|
|
31
31
|
"wave": { "type": "integer" },
|
|
32
32
|
"reads": { "type": "array", "items": { "type": "string" } },
|
|
33
|
-
"state": { "$ref": "#/$defs/state", "description": "The state its backend block names, which a root of another project may read." },
|
|
33
|
+
"state": { "$ref": "#/$defs/state", "description": "The state its backend block names, which a root of another project may read. Under choudoufu, the records of the estate its live block owns: tofu-records/<estate>, with no bucket." },
|
|
34
34
|
"external": {
|
|
35
35
|
"type": "array",
|
|
36
|
-
"description": "Its terraform_remote_state reads of a state no root of the project holds: the block's label and the state it names. The estate page matches them to other projects' roots.",
|
|
36
|
+
"description": "Its terraform_remote_state reads of a state no root of the project holds: the block's label and the state it names. Under choudoufu, its terraform_estate_outputs reads of an estate no root of the project owns, as that estate's records. The estate page matches them to other projects' roots.",
|
|
37
37
|
"items": {
|
|
38
38
|
"type": "object",
|
|
39
39
|
"required": ["data", "key"],
|
|
@@ -80,6 +80,28 @@
|
|
|
80
80
|
}
|
|
81
81
|
}
|
|
82
82
|
},
|
|
83
|
+
"progress": {
|
|
84
|
+
"type": "object",
|
|
85
|
+
"description": "A choudoufu wave's resources while it applies and once it ended: each change its plans make, done, in flight, waiting or not applied, as its estates' records stood at the last read.",
|
|
86
|
+
"required": ["read", "resources"],
|
|
87
|
+
"properties": {
|
|
88
|
+
"read": { "type": "string", "description": "When the records were last read." },
|
|
89
|
+
"resources": {
|
|
90
|
+
"type": "array",
|
|
91
|
+
"items": {
|
|
92
|
+
"type": "object",
|
|
93
|
+
"required": ["root", "address", "action", "status"],
|
|
94
|
+
"properties": {
|
|
95
|
+
"root": { "type": "string" },
|
|
96
|
+
"address": { "type": "string" },
|
|
97
|
+
"action": { "enum": ["create", "update", "replace", "delete", "forget"] },
|
|
98
|
+
"status": { "enum": ["done", "in-flight", "waiting", "not-applied"] },
|
|
99
|
+
"done_at": { "type": "string", "description": "When a read first found it done." }
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
},
|
|
83
105
|
"updated": { "type": "string" }
|
|
84
106
|
}
|
|
85
107
|
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://intentius.io/terragucci/schemas/state-edges/v1/state-edges.schema.json",
|
|
4
|
+
"title": "terragucci.state-edges/v1",
|
|
5
|
+
"description": "edges.json in a project's directory of a reports prefix: for each root, the roots whose state it reads, the newest run that planned it and the newest tf-apply wave that changed it. Root paths and run facts, never a state's contents or an output's value. Within v1 fields are only added, and an existing field never changes meaning.",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"required": ["schema", "roots"],
|
|
8
|
+
"$defs": {
|
|
9
|
+
"run": {
|
|
10
|
+
"type": "object",
|
|
11
|
+
"required": ["stage", "commit", "finished", "path"],
|
|
12
|
+
"properties": {
|
|
13
|
+
"stage": { "type": "string", "description": "tf-plan, tf-drift or tf-apply." },
|
|
14
|
+
"commit": { "type": "string" },
|
|
15
|
+
"finished": { "type": "string" },
|
|
16
|
+
"wave": { "type": "integer" },
|
|
17
|
+
"path": { "type": "string", "description": "The run's directory, relative to the project's index.json." },
|
|
18
|
+
"pull_request": { "type": "string", "description": "The pull or merge request a plan was for." },
|
|
19
|
+
"version_id": { "type": "string", "description": "An apply: the state version it left, when the backend keeps versions." }
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
"properties": {
|
|
24
|
+
"schema": { "const": "terragucci.state-edges/v1" },
|
|
25
|
+
"roots": {
|
|
26
|
+
"type": "array",
|
|
27
|
+
"description": "By root path.",
|
|
28
|
+
"items": {
|
|
29
|
+
"type": "object",
|
|
30
|
+
"required": ["root", "reads"],
|
|
31
|
+
"properties": {
|
|
32
|
+
"root": { "type": "string" },
|
|
33
|
+
"reads": {
|
|
34
|
+
"type": "array",
|
|
35
|
+
"description": "The roots whose state it reads, as the newest default-branch run found them in its code.",
|
|
36
|
+
"items": {
|
|
37
|
+
"type": "object",
|
|
38
|
+
"required": ["root", "via"],
|
|
39
|
+
"properties": {
|
|
40
|
+
"root": { "type": "string" },
|
|
41
|
+
"via": { "enum": ["terraform_remote_state", "dependency"] }
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
"reads_seen": { "type": "string", "description": "When the run that found its reads finished." },
|
|
46
|
+
"planned": { "$ref": "#/$defs/run", "description": "The newest run that planned it: a pull request's plan, a drift check or an apply wave's plan." },
|
|
47
|
+
"applied": { "$ref": "#/$defs/run", "description": "The newest tf-apply wave that changed one of its resources." }
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"properties": {
|
|
17
17
|
"root": { "type": "string" },
|
|
18
18
|
"backend": { "type": "string", "description": "The backend the root initialised: s3, local, gcs and so on." },
|
|
19
|
-
"location": { "type": "string", "description": "s3://<bucket>/<key>, or the local file's path in the root." },
|
|
19
|
+
"location": { "type": "string", "description": "s3://<bucket>/<key>, gs://<bucket>/<key>, az://<account>/<container>/<key>, or the local file's path in the root." },
|
|
20
20
|
"versioning": { "enum": ["on", "off", "unknown"], "description": "As the newest apply found it." },
|
|
21
21
|
"note": { "type": "string", "description": "Why the version could not be read, or what off means for this backend." },
|
|
22
22
|
"checked": { "type": "string", "description": "When the newest apply that recorded the root finished." },
|