@intentius/sql-yodeler 0.7.0 → 0.9.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.
Files changed (73) hide show
  1. package/README.md +10 -2
  2. package/dist/apply-steps/index.d.ts +73 -21
  3. package/dist/apply-steps/index.js +171 -49
  4. package/dist/apply-steps/index.js.map +1 -1
  5. package/dist/ci/render.d.ts +11 -2
  6. package/dist/ci/render.js +21 -6
  7. package/dist/ci/render.js.map +1 -1
  8. package/dist/cli.js +1 -1
  9. package/dist/cli.js.map +1 -1
  10. package/dist/commands/apply.js +173 -64
  11. package/dist/commands/apply.js.map +1 -1
  12. package/dist/commands/drift.js +8 -8
  13. package/dist/commands/drift.js.map +1 -1
  14. package/dist/commands/lint.js +10 -7
  15. package/dist/commands/lint.js.map +1 -1
  16. package/dist/commands/override.js +46 -22
  17. package/dist/commands/override.js.map +1 -1
  18. package/dist/commands/plan.js +19 -19
  19. package/dist/commands/plan.js.map +1 -1
  20. package/dist/commands/revert.js +3 -2
  21. package/dist/commands/revert.js.map +1 -1
  22. package/dist/config/define.d.ts +12 -7
  23. package/dist/config/define.js.map +1 -1
  24. package/dist/lint/check.d.ts +3 -0
  25. package/dist/lint/check.js +3 -2
  26. package/dist/lint/check.js.map +1 -1
  27. package/dist/lint/policies.d.ts +22 -0
  28. package/dist/lint/policies.js +47 -0
  29. package/dist/lint/policies.js.map +1 -0
  30. package/dist/lint/schema-checks.d.ts +14 -3
  31. package/dist/lint/schema-checks.js +11 -5
  32. package/dist/lint/schema-checks.js.map +1 -1
  33. package/dist/mcp/tools.d.ts +1 -1
  34. package/dist/mcp/tools.js +6 -4
  35. package/dist/mcp/tools.js.map +1 -1
  36. package/dist/notify/index.d.ts +30 -97
  37. package/dist/notify/index.js +50 -154
  38. package/dist/notify/index.js.map +1 -1
  39. package/dist/notify/verify.d.ts +17 -31
  40. package/dist/notify/verify.js +16 -47
  41. package/dist/notify/verify.js.map +1 -1
  42. package/dist/pr/forge.d.ts +33 -38
  43. package/dist/pr/forge.js +74 -97
  44. package/dist/pr/forge.js.map +1 -1
  45. package/dist/pr/issue.d.ts +16 -33
  46. package/dist/pr/issue.js +17 -88
  47. package/dist/pr/issue.js.map +1 -1
  48. package/dist/pr/model.js +7 -2
  49. package/dist/pr/model.js.map +1 -1
  50. package/dist/pr/render.js +2 -2
  51. package/dist/pr/render.js.map +1 -1
  52. package/dist/release/index.d.ts +63 -0
  53. package/dist/release/index.js +122 -0
  54. package/dist/release/index.js.map +1 -0
  55. package/dist/report/audit.d.ts +18 -19
  56. package/dist/report/audit.js +57 -27
  57. package/dist/report/audit.js.map +1 -1
  58. package/dist/report/model.js +18 -5
  59. package/dist/report/model.js.map +1 -1
  60. package/dist/tenants/wave.d.ts +6 -2
  61. package/dist/tenants/wave.js +1 -3
  62. package/dist/tenants/wave.js.map +1 -1
  63. package/dist/versioned/policy.d.ts +44 -24
  64. package/dist/versioned/policy.js +70 -37
  65. package/dist/versioned/policy.js.map +1 -1
  66. package/dist/waves/index.d.ts +4 -10
  67. package/dist/waves/index.js +8 -33
  68. package/dist/waves/index.js.map +1 -1
  69. package/package.json +19 -8
  70. package/schemas/event.schema.json +218 -26
  71. package/dist/pr/comment.d.ts +0 -32
  72. package/dist/pr/comment.js +0 -99
  73. package/dist/pr/comment.js.map +0 -1
@@ -1,37 +1,229 @@
1
1
  {
2
2
  "$schema": "https://json-schema.org/draft/2020-12/schema",
3
3
  "$id": "https://intentius.io/sql-yodeler/schemas/v1/event.schema.json",
4
- "title": "a yodel webhook event",
5
- "description": "Version 1. The body yodel apply, yodel plan and yodel drift post to the webhook yodel.config.ts notify names, signed with HMAC-SHA256 over '<x-yodel-timestamp>.<body>' in the x-yodel-signature header. Within a version, fields are only added; a receiver ignores fields it does not know.",
4
+ "title": "a yodel webhook event (chant.notify/v1)",
5
+ "description": "Version 1. The body yodel apply, yodel plan and yodel drift post to the webhook yodel.config.ts notify names: chant's chant.notify/v1 event (https://intentius.io/chant/schemas/notify/v1/notify.schema.json), with source sql-yodeler and the command that sent it in detail.command. Signed with HMAC-SHA256 over '<x-yodel-timestamp>.<body>' in the x-yodel-signature header. A field is only ever added within a version; a receiver ignores fields it does not know.",
6
6
  "type": "object",
7
- "additionalProperties": false,
8
- "required": ["version", "id", "event", "at", "environment", "command", "status", "summary", "migrations"],
7
+ "required": [
8
+ "schema",
9
+ "id",
10
+ "event",
11
+ "at",
12
+ "source",
13
+ "project",
14
+ "summary",
15
+ "targets",
16
+ "environment",
17
+ "detail"
18
+ ],
9
19
  "properties": {
10
- "version": { "const": 1 },
11
- "id": { "type": "string", "description": "Unique per event; also the x-yodel-delivery header." },
12
- "event": { "enum": ["waiting", "refused", "failed", "drift"] },
13
- "at": { "type": "string", "format": "date-time" },
14
- "environment": { "type": "string" },
15
- "command": { "enum": ["apply", "plan", "drift"] },
16
- "status": { "type": "string", "description": "The command's own word for the outcome: gated, refused, denied, failed, incomplete, drifted." },
17
- "summary": { "type": "string" },
18
- "migrations": { "type": "array", "items": { "type": "string" }, "description": "The pending migrations, for apply and plan." },
19
- "digest": { "type": "string", "description": "The plan digest the run computed." },
20
- "approve": { "type": "string", "description": "On waiting: the command that approves the plan." },
21
- "chantApprove": { "description": "chant's own command for the same approval (chant approve <op> <gate> --plan <digest>), for scripts; a person runs approve.", "type": "string" },
22
- "reason": { "type": "string" },
20
+ "schema": {
21
+ "const": "chant.notify/v1"
22
+ },
23
+ "id": {
24
+ "type": "string",
25
+ "minLength": 1,
26
+ "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."
27
+ },
28
+ "event": {
29
+ "enum": [
30
+ "waiting",
31
+ "refused",
32
+ "failed",
33
+ "drift"
34
+ ]
35
+ },
36
+ "at": {
37
+ "type": "string",
38
+ "description": "When it was sent, ISO 8601 UTC."
39
+ },
40
+ "source": {
41
+ "const": "sql-yodeler"
42
+ },
43
+ "project": {
44
+ "type": "string",
45
+ "description": "What the run belongs to: the repository, or a name the product gives."
46
+ },
47
+ "summary": {
48
+ "type": "string",
49
+ "description": "One line a person can read."
50
+ },
51
+ "wave": {
52
+ "type": "object",
53
+ "required": [
54
+ "number"
55
+ ],
56
+ "properties": {
57
+ "number": {
58
+ "type": "integer",
59
+ "minimum": 1
60
+ },
61
+ "name": {
62
+ "type": "string"
63
+ },
64
+ "gate": {
65
+ "type": "string",
66
+ "description": "The gate the wave waits on."
67
+ }
68
+ }
69
+ },
70
+ "environment": {
71
+ "type": "string",
72
+ "description": "The environment the run is for."
73
+ },
74
+ "targets": {
75
+ "type": "array",
76
+ "items": {
77
+ "type": "string"
78
+ },
79
+ "description": "The migrations concerned: the pending ones for apply and plan; empty for drift."
80
+ },
81
+ "digest": {
82
+ "type": "string",
83
+ "description": "The plan digest an approval binds."
84
+ },
85
+ "approve": {
86
+ "type": "object",
87
+ "description": "On waiting: how a person approves it.",
88
+ "required": [
89
+ "command"
90
+ ],
91
+ "properties": {
92
+ "command": {
93
+ "type": "string",
94
+ "description": "The command to run, as the product prints it."
95
+ },
96
+ "chant": {
97
+ "type": "string",
98
+ "description": "chant's own command for the same approval, when the product's differs."
99
+ },
100
+ "review": {
101
+ "type": "object",
102
+ "description": "Under pr-review: the pull request whose approving review would approve it.",
103
+ "required": [
104
+ "pr",
105
+ "url"
106
+ ],
107
+ "properties": {
108
+ "pr": {
109
+ "type": "integer"
110
+ },
111
+ "url": {
112
+ "type": "string"
113
+ }
114
+ }
115
+ }
116
+ }
117
+ },
118
+ "status": {
119
+ "type": "string",
120
+ "description": "The command's own word for the outcome: gated, refused, denied, failed, incomplete, drifted."
121
+ },
122
+ "reason": {
123
+ "type": "string",
124
+ "description": "On refused and failed: why."
125
+ },
126
+ "exitCode": {
127
+ "type": "integer"
128
+ },
23
129
  "drift": {
24
130
  "type": "object",
25
- "additionalProperties": false,
26
- "required": ["changed", "missing"],
131
+ "required": [
132
+ "changed"
133
+ ],
27
134
  "properties": {
28
- "changed": { "type": "array", "items": { "type": "string" } },
29
- "missing": { "type": "array", "items": { "type": "string" } },
30
- "fingerprint": { "type": "string", "description": "The same drift has the same fingerprint run after run, so a receiver can tell a repeat from new drift." }
135
+ "changed": {
136
+ "type": "array",
137
+ "items": {
138
+ "type": "string"
139
+ }
140
+ },
141
+ "missing": {
142
+ "type": "array",
143
+ "items": {
144
+ "type": "string"
145
+ }
146
+ },
147
+ "failed": {
148
+ "type": "array",
149
+ "items": {
150
+ "type": "string"
151
+ },
152
+ "description": "What could not be checked."
153
+ },
154
+ "fingerprint": {
155
+ "type": "string",
156
+ "description": "The same drift has the same fingerprint, run after run."
157
+ }
31
158
  }
32
159
  },
33
- "runUrl": { "type": "string" },
34
- "repository": { "type": "string" },
35
- "commit": { "type": "string" }
36
- }
160
+ "run": {
161
+ "type": "object",
162
+ "properties": {
163
+ "url": {
164
+ "type": "string",
165
+ "description": "The CI run's page (GitHub, Forgejo) or job's page (GitLab)."
166
+ },
167
+ "forge": {
168
+ "enum": [
169
+ "github",
170
+ "gitlab",
171
+ "forgejo"
172
+ ]
173
+ },
174
+ "repository": {
175
+ "type": "string"
176
+ },
177
+ "commit": {
178
+ "type": "string"
179
+ },
180
+ "pr": {
181
+ "type": "integer"
182
+ }
183
+ }
184
+ },
185
+ "reportUrl": {
186
+ "type": "string"
187
+ },
188
+ "detail": {
189
+ "type": "object",
190
+ "required": [
191
+ "command"
192
+ ],
193
+ "properties": {
194
+ "command": {
195
+ "enum": [
196
+ "apply",
197
+ "plan",
198
+ "drift"
199
+ ],
200
+ "description": "The yodel command that sent it."
201
+ }
202
+ }
203
+ }
204
+ },
205
+ "allOf": [
206
+ {
207
+ "if": {
208
+ "required": [
209
+ "event"
210
+ ],
211
+ "properties": {
212
+ "event": {
213
+ "const": "drift"
214
+ }
215
+ }
216
+ },
217
+ "then": {
218
+ "required": [
219
+ "drift"
220
+ ],
221
+ "properties": {
222
+ "drift": {
223
+ "type": "object"
224
+ }
225
+ }
226
+ }
227
+ }
228
+ ]
37
229
  }
@@ -1,32 +0,0 @@
1
- /**
2
- * One comment per environment on the pull request: found by its marker and
3
- * updated, else created. The three forges' REST APIs:
4
- *
5
- * GitHub GET/POST {api}/repos/{owner}/{repo}/issues/{n}/comments
6
- * PATCH {api}/repos/{owner}/{repo}/issues/comments/{id}
7
- * GitLab GET/POST {api}/projects/{id}/merge_requests/{iid}/notes
8
- * PUT {api}/projects/{id}/merge_requests/{iid}/notes/{note_id}
9
- * Forgejo GET/POST {api}/repos/{owner}/{repo}/issues/{n}/comments (Gitea's API, /api/v1)
10
- * PATCH {api}/repos/{owner}/{repo}/issues/comments/{id}
11
- */
12
- import type { ForgeTarget } from "./forge.js";
13
- export interface ForgeComment {
14
- id: number;
15
- body: string;
16
- url?: string | undefined;
17
- }
18
- export interface CommentClient {
19
- list(): Promise<ForgeComment[]>;
20
- create(body: string): Promise<ForgeComment>;
21
- update(id: number, body: string): Promise<ForgeComment>;
22
- }
23
- type Fetch = typeof fetch;
24
- export declare function commentClient(t: ForgeTarget, f?: Fetch): CommentClient;
25
- /** The comment carrying `marker`, the newest when several do. */
26
- export declare function findComment(c: CommentClient, marker: string): Promise<ForgeComment | undefined>;
27
- /** Updates the comment carrying `marker`, or creates one. */
28
- export declare function upsertComment(c: CommentClient, marker: string, body: string, existing?: ForgeComment): Promise<{
29
- action: "created" | "updated" | "unchanged";
30
- comment: ForgeComment;
31
- }>;
32
- export {};
@@ -1,99 +0,0 @@
1
- /**
2
- * One comment per environment on the pull request: found by its marker and
3
- * updated, else created. The three forges' REST APIs:
4
- *
5
- * GitHub GET/POST {api}/repos/{owner}/{repo}/issues/{n}/comments
6
- * PATCH {api}/repos/{owner}/{repo}/issues/comments/{id}
7
- * GitLab GET/POST {api}/projects/{id}/merge_requests/{iid}/notes
8
- * PUT {api}/projects/{id}/merge_requests/{iid}/notes/{note_id}
9
- * Forgejo GET/POST {api}/repos/{owner}/{repo}/issues/{n}/comments (Gitea's API, /api/v1)
10
- * PATCH {api}/repos/{owner}/{repo}/issues/comments/{id}
11
- */
12
- import { YodelError } from "../project.js";
13
- const PAGE = 100;
14
- const MAX_PAGES = 50;
15
- function client(t, f, shape) {
16
- const call = async (method, url, body) => {
17
- let res;
18
- try {
19
- res = await f(url, { method, headers: { ...shape.headers, ...(body ? { "Content-Type": "application/json" } : {}) }, ...(body ? { body: JSON.stringify(body) } : {}) });
20
- }
21
- catch (e) {
22
- throw new YodelError(`${t.forge}: ${method} ${url} failed: ${e instanceof Error ? e.message : String(e)}`);
23
- }
24
- const text = await res.text();
25
- if (!res.ok)
26
- throw new YodelError(`${t.forge}: ${method} ${url} answered ${String(res.status)}: ${text.slice(0, 300).replaceAll(t.token, "[token]")}`);
27
- return text ? JSON.parse(text) : {};
28
- };
29
- const toComment = (c) => ({ id: Number(c.id), body: typeof c.body === "string" ? c.body : "", url: shape.webUrl?.(c) ?? (typeof c.html_url === "string" ? c.html_url : undefined) });
30
- return {
31
- async list() {
32
- const all = [];
33
- for (let page = 1; page <= MAX_PAGES; page++) {
34
- const got = (await call("GET", shape.list(page)));
35
- if (!Array.isArray(got))
36
- throw new YodelError(`${t.forge}: listing comments did not return a list`);
37
- all.push(...got.filter((c) => shape.keep?.(c) ?? true).map(toComment));
38
- if (got.length < PAGE)
39
- break;
40
- }
41
- return all;
42
- },
43
- async create(body) {
44
- return toComment((await call("POST", shape.create, { body })));
45
- },
46
- async update(id, body) {
47
- return toComment((await call(shape.updateMethod, shape.update(id), { body })));
48
- },
49
- };
50
- }
51
- const repoPath = (repo) => repo.split("/").map(encodeURIComponent).join("/");
52
- export function commentClient(t, f = fetch) {
53
- if (t.forge === "gitlab") {
54
- const base = `${t.apiUrl}/projects/${encodeURIComponent(t.repo)}/merge_requests/${String(t.pr)}/notes`;
55
- return client(t, f, {
56
- headers: { "PRIVATE-TOKEN": t.token, Accept: "application/json" },
57
- list: (page) => `${base}?per_page=${String(PAGE)}&page=${String(page)}&sort=asc&order_by=created_at`,
58
- create: base,
59
- update: (id) => `${base}/${String(id)}`,
60
- updateMethod: "PUT",
61
- // System notes ("added 1 commit") are the forge's own, never ours.
62
- keep: (c) => c.system !== true,
63
- });
64
- }
65
- if (t.forge === "forgejo") {
66
- const base = `${t.apiUrl}/repos/${repoPath(t.repo)}/issues`;
67
- return client(t, f, {
68
- headers: { Authorization: `token ${t.token}`, Accept: "application/json" },
69
- list: (page) => `${base}/${String(t.pr)}/comments?limit=${String(PAGE)}&page=${String(page)}`,
70
- create: `${base}/${String(t.pr)}/comments`,
71
- update: (id) => `${base}/comments/${String(id)}`,
72
- updateMethod: "PATCH",
73
- });
74
- }
75
- const base = `${t.apiUrl}/repos/${repoPath(t.repo)}/issues`;
76
- return client(t, f, {
77
- headers: { Authorization: `Bearer ${t.token}`, Accept: "application/vnd.github+json", "X-GitHub-Api-Version": "2022-11-28" },
78
- list: (page) => `${base}/${String(t.pr)}/comments?per_page=${String(PAGE)}&page=${String(page)}`,
79
- create: `${base}/${String(t.pr)}/comments`,
80
- update: (id) => `${base}/comments/${String(id)}`,
81
- updateMethod: "PATCH",
82
- });
83
- }
84
- /** The comment carrying `marker`, the newest when several do. */
85
- export async function findComment(c, marker) {
86
- return (await c.list()).filter((x) => x.body.includes(marker)).at(-1);
87
- }
88
- /** Updates the comment carrying `marker`, or creates one. */
89
- export async function upsertComment(c, marker, body, existing) {
90
- if (!body.includes(marker))
91
- throw new YodelError("the comment body has no marker; it could never be found again to update");
92
- const found = existing ?? (await findComment(c, marker));
93
- if (!found)
94
- return { action: "created", comment: await c.create(body) };
95
- if (found.body === body)
96
- return { action: "unchanged", comment: found };
97
- return { action: "updated", comment: await c.update(found.id, body) };
98
- }
99
- //# sourceMappingURL=comment.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"comment.js","sourceRoot":"","sources":["../../src/pr/comment.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAwB3C,MAAM,IAAI,GAAG,GAAG,CAAC;AACjB,MA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