@intentius/terragucci 0.4.3 → 0.4.5

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,110 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://intentius.io/terragucci/schemas/run/v1/run.schema.json",
4
+ "title": "terragucci.run/v1",
5
+ "description": "run.json under <prefix>/<project>/runs/<commit>/: the apply of one commit, every wave of it, the roots in each and the roots whose state each reads, and where each wave stands at its gate. Each tf-apply wave job rewrites its own row when it starts applying and when it ends. Within v1 fields are only added, and an existing field never changes meaning.",
6
+ "type": "object",
7
+ "required": ["schema", "project", "commit", "updated", "roots", "waves"],
8
+ "$defs": {
9
+ "state": {
10
+ "type": "object",
11
+ "required": ["key"],
12
+ "properties": {
13
+ "bucket": { "type": "string" },
14
+ "key": { "type": "string" }
15
+ }
16
+ }
17
+ },
18
+ "properties": {
19
+ "schema": { "const": "terragucci.run/v1" },
20
+ "project": { "type": "string" },
21
+ "commit": { "type": "string" },
22
+ "updated": { "type": "string", "description": "When a wave job last wrote it." },
23
+ "roots": {
24
+ "type": "array",
25
+ "description": "Each root, its wave, and the roots whose state it reads through terraform_remote_state. Empty for a Terragrunt repo.",
26
+ "items": {
27
+ "type": "object",
28
+ "required": ["root", "wave", "reads"],
29
+ "properties": {
30
+ "root": { "type": "string" },
31
+ "wave": { "type": "integer" },
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. Under choudoufu, the records of the estate its live block owns: tofu-records/<estate>, with no bucket." },
34
+ "external": {
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. 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
+ "items": {
38
+ "type": "object",
39
+ "required": ["data", "key"],
40
+ "properties": {
41
+ "data": { "type": "string" },
42
+ "bucket": { "type": "string" },
43
+ "key": { "type": "string" }
44
+ }
45
+ }
46
+ }
47
+ }
48
+ }
49
+ },
50
+ "waves": {
51
+ "type": "array",
52
+ "items": {
53
+ "type": "object",
54
+ "required": ["number", "roots", "reads", "state", "gate"],
55
+ "properties": {
56
+ "number": { "type": "integer" },
57
+ "roots": { "type": "array", "items": { "type": "string" } },
58
+ "reads": { "type": "array", "items": { "type": "integer" }, "description": "The waves whose roots' state its roots read." },
59
+ "state": { "enum": ["not-started", "planned", "waiting", "applying", "applied", "refused", "failed"] },
60
+ "gate": { "type": "string", "description": "Its gate on the ledger, wave-<n>." },
61
+ "policy": { "type": "string", "description": "The gate policy it ran under: always, on-destroy or never." },
62
+ "approval": { "enum": ["not-requested", "waiting", "approved", "not-required"] },
63
+ "digest": { "type": ["string", "null"], "description": "The set digest its gate decided on." },
64
+ "command": { "type": "string", "description": "The command that approves it, while it waits." },
65
+ "report": { "type": "string", "description": "Its report's directory, relative to the project's index.json." },
66
+ "shares": { "type": "integer", "description": "A wave split across jobs: how many share jobs apply it." },
67
+ "shares_applied": { "type": "array", "items": { "type": "integer" }, "description": "The shares that applied; the wave is applied once every share has." },
68
+ "changed": { "type": "array", "items": { "type": "string" }, "description": "The roots whose plan in this wave changes a resource or an output: where the run's blast radius starts." },
69
+ "spans": {
70
+ "type": "array",
71
+ "description": "The wave's time, oldest first: each plan, each wait at its gate (no end while it waits) and each apply (no end while it applies). At most 24.",
72
+ "items": {
73
+ "type": "object",
74
+ "required": ["phase", "start"],
75
+ "properties": {
76
+ "phase": { "enum": ["plan", "gate", "apply"] },
77
+ "start": { "type": "string" },
78
+ "end": { "type": "string" },
79
+ "share": { "type": "integer", "description": "The share of a wave split across jobs that planned or applied." }
80
+ }
81
+ }
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
+ },
105
+ "updated": { "type": "string" }
106
+ }
107
+ }
108
+ }
109
+ }
110
+ }
@@ -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
+ }
@@ -0,0 +1,42 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://intentius.io/terragucci/schemas/state-versions/v1/state-versions.schema.json",
4
+ "title": "terragucci.state-versions/v1",
5
+ "description": "states.json in a project's directory of a reports prefix: for each root, where its state is, whether its backend keeps versions, and the version ids its tf-apply waves left, newest first. Version ids, never a state's contents. Within v1 fields are only added, and an existing field never changes meaning.",
6
+ "type": "object",
7
+ "required": ["schema", "roots"],
8
+ "properties": {
9
+ "schema": { "const": "terragucci.state-versions/v1" },
10
+ "roots": {
11
+ "type": "array",
12
+ "description": "By root path.",
13
+ "items": {
14
+ "type": "object",
15
+ "required": ["root", "backend", "versioning", "checked", "versions"],
16
+ "properties": {
17
+ "root": { "type": "string" },
18
+ "backend": { "type": "string", "description": "The backend the root initialised: s3, local, gcs and so on." },
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
+ "versioning": { "enum": ["on", "off", "unknown"], "description": "As the newest apply found it." },
21
+ "note": { "type": "string", "description": "Why the version could not be read, or what off means for this backend." },
22
+ "checked": { "type": "string", "description": "When the newest apply that recorded the root finished." },
23
+ "versions": {
24
+ "type": "array",
25
+ "description": "Newest first, at most 20.",
26
+ "items": {
27
+ "type": "object",
28
+ "required": ["version_id", "commit", "finished", "path"],
29
+ "properties": {
30
+ "version_id": { "type": "string" },
31
+ "commit": { "type": "string" },
32
+ "finished": { "type": "string", "description": "When the wave that recorded the version finished." },
33
+ "wave": { "type": "integer" },
34
+ "path": { "type": "string", "description": "The wave's run directory, relative to the project's index.json." }
35
+ }
36
+ }
37
+ }
38
+ }
39
+ }
40
+ }
41
+ }
42
+ }