@substrat-run/cli 0.44.0 → 0.46.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.
- package/dist/bump.d.ts +120 -0
- package/dist/bump.d.ts.map +1 -0
- package/dist/bump.js +780 -0
- package/dist/bump.js.map +1 -0
- package/dist/changeset.d.ts +129 -0
- package/dist/changeset.d.ts.map +1 -0
- package/dist/changeset.js +336 -0
- package/dist/changeset.js.map +1 -0
- package/dist/cli.js +193 -41
- package/dist/cli.js.map +1 -1
- package/dist/concept.d.ts +19 -0
- package/dist/concept.d.ts.map +1 -0
- package/dist/concept.js +25 -0
- package/dist/concept.js.map +1 -0
- package/dist/data-loss-check.d.ts +70 -0
- package/dist/data-loss-check.d.ts.map +1 -0
- package/dist/data-loss-check.js +260 -0
- package/dist/data-loss-check.js.map +1 -0
- package/dist/data-loss-replay-child.d.ts +27 -0
- package/dist/data-loss-replay-child.d.ts.map +1 -0
- package/dist/data-loss-replay-child.js +71 -0
- package/dist/data-loss-replay-child.js.map +1 -0
- package/dist/promote.d.ts +16 -1
- package/dist/promote.d.ts.map +1 -1
- package/dist/promote.js +87 -11
- package/dist/promote.js.map +1 -1
- package/dist/push.d.ts +32 -6
- package/dist/push.d.ts.map +1 -1
- package/dist/push.js +94 -32
- package/dist/push.js.map +1 -1
- package/dist/scope.d.ts +23 -2
- package/dist/scope.d.ts.map +1 -1
- package/dist/scope.js +63 -7
- package/dist/scope.js.map +1 -1
- package/dist/store-driver.d.ts +59 -0
- package/dist/store-driver.d.ts.map +1 -0
- package/dist/{store-kind.js → store-driver.js} +58 -22
- package/dist/store-driver.js.map +1 -0
- package/package.json +4 -4
- package/dist/store-kind.d.ts +0 -46
- package/dist/store-kind.d.ts.map +0 -1
- package/dist/store-kind.js.map +0 -1
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export interface ReplayRequest {
|
|
2
|
+
readonly kernelUrl: string;
|
|
3
|
+
readonly modules: readonly unknown[];
|
|
4
|
+
readonly spineDdl?: string;
|
|
5
|
+
/** Wall-clock limit for the whole replay, after which the child kills itself — a backstop. */
|
|
6
|
+
readonly deadlineMs: number;
|
|
7
|
+
}
|
|
8
|
+
/** How often the watchdog looks at its parent. */
|
|
9
|
+
export declare const WATCHDOG_POLL_MS = 200;
|
|
10
|
+
/** Each stdout line, in order: zero or more `started`, then one `done`. */
|
|
11
|
+
export type ChildMessage = {
|
|
12
|
+
readonly type: 'started';
|
|
13
|
+
readonly key: string;
|
|
14
|
+
readonly authored: boolean;
|
|
15
|
+
} | {
|
|
16
|
+
readonly type: 'done';
|
|
17
|
+
readonly result: {
|
|
18
|
+
readonly kind: 'outcome';
|
|
19
|
+
readonly outcome: unknown;
|
|
20
|
+
} | {
|
|
21
|
+
readonly kind: 'no-sqlite';
|
|
22
|
+
} | {
|
|
23
|
+
readonly kind: 'error';
|
|
24
|
+
readonly message: string;
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
//# sourceMappingURL=data-loss-replay-child.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"data-loss-replay-child.d.ts","sourceRoot":"","sources":["../src/data-loss-replay-child.ts"],"names":[],"mappings":"AAwBA,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,OAAO,EAAE,SAAS,OAAO,EAAE,CAAC;IACrC,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAC3B,8FAA8F;IAC9F,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;CAC7B;AAED,kDAAkD;AAClD,eAAO,MAAM,gBAAgB,MAAM,CAAC;AAepC,2EAA2E;AAC3E,MAAM,MAAM,YAAY,GACpB;IAAE,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAC;IAAC,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAA;CAAE,GAC9E;IACE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,MAAM,EACX;QAAE,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAC;QAAC,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAA;KAAE,GACvD;QAAE,QAAQ,CAAC,IAAI,EAAE,WAAW,CAAA;KAAE,GAC9B;QAAE,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;QAAC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC;CAC1D,CAAC"}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The data-loss replay's own process (#2321): what `checkMigrationDataLoss` runs the vertical's
|
|
3
|
+
* migrations in, so a runaway one can be stopped. A SQLite statement runs in native code that no
|
|
4
|
+
* JavaScript timer and no `worker.terminate()` can interrupt, and this Node's `node:sqlite` has no
|
|
5
|
+
* progress handler; a process can always be killed. See `replayInChild` for the parent's half.
|
|
6
|
+
*
|
|
7
|
+
* Reads one request as JSON on stdin — the vertical's kernel URL, its modules as data, the spine
|
|
8
|
+
* DDL — and writes one JSON line per message to stdout, synchronously, so the line naming the
|
|
9
|
+
* migration about to run is out before that migration can block the process. Started with an empty
|
|
10
|
+
* environment, in the temp directory, against an in-memory database.
|
|
11
|
+
*
|
|
12
|
+
* It must not outlive the push that started it, however that push ends. The parent kills it on a
|
|
13
|
+
* timeout, but a parent killed by a signal runs no handler at all, and an orphaned replay blocked
|
|
14
|
+
* in a SQLite step would spin forever. So the child carries a watchdog of
|
|
15
|
+
* its own: a worker thread — which a blocked main thread cannot starve — that kills this process
|
|
16
|
+
* when its parent is gone (the parent pid changes as the OS re-parents it) or the request's hard
|
|
17
|
+
* deadline passes. Covered: the parent exiting, crashing, or being killed by any signal, SIGKILL
|
|
18
|
+
* included, within the watchdog's poll interval. Not covered: a parent that is alive but stopped
|
|
19
|
+
* (SIGSTOP) — the replay then runs until the deadline — and, because the parent check relies on
|
|
20
|
+
* POSIX re-parenting an orphan, Windows, where only the deadline stops an orphaned replay.
|
|
21
|
+
*/
|
|
22
|
+
import { writeSync } from 'node:fs';
|
|
23
|
+
import { Worker } from 'node:worker_threads';
|
|
24
|
+
/** How often the watchdog looks at its parent. */
|
|
25
|
+
export const WATCHDOG_POLL_MS = 200;
|
|
26
|
+
/** Kill this process when the parent that started it is gone, or `deadlineMs` has passed. */
|
|
27
|
+
function watchdog(deadlineMs) {
|
|
28
|
+
const worker = new Worker(`const { workerData: { parent, until, every } } = require('node:worker_threads');
|
|
29
|
+
setInterval(() => {
|
|
30
|
+
if (process.ppid !== parent || Date.now() > until) process.kill(process.pid, 'SIGKILL');
|
|
31
|
+
}, every);`, { eval: true, workerData: { parent: process.ppid, until: Date.now() + deadlineMs, every: WATCHDOG_POLL_MS } });
|
|
32
|
+
// The watchdog never keeps a finished replay alive.
|
|
33
|
+
worker.unref();
|
|
34
|
+
}
|
|
35
|
+
const send = (message) => {
|
|
36
|
+
writeSync(1, `${JSON.stringify(message)}\n`);
|
|
37
|
+
};
|
|
38
|
+
async function main() {
|
|
39
|
+
const chunks = [];
|
|
40
|
+
for await (const chunk of process.stdin)
|
|
41
|
+
chunks.push(chunk);
|
|
42
|
+
const request = JSON.parse(Buffer.concat(chunks).toString('utf8'));
|
|
43
|
+
watchdog(request.deadlineMs);
|
|
44
|
+
let open;
|
|
45
|
+
try {
|
|
46
|
+
const { DatabaseSync } = (await import('node:sqlite'));
|
|
47
|
+
open = () => new DatabaseSync(':memory:');
|
|
48
|
+
}
|
|
49
|
+
catch {
|
|
50
|
+
send({ type: 'done', result: { kind: 'no-sqlite' } });
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
try {
|
|
54
|
+
const kernel = (await import(request.kernelUrl));
|
|
55
|
+
const db = open();
|
|
56
|
+
const outcome = kernel.replayMigrations({
|
|
57
|
+
exec: (q) => db.exec(q),
|
|
58
|
+
query: (q, p = []) => db.prepare(q).all(...p),
|
|
59
|
+
run: (q, p = []) => ({ changes: Number(db.prepare(q).run(...p).changes) }),
|
|
60
|
+
}, request.modules, {
|
|
61
|
+
spineDdl: request.spineDdl,
|
|
62
|
+
onMigration: (key, authored) => send({ type: 'started', key, authored }),
|
|
63
|
+
});
|
|
64
|
+
send({ type: 'done', result: { kind: 'outcome', outcome } });
|
|
65
|
+
}
|
|
66
|
+
catch (e) {
|
|
67
|
+
send({ type: 'done', result: { kind: 'error', message: e instanceof Error ? e.message : String(e) } });
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
await main();
|
|
71
|
+
//# sourceMappingURL=data-loss-replay-child.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"data-loss-replay-child.js","sourceRoot":"","sources":["../src/data-loss-replay-child.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AACpC,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAU7C,kDAAkD;AAClD,MAAM,CAAC,MAAM,gBAAgB,GAAG,GAAG,CAAC;AAEpC,6FAA6F;AAC7F,SAAS,QAAQ,CAAC,UAAkB;IAClC,MAAM,MAAM,GAAG,IAAI,MAAM,CACvB;;;gBAGY,EACZ,EAAE,IAAI,EAAE,IAAI,EAAE,UAAU,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,IAAI,EAAE,KAAK,EAAE,IAAI,CAAC,GAAG,EAAE,GAAG,UAAU,EAAE,KAAK,EAAE,gBAAgB,EAAE,EAAE,CAC9G,CAAC;IACF,oDAAoD;IACpD,MAAM,CAAC,KAAK,EAAE,CAAC;AACjB,CAAC;AAaD,MAAM,IAAI,GAAG,CAAC,OAAqB,EAAQ,EAAE;IAC3C,SAAS,CAAC,CAAC,EAAE,GAAG,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;AAC/C,CAAC,CAAC;AAOF,KAAK,UAAU,IAAI;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AO,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC;SACvG,EACD,OAAO,CAAC,OAAO,EACf;YACE,QAAQ,EAAE,OAAO,CAAC,QAAQ;YAC1B,WAAW,EAAE,CAAC,GAAW,EAAE,QAAiB,EAAE,EAAE,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,GAAG,EAAE,QAAQ,EAAE,CAAC;SAC1F,CACF,CAAC;QACF,IAAI,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,EAAE,CAAC,CAAC;IAC/D,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACX,IAAI,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,CAAC,YAAY,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;IACzG,CAAC;AACH,CAAC;AAED,MAAM,IAAI,EAAE,CAAC"}
|
package/dist/promote.d.ts
CHANGED
|
@@ -12,9 +12,14 @@
|
|
|
12
12
|
* #1705 PR 3: a promote that drops or re-versions an exported event an installed app imports
|
|
13
13
|
* is refused too (409), and the refusal lists the apps it would break: the caller's own tenant's
|
|
14
14
|
* by name, any other tenant only as a count. `--ack-export-break` passes it once that is read.
|
|
15
|
+
*
|
|
16
|
+
* #2333: an acknowledgement answers ONE review — the diffs printed against the version prod served
|
|
17
|
+
* when they were read. Every refusal that prints them also prints the `--review` token they were
|
|
18
|
+
* read with, and the control plane refuses a token whose base or stored rows have moved since
|
|
19
|
+
* (and a `--ack-migrations` sent with none), so a person never acknowledges a diff they were not shown.
|
|
15
20
|
*/
|
|
16
21
|
import { type MigrationDiff, type PermissionRegistry } from '@substrat-run/contracts';
|
|
17
|
-
import { type ExportBreaks, type MintedStore, type PromoteResult } from '@substrat-run/control-plane-client';
|
|
22
|
+
import { type ExportBreaks, type MintedStore, type PromoteResult, type PromoteReviewBinding } from '@substrat-run/control-plane-client';
|
|
18
23
|
export interface PromoteOptions {
|
|
19
24
|
controlPlaneUrl: string;
|
|
20
25
|
header: Record<string, string>;
|
|
@@ -25,8 +30,13 @@ export interface PromoteOptions {
|
|
|
25
30
|
permissionChange?: boolean;
|
|
26
31
|
migrationChange?: boolean;
|
|
27
32
|
exportBreak?: boolean;
|
|
33
|
+
review?: PromoteReviewBinding;
|
|
28
34
|
};
|
|
29
35
|
}
|
|
36
|
+
/** How a review binding is written on the command line: `<base>:<digest>`, `-` for no base. */
|
|
37
|
+
export declare function reviewToken(review: PromoteReviewBinding): string;
|
|
38
|
+
/** `reviewToken` read back, or null when it is not one. The digest is hex, so the last `:` splits it. */
|
|
39
|
+
export declare function parseReviewToken(token: string): PromoteReviewBinding | null;
|
|
30
40
|
/** The listing a refused (or acknowledged) export break carries, one line per affected app. */
|
|
31
41
|
export declare function exportBreakLines(b: ExportBreaks): string[];
|
|
32
42
|
/** The listing a refusal prints, and how to answer it once it has been read. */
|
|
@@ -53,6 +63,11 @@ export declare function explainRefusal(opts: PromoteOptions, refused: {
|
|
|
53
63
|
* "none" is never the answer, because the gate has just said there is a change.
|
|
54
64
|
*/
|
|
55
65
|
export declare function formatRegistryDiff(from: PermissionRegistry | null, to: PermissionRegistry | null, digestMoved: boolean): string[];
|
|
66
|
+
/**
|
|
67
|
+
* A module id or migration version on the listing's header line: bare when it is a plain id, as
|
|
68
|
+
* every id the push boundary admits is, and `quoted` otherwise, so nothing in it can break the line.
|
|
69
|
+
*/
|
|
70
|
+
export declare const idOf: (text: string) => string;
|
|
56
71
|
/**
|
|
57
72
|
* The migrations a promote adds, each with its SQL. `null` is a version whose manifest carries
|
|
58
73
|
* none. `digestMoved` is whether the gate refused on the migration digest.
|
package/dist/promote.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"promote.d.ts","sourceRoot":"","sources":["../src/promote.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"promote.d.ts","sourceRoot":"","sources":["../src/promote.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,OAAO,EAUL,KAAK,aAAa,EAElB,KAAK,kBAAkB,EACxB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAEL,KAAK,YAAY,EACjB,KAAK,WAAW,EAChB,KAAK,aAAa,EAClB,KAAK,oBAAoB,EAC1B,MAAM,oCAAoC,CAAC;AAI5C,MAAM,WAAW,cAAc;IAC7B,eAAe,EAAE,MAAM,CAAC;IACxB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE;QAAE,gBAAgB,CAAC,EAAE,OAAO,CAAC;QAAC,eAAe,CAAC,EAAE,OAAO,CAAC;QAAC,WAAW,CAAC,EAAE,OAAO,CAAC;QAAC,MAAM,CAAC,EAAE,oBAAoB,CAAA;KAAE,CAAC;CAC/H;AAED,+FAA+F;AAC/F,wBAAgB,WAAW,CAAC,MAAM,EAAE,oBAAoB,GAAG,MAAM,CAEhE;AAED,yGAAyG;AACzG,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,MAAM,GAAG,oBAAoB,GAAG,IAAI,CAM3E;AAED,+FAA+F;AAC/F,wBAAgB,gBAAgB,CAAC,CAAC,EAAE,YAAY,GAAG,MAAM,EAAE,CAQ1D;AAED,gFAAgF;AAChF,wBAAgB,kBAAkB,CAAC,CAAC,EAAE,YAAY,GAAG,MAAM,CAE1D;AAED,YAAY,EAAE,YAAY,EAAE,WAAW,EAAE,aAAa,EAAE,CAAC;AAEzD,wBAAsB,OAAO,CAAC,IAAI,EAAE,cAAc,GAAG,OAAO,CAAC,aAAa,CAAC,CAqC1E;AAOD;;;;;GAKG;AACH,wBAAsB,cAAc,CAClC,IAAI,EAAE,cAAc,EACpB,OAAO,EAAE;IAAE,UAAU,EAAE,OAAO,CAAC;IAAC,SAAS,EAAE,OAAO,CAAA;CAAE,GACnD,OAAO,CAAC,MAAM,EAAE,CAAC,CAmCnB;AAED;;;;;;;;GAQG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,kBAAkB,GAAG,IAAI,EAAE,EAAE,EAAE,kBAAkB,GAAG,IAAI,EAAE,WAAW,EAAE,OAAO,GAAG,MAAM,EAAE,CA0BjI;AAYD;;;GAGG;AACH,eAAO,MAAM,IAAI,SAAU,MAAM,KAAG,MAAqD,CAAC;AAwB1F;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,aAAa,GAAG,IAAI,EAAE,WAAW,EAAE,OAAO,GAAG,MAAM,EAAE,CA8C9F"}
|
package/dist/promote.js
CHANGED
|
@@ -12,11 +12,29 @@
|
|
|
12
12
|
* #1705 PR 3: a promote that drops or re-versions an exported event an installed app imports
|
|
13
13
|
* is refused too (409), and the refusal lists the apps it would break: the caller's own tenant's
|
|
14
14
|
* by name, any other tenant only as a count. `--ack-export-break` passes it once that is read.
|
|
15
|
+
*
|
|
16
|
+
* #2333: an acknowledgement answers ONE review — the diffs printed against the version prod served
|
|
17
|
+
* when they were read. Every refusal that prints them also prints the `--review` token they were
|
|
18
|
+
* read with, and the control plane refuses a token whose base or stored rows have moved since
|
|
19
|
+
* (and a `--ack-migrations` sent with none), so a person never acknowledges a diff they were not shown.
|
|
15
20
|
*/
|
|
16
|
-
import { diffRegistries, grantShapeHolderNotes, unitemisedRegistryChanges, } from '@substrat-run/contracts';
|
|
21
|
+
import { diffRegistries, grantShapeHolderNotes, promoteReviewReasonIn, clipReviewText, discardTally, reviewSql, reviewText, unitemisedRegistryChanges, } from '@substrat-run/contracts';
|
|
17
22
|
import { ControlPlaneError, } from '@substrat-run/control-plane-client';
|
|
18
23
|
import { planeFor, viaPlane, walkAll } from './plane.js';
|
|
19
24
|
import { failureMessage, readRefused } from './problem.js';
|
|
25
|
+
/** How a review binding is written on the command line: `<base>:<digest>`, `-` for no base. */
|
|
26
|
+
export function reviewToken(review) {
|
|
27
|
+
return `${review.base ?? '-'}:${review.digest}`;
|
|
28
|
+
}
|
|
29
|
+
/** `reviewToken` read back, or null when it is not one. The digest is hex, so the last `:` splits it. */
|
|
30
|
+
export function parseReviewToken(token) {
|
|
31
|
+
const at = token.lastIndexOf(':');
|
|
32
|
+
const base = token.slice(0, at);
|
|
33
|
+
const digest = token.slice(at + 1);
|
|
34
|
+
if (at <= 0 || !/^[0-9a-f]{64}$/.test(digest))
|
|
35
|
+
return null;
|
|
36
|
+
return { base: base === '-' ? null : base, digest };
|
|
37
|
+
}
|
|
20
38
|
/** The listing a refused (or acknowledged) export break carries, one line per affected app. */
|
|
21
39
|
export function exportBreakLines(b) {
|
|
22
40
|
const lines = b.affected.map((r) => ` ${r.vertical} (scope ${r.scopeId}) imports ${r.type} v${r.schemaVersion} — ` +
|
|
@@ -59,11 +77,14 @@ export async function promote(opts) {
|
|
|
59
77
|
? `\n (${parsed.exportBreaksUnavailable}; re-run with --ack-export-break to promote anyway)`
|
|
60
78
|
: '';
|
|
61
79
|
const message = failureMessage('promote failed', e.status, body);
|
|
62
|
-
|
|
80
|
+
// A review that moved under the acknowledgement, or a migration acknowledgement sent with none
|
|
81
|
+
// (#2333), is answered like a digest refusal: by the diffs as they stand now, and their token.
|
|
82
|
+
const review = promoteReviewReasonIn(parsed);
|
|
83
|
+
if (!message.includes(NEEDS_ACK) && review === undefined)
|
|
63
84
|
throw new Error(message + listing);
|
|
64
85
|
const lines = await explainRefusal(opts, {
|
|
65
86
|
permission: message.includes('changes the permission surface'),
|
|
66
|
-
migration: message.includes('changes migrations'),
|
|
87
|
+
migration: message.includes('changes migrations') || review === 'promote_review_unbound',
|
|
67
88
|
});
|
|
68
89
|
throw new Error(`${message}${listing}\n\n${lines.join('\n')}`);
|
|
69
90
|
}
|
|
@@ -89,21 +110,26 @@ export async function explainRefusal(opts, refused) {
|
|
|
89
110
|
if (!serving)
|
|
90
111
|
return ['(nothing serves this channel yet, so there is nothing to diff against)'];
|
|
91
112
|
const registry = (id) => get(() => client.getVersionRegistry(opts.slug, id)).then((r) => r.registry);
|
|
92
|
-
const [from, to,
|
|
113
|
+
const [from, to, read] = await Promise.all([
|
|
93
114
|
registry(serving),
|
|
94
115
|
registry(opts.versionId),
|
|
95
|
-
get(() => client.getVersionMigrations(opts.slug, opts.versionId, serving))
|
|
116
|
+
get(() => client.getVersionMigrations(opts.slug, opts.versionId, serving)),
|
|
96
117
|
]);
|
|
118
|
+
// The token is the one the migrations read answered beside the diff printed here, never one
|
|
119
|
+
// put together from separate reads: the two must describe the same review.
|
|
120
|
+
const token = read.review ? reviewToken(read.review) : null;
|
|
97
121
|
return [
|
|
98
|
-
`${opts.channel} serves ${serving}; promoting ${opts.versionId}.`,
|
|
122
|
+
`${opts.channel} serves ${idOf(serving)}; promoting ${idOf(opts.versionId)}.`,
|
|
99
123
|
'',
|
|
100
124
|
'permission changes:',
|
|
101
125
|
...formatRegistryDiff(from, to, refused.permission).map((l) => ` ${l}`),
|
|
102
126
|
'',
|
|
103
127
|
'migration changes:',
|
|
104
|
-
...formatMigrationDiff(migrations, refused.migration).map((l) => ` ${l}`),
|
|
128
|
+
...formatMigrationDiff(read.migrations, refused.migration).map((l) => ` ${l}`),
|
|
105
129
|
'',
|
|
106
|
-
|
|
130
|
+
token === null
|
|
131
|
+
? '(this control plane hands out no review token, so --review cannot be given)'
|
|
132
|
+
: `to acknowledge exactly what is shown above, re-run with the --ack-* flags it needs and --review ${idOf(token)}`,
|
|
107
133
|
];
|
|
108
134
|
}
|
|
109
135
|
catch (e) {
|
|
@@ -146,6 +172,40 @@ export function formatRegistryDiff(from, to, digestMoved) {
|
|
|
146
172
|
? ["the permission digest changed, but the two stored registries read the same here — compare them in the repository"]
|
|
147
173
|
: ['none'];
|
|
148
174
|
}
|
|
175
|
+
/**
|
|
176
|
+
* Pusher-supplied text on one terminal line (#2322): every control, format and bidi character
|
|
177
|
+
* made visible (`reviewText`), then quoted, which escapes the newlines and tabs it keeps. So no
|
|
178
|
+
* reason, table name or id prints as a terminal command, a reordered word or a forged line.
|
|
179
|
+
*/
|
|
180
|
+
const quoted = (text) => JSON.stringify(reviewText(text));
|
|
181
|
+
/** What an id may hold to print bare in the listing's one-line header. */
|
|
182
|
+
const PLAIN_ID = /^[A-Za-z0-9@/._~:+-]+$/;
|
|
183
|
+
/**
|
|
184
|
+
* A module id or migration version on the listing's header line: bare when it is a plain id, as
|
|
185
|
+
* every id the push boundary admits is, and `quoted` otherwise, so nothing in it can break the line.
|
|
186
|
+
*/
|
|
187
|
+
export const idOf = (text) => (PLAIN_ID.test(text) ? text : quoted(text));
|
|
188
|
+
/**
|
|
189
|
+
* A discard's reason as the listing shows it: quoted, and cut where the review cuts it
|
|
190
|
+
* (`clipReviewText`: 280 characters or 6 lines), saying where the rest is. A terminal has no
|
|
191
|
+
* expander, and the listing must stay readable down to the acknowledgement.
|
|
192
|
+
*/
|
|
193
|
+
function reasonOf(why) {
|
|
194
|
+
const { shown, clipped } = clipReviewText(why);
|
|
195
|
+
return clipped ? `${JSON.stringify(shown)}… (cut; the whole reason is in the dashboard's promote dialog and the migration's source)` : quoted(why);
|
|
196
|
+
}
|
|
197
|
+
/**
|
|
198
|
+
* What one migration declares it moves and discards (#2322), one line each under its id.
|
|
199
|
+
* Every target and reason is the pusher's text, so each goes through `quoted`.
|
|
200
|
+
*/
|
|
201
|
+
function declarationLines(m) {
|
|
202
|
+
if (m.declarationsLeftOut)
|
|
203
|
+
return [' (declares moves or discards, left out: past the size bound of this answer; read them in the repository)'];
|
|
204
|
+
return [
|
|
205
|
+
...Object.entries(m.discards ?? {}).map(([target, why]) => ` discards ${quoted(target)}: ${reasonOf(why)}`),
|
|
206
|
+
...Object.entries(m.moves ?? {}).map(([from, to]) => ` moves ${quoted(from)} → ${quoted(to)} (verified at apply)`),
|
|
207
|
+
];
|
|
208
|
+
}
|
|
149
209
|
/**
|
|
150
210
|
* The migrations a promote adds, each with its SQL. `null` is a version whose manifest carries
|
|
151
211
|
* none. `digestMoved` is whether the gate refused on the migration digest.
|
|
@@ -157,15 +217,31 @@ export function formatMigrationDiff(diff, digestMoved) {
|
|
|
157
217
|
'older than migrations in the manifest, or its migrations were over the size a manifest carries. Read them in the repository.',
|
|
158
218
|
];
|
|
159
219
|
}
|
|
220
|
+
// The id and the SQL are the pusher's text too. The header is one line, so the module and the
|
|
221
|
+
// version print bare only when they are plain ids and are quoted otherwise (`idOf`): a newline
|
|
222
|
+
// in either would forge another entry above the real one. The SQL is split into its lines after
|
|
223
|
+
// `reviewSql`, so a control or bidi character in it prints as `<U+XXXX>`, not as itself.
|
|
160
224
|
const entry = (mark, m) => [
|
|
161
|
-
`${mark} ${m.moduleId} ${m.version}`,
|
|
162
|
-
...(m
|
|
225
|
+
`${mark} ${idOf(m.moduleId)} ${idOf(m.version)}`,
|
|
226
|
+
...declarationLines(m),
|
|
227
|
+
...(m.sql === null ? [' (SQL left out: past the size bound of this answer)'] : reviewSql(m.sql).split('\n').map((l) => ` ${l}`)),
|
|
163
228
|
];
|
|
229
|
+
const discards = discardTally(diff);
|
|
164
230
|
const lines = [
|
|
231
|
+
...(discards.count > 0
|
|
232
|
+
? [
|
|
233
|
+
`! this promote deliberately discards data in ${discards.atLeast ? 'at least ' : ''}${discards.count} place${discards.count === 1 ? '' : 's'}; ` +
|
|
234
|
+
"each reason is the migration author's own",
|
|
235
|
+
]
|
|
236
|
+
: discards.atLeast
|
|
237
|
+
? ["! this list is cut, so it cannot show whether a migration left out of it discards data; read the rest in the repository"]
|
|
238
|
+
: []),
|
|
165
239
|
...(diff.baseline === 'unavailable'
|
|
166
240
|
? ['(the serving version predates carried migrations, so every migration this version ships is listed)']
|
|
167
241
|
: []),
|
|
168
|
-
...diff.changed.flatMap((m) => entry(
|
|
242
|
+
...diff.changed.flatMap((m) => entry(m.edited === 'declarations'
|
|
243
|
+
? '~ (declarations edited after shipping; a scope that already ran it is unaffected, one that has not is held to these)'
|
|
244
|
+
: '~ (edited after shipping; a scope that already ran it will not run it again)', m)),
|
|
169
245
|
...diff.added.flatMap((m) => entry('+', m)),
|
|
170
246
|
];
|
|
171
247
|
if (diff.total === 0) {
|
package/dist/promote.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"promote.js","sourceRoot":"","sources":["../src/promote.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"promote.js","sourceRoot":"","sources":["../src/promote.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,OAAO,EACL,cAAc,EACd,qBAAqB,EACrB,qBAAqB,EACrB,cAAc,EACd,YAAY,EACZ,SAAS,EACT,UAAU,EACV,yBAAyB,GAK1B,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,iBAAiB,GAKlB,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AACzD,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAW3D,+FAA+F;AAC/F,MAAM,UAAU,WAAW,CAAC,MAA4B;IACtD,OAAO,GAAG,MAAM,CAAC,IAAI,IAAI,GAAG,IAAI,MAAM,CAAC,MAAM,EAAE,CAAC;AAClD,CAAC;AAED,yGAAyG;AACzG,MAAM,UAAU,gBAAgB,CAAC,KAAa;IAC5C,MAAM,EAAE,GAAG,KAAK,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC;IAClC,MAAM,IAAI,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;IAChC,MAAM,MAAM,GAAG,KAAK,CAAC,KAAK,CAAC,EAAE,GAAG,CA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AG,CAAC,IAAI,CAAC,QAAQ,KAAK,aAAa;YACjC,CAAC,CAAC,CAAC,oGAAoG,CAAC;YACxG,CAAC,CAAC,EAAE,CAAC;QACP,GAAG,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,CAC5B,KAAK,CACH,CAAC,CAAC,MAAM,KAAK,cAAc;YACzB,CAAC,CAAC,sHAAsH;YACxH,CAAC,CAAC,8EAA8E,EAClF,CAAC,CACF,CACF;QACD,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC;KAC5C,CAAC;IACF,IAAI,IAAI,CAAC,KAAK,KAAK,CAAC,EAAE,CAAC;QACrB,sFAAsF;QACtF,gDAAgD;QAChD,KAAK,CAAC,IAAI,CAAC,mCAAmC,WAAW,CAAC,CAAC,CAAC,gDAAgD,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;IACvH,CAAC;IACD,IAAI,IAAI,CAAC,SAAS;QAAE,KAAK,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,IAAI,CAAC,OAAO,CAAC,MAAM,OAAO,IAAI,CAAC,KAAK,0CAA0C,CAAC,CAAC;IACvI,OAAO,KAAK,CAAC;AACf,CAAC"}
|
package/dist/push.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { type DeclaredMigration, type AssetEntry, type AssetsNeed, type DeclaredBinding, type DeclaredOperationOutput, type IngressModel, type EnvVarSpec, type PermissionRegistry, type PermissionsInput, type RuntimeNeeds, type VersionOrigin, type DeployManifest } from '@substrat-run/contracts';
|
|
2
|
+
import { type DataLossCheck, type ReplayInputs } from './data-loss-check.js';
|
|
2
3
|
import { type ScheduleRef } from './schedule-sweeper.js';
|
|
3
4
|
/**
|
|
4
5
|
* Derive the vertical's permission registry (D-39/D-41) from its declared TypeScript surface —
|
|
@@ -54,13 +55,16 @@ export type ModuleMigrationsFn = (registration: PermissionsInput['modules'][numb
|
|
|
54
55
|
* `migrations` beside the manifest.
|
|
55
56
|
*
|
|
56
57
|
* Through `moduleMigrations`, the kernel's own list, because a host also applies migrations
|
|
57
|
-
* nobody authored: the indexes a module's `searchables` and `lists` declare
|
|
58
|
-
* runs real schema SQL. Without the
|
|
59
|
-
*
|
|
60
|
-
*
|
|
58
|
+
* nobody authored: the indexes a module's `searchables` and `lists` declare, and the archive and
|
|
59
|
+
* trash columns its `entityStates` declare. Changing those runs real schema SQL. Without the
|
|
60
|
+
* function (a vertical on a kernel older than it, or none resolvable) a module declaring any of
|
|
61
|
+
* them cannot be carried completely, so the field is left off rather than carried short; one
|
|
62
|
+
* declaring none has only its authored set.
|
|
63
|
+
*
|
|
64
|
+
* Each migration's declared `moves` and `discards` (#2322) are carried beside its SQL.
|
|
61
65
|
*
|
|
62
66
|
* `migrations` is undefined (and `omitted` says why) when the set is over the manifest's caps,
|
|
63
|
-
*
|
|
67
|
+
* incomplete as above, or declares something the manifest cannot carry. The field is then left off, which the promote dialog reads as "SQL
|
|
64
68
|
* not available" and still asks for the acknowledgement: metadata must never fail a push.
|
|
65
69
|
* `digestMigrations` retains the complete SQL set even when the manifest omits it, so the
|
|
66
70
|
* promotion gate still sees a change. Without a kernel, `unresolvedIndexes` records the
|
|
@@ -74,8 +78,19 @@ export declare function flattenDeclaredMigrations(permissions: PermissionsInput,
|
|
|
74
78
|
moduleId: string;
|
|
75
79
|
searchables: unknown[];
|
|
76
80
|
lists: unknown[];
|
|
81
|
+
entityStates?: unknown[];
|
|
77
82
|
}[];
|
|
78
83
|
};
|
|
84
|
+
/**
|
|
85
|
+
* The promotion gate covers store classes and every SQL migration the host would apply, with
|
|
86
|
+
* what each declares (#2322): `migrationDigestOf`, the one function the control plane also
|
|
87
|
+
* derives the digest with (#2339). It re-derives it from the migrations this push carries and
|
|
88
|
+
* refuses the push when the two disagree, so it must hash exactly what is sent. The complete set
|
|
89
|
+
* is hashed even when the manifest leaves it out: the control plane then cannot check the digest,
|
|
90
|
+
* stores one that equals no other version's, and every promote of the version asks for the
|
|
91
|
+
* migration acknowledgement.
|
|
92
|
+
*/
|
|
93
|
+
export declare function migrationDigest(doClasses: string[], declared: ReturnType<typeof flattenDeclaredMigrations>): Promise<string>;
|
|
79
94
|
/**
|
|
80
95
|
* The manifest as it is sent: without `migrations` when carrying them would take the whole
|
|
81
96
|
* serialized manifest past {@link DEPLOY_MANIFEST_BYTES_SAFE} (#1677). The control plane keeps
|
|
@@ -112,6 +127,8 @@ export interface DeclaredSurface {
|
|
|
112
127
|
/** True when any module declares an attachment target (#1995): the push then declares the
|
|
113
128
|
* platform's attachment blob store itself — see `withAttachmentBlobStore`. */
|
|
114
129
|
readonly declaresAttachments: boolean;
|
|
130
|
+
/** What the data-loss check replays (#2321) — see `checkMigrationDataLoss`. */
|
|
131
|
+
readonly replay: ReplayInputs;
|
|
115
132
|
}
|
|
116
133
|
export declare function deriveDeclaredSurface(dir: string): Promise<DeclaredSurface>;
|
|
117
134
|
/** The declared permission surface alone — `deriveDeclaredSurface` for the callers that
|
|
@@ -169,7 +186,10 @@ export interface PermissionSurface {
|
|
|
169
186
|
* an entry that cannot be imported outside the vertical's runtime. The CLI's top-level handler
|
|
170
187
|
* turns each into a non-zero exit, which is what makes this usable as a gate.
|
|
171
188
|
*/
|
|
172
|
-
export declare function checkPermissionSurface(dir: string
|
|
189
|
+
export declare function checkPermissionSurface(dir: string, dataLoss?: {
|
|
190
|
+
readonly require?: boolean;
|
|
191
|
+
readonly log?: (message: string) => void;
|
|
192
|
+
}): Promise<PermissionSurface>;
|
|
173
193
|
/**
|
|
174
194
|
* Render a checked surface for a human reading CI output: every key with the module(s) that
|
|
175
195
|
* declare it and its description, every role with the keys it holds, every entity-grant shape,
|
|
@@ -447,6 +467,11 @@ export interface PushOptions {
|
|
|
447
467
|
* self-announcing way past it.
|
|
448
468
|
*/
|
|
449
469
|
skipLint?: boolean;
|
|
470
|
+
/**
|
|
471
|
+
* Refuse a push whose data-loss check (#2321) was skipped or incomplete — the CLI's
|
|
472
|
+
* --require-data-loss-check. A refusal by the fence itself refuses every push regardless.
|
|
473
|
+
*/
|
|
474
|
+
requireDataLossCheck?: boolean;
|
|
450
475
|
/**
|
|
451
476
|
* The receipt from a check the caller already ran on THIS directory (#955) — the CLI's
|
|
452
477
|
* pre-flight, which gates before the registry round-trip so a violation never costs a
|
|
@@ -529,6 +554,7 @@ export declare function push(opts: PushOptions): Promise<{
|
|
|
529
554
|
deploymentRef: string;
|
|
530
555
|
verticalSlug: string;
|
|
531
556
|
warnings?: string[];
|
|
557
|
+
dataLoss: DataLossCheck;
|
|
532
558
|
}>;
|
|
533
559
|
/**
|
|
534
560
|
* POST the assembled bundle to `/verticals/<slug>/deploy` and read the control plane's answer.
|
package/dist/push.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"push.d.ts","sourceRoot":"","sources":["../src/push.ts"],"names":[],"mappings":"AAOA,OAAO,
|
|
1
|
+
{"version":3,"file":"push.d.ts","sourceRoot":"","sources":["../src/push.ts"],"names":[],"mappings":"AAOA,OAAO,EAiBL,KAAK,iBAAiB,EAMtB,KAAK,UAAU,EACf,KAAK,UAAU,EACf,KAAK,eAAe,EACpB,KAAK,uBAAuB,EAC5B,KAAK,YAAY,EACjB,KAAK,UAAU,EACf,KAAK,kBAAkB,EACvB,KAAK,gBAAgB,EACrB,KAAK,YAAY,EACjB,KAAK,aAAa,EAClB,KAAK,cAAc,EAIpB,MAAM,yBAAyB,CAAC;AAUjC,OAAO,EAA0B,KAAK,aAAa,EAAE,KAAK,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAIrG,OAAO,EAIL,KAAK,WAAW,EACjB,MAAM,uBAAuB,CAAC;AAqC/B;;;;;;;;;;;;;;;;;;GAkBG;AACH;;;;GAIG;AACH,wBAAgB,wBAAwB,CACtC,WAAW,EAAE,gBAAgB,GA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