@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.
@@ -1,66 +1,72 @@
1
1
  {
2
2
  "$schema": "https://json-schema.org/draft/2020-12/schema",
3
- "$id": "https://intentius.io/terragucci/schemas/notify/v1/notify.schema.json",
4
- "title": "terragucci.notify/v1",
5
- "description": "The event terragucci notify posts to the generic webhook when a tf-apply wave waits, is refused or fails. The schema changes only when a field is removed or changes meaning; new fields can appear without a bump.",
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", "sent_at", "project", "wave", "roots"],
7
+ "required": ["schema", "id", "event", "at", "source", "project", "summary", "targets"],
8
8
  "properties": {
9
- "schema": { "const": "terragucci.notify/v1" },
10
- "id": { "type": "string", "description": "sha256 hex over the project, the wave, the event and the set digest (the commit when there is none): the same for every post of one wave's event about one digest." },
11
- "event": { "enum": ["waiting", "refused", "failed"] },
12
- "sent_at": { "type": "string", "description": "When the job posted it, ISO 8601." },
13
- "project": { "type": "string", "description": "<host>/<path> of the repo." },
14
- "forge": { "enum": ["github", "gitlab", "forgejo"] },
15
- "repo": { "type": "string", "description": "owner/name on GitHub and Forgejo, the project path on GitLab." },
16
- "sha": { "type": "string", "description": "The commit the wave applied." },
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
- "description": "terragucci.outcome/v1, as stage tf-apply wrote it to TG_OUTCOME_JSON.",
28
- "required": ["schema", "status", "exit", "wave", "roots"],
18
+ "required": ["number"],
29
19
  "properties": {
30
- "schema": { "const": "terragucci.outcome/v1" },
31
- "status": { "enum": ["applied", "waiting", "refused", "failed"] },
32
- "exit": { "type": "integer" },
33
- "wave": { "type": "integer" },
34
- "roots": { "type": "array", "items": { "type": "string" } },
35
- "line": { "type": "string" },
36
- "set_digest": { "type": "string" },
37
- "gate": {
38
- "type": "object",
39
- "required": ["name", "branch", "path"],
40
- "properties": { "name": { "type": "string" }, "branch": { "type": "string" }, "path": { "type": "string" } }
41
- },
42
- "approval": { "enum": ["not-requested", "waiting", "approved", "not-required"] },
43
- "approval_mode": { "enum": ["ledger", "pr-review", "sealed"] },
44
- "approve_command": { "type": "string" },
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
- "required": ["pull_request", "url"],
49
- "properties": { "pull_request": { "type": "integer" }, "url": { "type": "string" } }
50
- },
51
- "refused": {
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
  }
@@ -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-destroy or never." },
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." },