@intentius/terragucci 0.4.7 → 0.4.8
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/dist/notify.schema.json +62 -56
- package/dist/run.schema.json +1 -1
- package/dist/terragucci.mjs +698 -623
- package/dist/terragucci.mjs.map +4 -4
- package/dist/terragucci.schema.json +64 -6
- package/dist/types.d.ts +41 -4
- package/package.json +6 -6
package/dist/notify.schema.json
CHANGED
|
@@ -1,66 +1,72 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
-
"$id": "https://intentius.io/
|
|
4
|
-
"title": "
|
|
5
|
-
"description": "The event
|
|
3
|
+
"$id": "https://intentius.io/chant/schemas/notify/v1/notify.schema.json",
|
|
4
|
+
"title": "chant.notify/v1",
|
|
5
|
+
"description": "The event a notify webhook receives (#3761): a wave or environment waits for an approval, a run was refused or failed, or drift was found. Sent by chant's Op waves and by products built on chant (terragucci, SQL Yodeler) through @intentius/chant/notify, signed with HMAC-SHA256 over <timestamp>.<body>. Readers ignore fields they do not know; a field is only ever added within a version.",
|
|
6
6
|
"type": "object",
|
|
7
|
-
"required": ["schema", "id", "event", "
|
|
7
|
+
"required": ["schema", "id", "event", "at", "source", "project", "summary", "targets"],
|
|
8
8
|
"properties": {
|
|
9
|
-
"schema": { "const": "
|
|
10
|
-
"id": { "type": "string", "description": "
|
|
11
|
-
"event": { "enum": ["waiting", "refused", "failed"] },
|
|
12
|
-
"
|
|
13
|
-
"
|
|
14
|
-
"
|
|
15
|
-
"
|
|
16
|
-
"
|
|
17
|
-
"pr": { "type": "integer", "description": "The pull or merge request the job applied, when a comment started it." },
|
|
18
|
-
"wave": { "type": "integer" },
|
|
19
|
-
"roots": { "type": "array", "items": { "type": "string" }, "description": "The wave's roots; for a refused or denied wave, the roots that moved or were denied; for a failed one, the roots that failed." },
|
|
20
|
-
"run_url": { "type": "string" },
|
|
21
|
-
"report_url": { "type": "string" },
|
|
22
|
-
"outcome": { "$ref": "#/$defs/outcome" }
|
|
23
|
-
},
|
|
24
|
-
"$defs": {
|
|
25
|
-
"outcome": {
|
|
9
|
+
"schema": { "const": "chant.notify/v1" },
|
|
10
|
+
"id": { "type": "string", "minLength": 1, "description": "The same for every send of one event about one digest (else drift fingerprint, else commit), so a receiver can drop a repeat; random when there is none. The delivery header carries it too." },
|
|
11
|
+
"event": { "enum": ["waiting", "refused", "failed", "drift"] },
|
|
12
|
+
"at": { "type": "string", "description": "When it was sent, ISO 8601 UTC." },
|
|
13
|
+
"source": { "type": "string", "minLength": 1, "description": "The product that sent it: chant, terragucci, sql-yodeler." },
|
|
14
|
+
"project": { "type": "string", "description": "What the run belongs to: the repository, or a name the product gives." },
|
|
15
|
+
"summary": { "type": "string", "description": "One line a person can read." },
|
|
16
|
+
"wave": {
|
|
26
17
|
"type": "object",
|
|
27
|
-
"
|
|
28
|
-
"required": ["schema", "status", "exit", "wave", "roots"],
|
|
18
|
+
"required": ["number"],
|
|
29
19
|
"properties": {
|
|
30
|
-
"
|
|
31
|
-
"
|
|
32
|
-
"
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
"
|
|
44
|
-
"
|
|
45
|
-
"waiting_since": { "type": "string" },
|
|
20
|
+
"number": { "type": "integer", "minimum": 1 },
|
|
21
|
+
"name": { "type": "string" },
|
|
22
|
+
"gate": { "type": "string", "description": "The gate the wave waits on." }
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
"environment": { "type": "string" },
|
|
26
|
+
"targets": { "type": "array", "items": { "type": "string" }, "description": "What the event concerns: a wave's roots or runs, an environment's pending migrations. For refused and failed, the ones refused or failed when the product knows them." },
|
|
27
|
+
"digest": { "type": "string", "description": "The plan digest an approval binds." },
|
|
28
|
+
"approve": {
|
|
29
|
+
"type": "object",
|
|
30
|
+
"description": "On waiting: how a person approves it.",
|
|
31
|
+
"required": ["command"],
|
|
32
|
+
"properties": {
|
|
33
|
+
"command": { "type": "string", "description": "The command to run, as the product prints it." },
|
|
34
|
+
"chant": { "type": "string", "description": "chant's own command for the same approval, when the product's differs." },
|
|
46
35
|
"review": {
|
|
47
36
|
"type": "object",
|
|
48
|
-
"
|
|
49
|
-
"
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
"type": "object",
|
|
53
|
-
"required": ["reason", "roots"],
|
|
54
|
-
"properties": {
|
|
55
|
-
"reason": { "enum": ["approval", "review", "override", "policy"] },
|
|
56
|
-
"approved": { "type": "string" },
|
|
57
|
-
"by": { "type": "string" },
|
|
58
|
-
"roots": { "type": "array", "items": { "type": "string" } }
|
|
59
|
-
}
|
|
60
|
-
},
|
|
61
|
-
"policy_denied": { "type": "array", "items": { "type": "string" } },
|
|
62
|
-
"failed_roots": { "type": "array", "items": { "type": "string" } }
|
|
37
|
+
"description": "Under pr-review: the pull request whose approving review would approve it.",
|
|
38
|
+
"required": ["pr", "url"],
|
|
39
|
+
"properties": { "pr": { "type": "integer" }, "url": { "type": "string" } }
|
|
40
|
+
}
|
|
63
41
|
}
|
|
64
|
-
}
|
|
65
|
-
|
|
42
|
+
},
|
|
43
|
+
"status": { "type": "string", "description": "The product's own word for the outcome." },
|
|
44
|
+
"reason": { "type": "string", "description": "On refused and failed: why." },
|
|
45
|
+
"exitCode": { "type": "integer" },
|
|
46
|
+
"drift": {
|
|
47
|
+
"type": "object",
|
|
48
|
+
"required": ["changed"],
|
|
49
|
+
"properties": {
|
|
50
|
+
"changed": { "type": "array", "items": { "type": "string" } },
|
|
51
|
+
"missing": { "type": "array", "items": { "type": "string" } },
|
|
52
|
+
"failed": { "type": "array", "items": { "type": "string" }, "description": "What could not be checked." },
|
|
53
|
+
"fingerprint": { "type": "string", "description": "The same drift has the same fingerprint, run after run." }
|
|
54
|
+
}
|
|
55
|
+
},
|
|
56
|
+
"run": {
|
|
57
|
+
"type": "object",
|
|
58
|
+
"properties": {
|
|
59
|
+
"url": { "type": "string", "description": "The CI run's page (GitHub, Forgejo) or job's page (GitLab)." },
|
|
60
|
+
"forge": { "enum": ["github", "gitlab", "forgejo"] },
|
|
61
|
+
"repository": { "type": "string" },
|
|
62
|
+
"commit": { "type": "string" },
|
|
63
|
+
"pr": { "type": "integer" }
|
|
64
|
+
}
|
|
65
|
+
},
|
|
66
|
+
"reportUrl": { "type": "string" },
|
|
67
|
+
"detail": { "type": "object", "description": "The product's own record of the outcome, carried whole (terragucci.outcome/v1)." }
|
|
68
|
+
},
|
|
69
|
+
"allOf": [
|
|
70
|
+
{ "if": { "required": ["event"], "properties": { "event": { "const": "drift" } } }, "then": { "required": ["drift"], "properties": { "drift": { "type": "object" } } } }
|
|
71
|
+
]
|
|
66
72
|
}
|
package/dist/run.schema.json
CHANGED
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
"reads": { "type": "array", "items": { "type": "integer" }, "description": "The waves whose roots' state its roots read." },
|
|
59
59
|
"state": { "enum": ["not-started", "planned", "waiting", "applying", "applied", "refused", "failed"] },
|
|
60
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-
|
|
61
|
+
"policy": { "type": "string", "description": "The gate policy it ran under: always, on-destructive or never." },
|
|
62
62
|
"approval": { "enum": ["not-requested", "waiting", "approved", "not-required"] },
|
|
63
63
|
"digest": { "type": ["string", "null"], "description": "The set digest its gate decided on." },
|
|
64
64
|
"command": { "type": "string", "description": "The command that approves it, while it waits." },
|