@intentius/sql-yodeler 0.10.0 → 0.11.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/README.md +4 -4
- package/dist/apply-steps/index.d.ts +2 -2
- package/dist/apply-steps/index.js +7 -7
- package/dist/apply-steps/index.js.map +1 -1
- package/dist/bin.js +8 -0
- package/dist/bin.js.map +1 -1
- package/dist/chant/apply.d.ts +0 -2
- package/dist/chant/apply.js +3 -4
- package/dist/chant/apply.js.map +1 -1
- package/dist/chant/build.js +3 -1
- package/dist/chant/build.js.map +1 -1
- package/dist/chant/confirm.d.ts +43 -0
- package/dist/chant/confirm.js +78 -0
- package/dist/chant/confirm.js.map +1 -0
- package/dist/chant/drift.d.ts +0 -2
- package/dist/chant/drift.js +2 -3
- package/dist/chant/drift.js.map +1 -1
- package/dist/chant/gated-request.d.ts +153 -0
- package/dist/chant/gated-request.js +91 -0
- package/dist/chant/gated-request.js.map +1 -0
- package/dist/chant/plan.d.ts +4 -6
- package/dist/chant/plan.js +8 -7
- package/dist/chant/plan.js.map +1 -1
- package/dist/chant/process.d.ts +5 -0
- package/dist/chant/process.js +5 -0
- package/dist/chant/process.js.map +1 -1
- package/dist/chant/stored-plan.d.ts +23 -0
- package/dist/chant/stored-plan.js +33 -0
- package/dist/chant/stored-plan.js.map +1 -0
- package/dist/chant-floor-version.d.ts +14 -0
- package/dist/chant-floor-version.js +15 -0
- package/dist/chant-floor-version.js.map +1 -0
- package/dist/chant-floor.d.ts +42 -0
- package/dist/chant-floor.js +82 -0
- package/dist/chant-floor.js.map +1 -0
- package/dist/check/run.js +2 -2
- package/dist/check/run.js.map +1 -1
- package/dist/ci/check-hooks.d.ts +65 -0
- package/dist/ci/check-hooks.js +101 -0
- package/dist/ci/check-hooks.js.map +1 -0
- package/dist/ci/login.d.ts +45 -0
- package/dist/ci/login.js +55 -0
- package/dist/ci/login.js.map +1 -1
- package/dist/ci/render.d.ts +127 -8
- package/dist/ci/render.js +254 -27
- package/dist/ci/render.js.map +1 -1
- package/dist/ci-words.d.ts +93 -0
- package/dist/ci-words.js +71 -0
- package/dist/ci-words.js.map +1 -0
- package/dist/cli.js +10 -1
- package/dist/cli.js.map +1 -1
- package/dist/command.js +2 -1
- package/dist/command.js.map +1 -1
- package/dist/commands/apply.d.ts +1 -1
- package/dist/commands/apply.js +44 -39
- package/dist/commands/apply.js.map +1 -1
- package/dist/commands/approve.d.ts +0 -2
- package/dist/commands/approve.js +72 -55
- package/dist/commands/approve.js.map +1 -1
- package/dist/commands/chant.d.ts +26 -0
- package/dist/commands/chant.js +37 -0
- package/dist/commands/chant.js.map +1 -0
- package/dist/commands/check.js +13 -10
- package/dist/commands/check.js.map +1 -1
- package/dist/commands/checkpoint.js +4 -5
- package/dist/commands/checkpoint.js.map +1 -1
- package/dist/commands/cleanup.d.ts +2 -0
- package/dist/commands/cleanup.js +82 -3
- package/dist/commands/cleanup.js.map +1 -1
- package/dist/commands/config.js +8 -8
- package/dist/commands/config.js.map +1 -1
- package/dist/commands/docs.js +2 -3
- package/dist/commands/docs.js.map +1 -1
- package/dist/commands/index.js +2 -0
- package/dist/commands/index.js.map +1 -1
- package/dist/commands/init.js +85 -20
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/lint.js +16 -11
- package/dist/commands/lint.js.map +1 -1
- package/dist/commands/mcp.js +14 -0
- package/dist/commands/mcp.js.map +1 -1
- package/dist/commands/new.d.ts +0 -2
- package/dist/commands/new.js +13 -36
- package/dist/commands/new.js.map +1 -1
- package/dist/commands/override.js +14 -16
- package/dist/commands/override.js.map +1 -1
- package/dist/commands/plan.js +14 -10
- package/dist/commands/plan.js.map +1 -1
- package/dist/commands/rebase.js +10 -10
- package/dist/commands/rebase.js.map +1 -1
- package/dist/commands/repair.js +4 -4
- package/dist/commands/report.d.ts +0 -2
- package/dist/commands/report.js +4 -6
- package/dist/commands/report.js.map +1 -1
- package/dist/commands/revert.js +19 -17
- package/dist/commands/revert.js.map +1 -1
- package/dist/commands/status.d.ts +0 -4
- package/dist/commands/status.js +9 -11
- package/dist/commands/status.js.map +1 -1
- package/dist/commands/test.js +5 -5
- package/dist/commands/upgrade.d.ts +39 -0
- package/dist/commands/upgrade.js +197 -0
- package/dist/commands/upgrade.js.map +1 -0
- package/dist/config/define.d.ts +22 -3
- package/dist/config/define.js +1 -0
- package/dist/config/define.js.map +1 -1
- package/dist/config/load.js +8 -4
- package/dist/config/load.js.map +1 -1
- package/dist/credentials.d.ts +15 -20
- package/dist/credentials.js +7 -7
- package/dist/credentials.js.map +1 -1
- package/dist/declarative/plan.d.ts +8 -0
- package/dist/declarative/plan.js +35 -2
- package/dist/declarative/plan.js.map +1 -1
- package/dist/exit.d.ts +51 -15
- package/dist/exit.js +90 -22
- package/dist/exit.js.map +1 -1
- package/dist/history/lock.d.ts +10 -6
- package/dist/history/lock.js +16 -10
- package/dist/history/lock.js.map +1 -1
- package/dist/init/adopt.js +11 -11
- package/dist/init/adopt.js.map +1 -1
- package/dist/init/baseline.js +4 -4
- package/dist/init/baseline.js.map +1 -1
- package/dist/init/second.d.ts +5 -1
- package/dist/init/second.js +9 -6
- package/dist/init/second.js.map +1 -1
- package/dist/lint/annotations.d.ts +15 -5
- package/dist/lint/annotations.js +21 -5
- package/dist/lint/annotations.js.map +1 -1
- package/dist/lint/report.d.ts +0 -2
- package/dist/lint/report.js +2 -3
- package/dist/lint/report.js.map +1 -1
- package/dist/mcp/chant-hook.d.ts +40 -0
- package/dist/mcp/chant-hook.js +75 -0
- package/dist/mcp/chant-hook.js.map +1 -0
- package/dist/mcp/tools.js +1 -1
- package/dist/migrations/create.d.ts +1 -6
- package/dist/migrations/create.js +0 -3
- package/dist/migrations/create.js.map +1 -1
- package/dist/migrations/document.d.ts +1 -1
- package/dist/pr/model.js +2 -2
- package/dist/pr/model.js.map +1 -1
- package/dist/pr/note.d.ts +72 -0
- package/dist/pr/note.js +206 -0
- package/dist/pr/note.js.map +1 -0
- package/dist/pr/render.d.ts +6 -0
- package/dist/pr/render.js +2 -2
- package/dist/pr/render.js.map +1 -1
- package/dist/project.d.ts +11 -2
- package/dist/project.js +14 -3
- package/dist/project.js.map +1 -1
- package/dist/rebase/index.d.ts +0 -2
- package/dist/rebase/index.js +8 -9
- package/dist/rebase/index.js.map +1 -1
- package/dist/rebase/repair.d.ts +0 -2
- package/dist/rebase/repair.js +7 -9
- package/dist/rebase/repair.js.map +1 -1
- package/dist/replay/replay.d.ts +1 -5
- package/dist/replay/replay.js +4 -12
- package/dist/replay/replay.js.map +1 -1
- package/dist/replay/report.js +3 -2
- package/dist/replay/report.js.map +1 -1
- package/dist/replay/shared.js +3 -4
- package/dist/replay/shared.js.map +1 -1
- package/dist/report/audit.d.ts +65 -1
- package/dist/report/audit.js +73 -3
- package/dist/report/audit.js.map +1 -1
- package/dist/report/model.d.ts +15 -1
- package/dist/report/model.js +101 -2
- package/dist/report/model.js.map +1 -1
- package/dist/schemas.d.ts +1 -1
- package/dist/steps/index.d.ts +0 -5
- package/dist/steps/index.js +0 -10
- package/dist/steps/index.js.map +1 -1
- package/dist/steps/kinds.d.ts +2 -45
- package/dist/steps/kinds.js +2 -51
- package/dist/steps/kinds.js.map +1 -1
- package/dist/tenants/wave.js +5 -5
- package/dist/tenants/wave.js.map +1 -1
- package/dist/testing/report.d.ts +0 -2
- package/dist/testing/report.js +2 -3
- package/dist/testing/report.js.map +1 -1
- package/dist/testing/run.js +7 -10
- package/dist/testing/run.js.map +1 -1
- package/dist/versioned/approval.d.ts +0 -2
- package/dist/versioned/approval.js +6 -5
- package/dist/versioned/approval.js.map +1 -1
- package/dist/versioned/checks.d.ts +1 -1
- package/dist/versioned/checks.js +4 -5
- package/dist/versioned/checks.js.map +1 -1
- package/dist/versioned/engine.d.ts +2 -4
- package/dist/versioned/engine.js +11 -42
- package/dist/versioned/engine.js.map +1 -1
- package/dist/versioned/index.d.ts +1 -1
- package/dist/versioned/index.js +3 -4
- package/dist/versioned/index.js.map +1 -1
- package/dist/versioned/op.js +3 -2
- package/dist/versioned/op.js.map +1 -1
- package/dist/versioned/policy.d.ts +1 -1
- package/dist/versioned/policy.js +5 -5
- package/dist/versioned/policy.js.map +1 -1
- package/dist/versioned/revert.js +11 -11
- package/dist/versioned/revert.js.map +1 -1
- package/dist/versioned/stand-down.d.ts +15 -1
- package/dist/versioned/stand-down.js +29 -1
- package/dist/versioned/stand-down.js.map +1 -1
- package/dist/versioned/state.js +0 -5
- package/dist/versioned/state.js.map +1 -1
- package/dist/waves/index.d.ts +1 -1
- package/dist/waves/index.js +26 -12
- package/dist/waves/index.js.map +1 -1
- package/dist/waves/promotion.d.ts +1 -1
- package/dist/waves/promotion.js +6 -6
- package/dist/waves/promotion.js.map +1 -1
- package/package.json +8 -7
- package/schemas/check.schema.json +1 -1
- package/schemas/lint.schema.json +1 -1
- package/schemas/plan.schema.json +1 -1
- package/schemas/report.schema.json +1 -1
- package/dist/steps/orm-handoff.d.ts +0 -74
- package/dist/steps/orm-handoff.js +0 -154
- package/dist/steps/orm-handoff.js.map +0 -1
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* chant's gated requests (chant#4551, #292): a request that is not a
|
|
3
|
+
* migration apply, such as `yodel cleanup`'s drop or `yodel init
|
|
4
|
+
* --baseline`'s record, asked for, approved, spent and finished on chant's
|
|
5
|
+
* gate ledger. chant writes every line: the pending fact in
|
|
6
|
+
* `_gates/<op>.jsonl` (its `gate` the request's subject, its `planDigest`
|
|
7
|
+
* chant's `gatedRequestDigest` of the request), and the `applied` and
|
|
8
|
+
* `finished` lines in `_gates/<op>/applied.jsonl`. `chant ledger gates` and
|
|
9
|
+
* `chant query` read them.
|
|
10
|
+
*
|
|
11
|
+
* The installed chant has them from chant 0.124.55.
|
|
12
|
+
* {@link gatedRequests} imports `@intentius/chant/lifecycle/gated-request`
|
|
13
|
+
* lazily, with the specifier in a variable, so this compiles and runs on a
|
|
14
|
+
* published chant without it: the callers then keep their own gate on the
|
|
15
|
+
* migrations Op, as before. The types below are the parts yodel reads,
|
|
16
|
+
* written out here for the same reason.
|
|
17
|
+
*
|
|
18
|
+
* A requester's own approval never counts (chant's rule for every gated
|
|
19
|
+
* request). The requester is the user chant names an approver by:
|
|
20
|
+
* `GITHUB_ACTOR`, else `GITLAB_USER_LOGIN`, else `USER`.
|
|
21
|
+
*/
|
|
22
|
+
/** One request, as chant digests it. */
|
|
23
|
+
export interface GatedRequest {
|
|
24
|
+
kind: string;
|
|
25
|
+
/** What it is asked of, and the gate it waits at. */
|
|
26
|
+
subject: string;
|
|
27
|
+
by: string;
|
|
28
|
+
at: string;
|
|
29
|
+
fields: Record<string, string>;
|
|
30
|
+
}
|
|
31
|
+
/** Which approvals count: the environment's approval mode. */
|
|
32
|
+
export interface GatedRequestRules {
|
|
33
|
+
mode: "ledger" | "sealed" | "pr-review";
|
|
34
|
+
}
|
|
35
|
+
/** The approval a request spent, as chant's ledger holds it. */
|
|
36
|
+
export interface GatedApproval {
|
|
37
|
+
resolvedBy: string;
|
|
38
|
+
timestamp: string;
|
|
39
|
+
signer?: string;
|
|
40
|
+
}
|
|
41
|
+
export type RequestGateResult = {
|
|
42
|
+
status: "approved";
|
|
43
|
+
digest: string;
|
|
44
|
+
request: GatedRequest;
|
|
45
|
+
approval: GatedApproval;
|
|
46
|
+
} | {
|
|
47
|
+
status: "waiting";
|
|
48
|
+
digest: string;
|
|
49
|
+
request: GatedRequest;
|
|
50
|
+
command: string;
|
|
51
|
+
} | {
|
|
52
|
+
status: "refused";
|
|
53
|
+
digest: string;
|
|
54
|
+
request: GatedRequest;
|
|
55
|
+
by: string;
|
|
56
|
+
reason: string;
|
|
57
|
+
command: string;
|
|
58
|
+
} | {
|
|
59
|
+
status: "spent";
|
|
60
|
+
digest: string;
|
|
61
|
+
request: GatedRequest;
|
|
62
|
+
};
|
|
63
|
+
export interface GatedRequestRead {
|
|
64
|
+
op: string;
|
|
65
|
+
gate: string;
|
|
66
|
+
digest: string;
|
|
67
|
+
request: GatedRequest;
|
|
68
|
+
applied?: unknown;
|
|
69
|
+
}
|
|
70
|
+
/** The parts of chant's `lifecycle/gated-request` yodel calls. */
|
|
71
|
+
export interface GatedRequestApi {
|
|
72
|
+
requestGate(input: {
|
|
73
|
+
op: string;
|
|
74
|
+
request: GatedRequest;
|
|
75
|
+
description?: string;
|
|
76
|
+
rules: GatedRequestRules;
|
|
77
|
+
base?: string;
|
|
78
|
+
cwd?: string;
|
|
79
|
+
now?: string;
|
|
80
|
+
}): Promise<RequestGateResult>;
|
|
81
|
+
spendGatedRequest(input: {
|
|
82
|
+
op: string;
|
|
83
|
+
gate: string;
|
|
84
|
+
digest: string;
|
|
85
|
+
approval: Pick<GatedApproval, "resolvedBy" | "timestamp">;
|
|
86
|
+
runId?: string;
|
|
87
|
+
commit?: string;
|
|
88
|
+
cwd?: string;
|
|
89
|
+
}): Promise<{
|
|
90
|
+
timestamp: string;
|
|
91
|
+
}>;
|
|
92
|
+
finishGatedRequest(input: {
|
|
93
|
+
op: string;
|
|
94
|
+
gate: string;
|
|
95
|
+
digest: string;
|
|
96
|
+
applied: string;
|
|
97
|
+
result: "applied" | "failed";
|
|
98
|
+
detail?: Record<string, string | number | boolean>;
|
|
99
|
+
cwd?: string;
|
|
100
|
+
}): Promise<{
|
|
101
|
+
pushed: boolean;
|
|
102
|
+
pushWarning?: string;
|
|
103
|
+
}>;
|
|
104
|
+
readGatedRequests(op: string, location?: {
|
|
105
|
+
cwd?: string;
|
|
106
|
+
}): Promise<GatedRequestRead[]>;
|
|
107
|
+
gatedRequestDigest(op: string, request: GatedRequest): string;
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* chant's gated-request API, once, or undefined when the installed chant has
|
|
111
|
+
* none. `YODEL_GATED_REQUESTS=0` turns it off, so a project can keep the old
|
|
112
|
+
* gate names until every machine that approves runs a chant with them.
|
|
113
|
+
*/
|
|
114
|
+
export declare function gatedRequests(env?: NodeJS.ProcessEnv): Promise<GatedRequestApi | undefined>;
|
|
115
|
+
/** The requester, named as chant names an approver. */
|
|
116
|
+
export declare function requester(env?: NodeJS.ProcessEnv): string;
|
|
117
|
+
/** What {@link askGatedRequest} asks for. */
|
|
118
|
+
export interface AskGatedRequest {
|
|
119
|
+
op: string;
|
|
120
|
+
kind: string;
|
|
121
|
+
subject: string;
|
|
122
|
+
fields: Record<string, string>;
|
|
123
|
+
description: string;
|
|
124
|
+
rules: GatedRequestRules;
|
|
125
|
+
/** The commit the approval mode was read at. */
|
|
126
|
+
base?: string | undefined;
|
|
127
|
+
cwd: string;
|
|
128
|
+
by?: string;
|
|
129
|
+
now?: string;
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* Ask for the request, or read its approval. A request with the same kind,
|
|
133
|
+
* subject, requester and fields that has not applied keeps its first `at`,
|
|
134
|
+
* so asking again digests the same and finds the approval recorded for it.
|
|
135
|
+
*/
|
|
136
|
+
export declare function askGatedRequest(gated: GatedRequestApi, a: AskGatedRequest): Promise<RequestGateResult>;
|
|
137
|
+
/**
|
|
138
|
+
* Spend the approval, run `act`, and record how it ended. The applied line
|
|
139
|
+
* is pushed before `act` runs, so two runs never act on one approval; a
|
|
140
|
+
* throw from `act` finishes the request `failed` and is thrown again.
|
|
141
|
+
*/
|
|
142
|
+
export declare function spendAndAct<T>(gated: GatedRequestApi, approved: Extract<RequestGateResult, {
|
|
143
|
+
status: "approved";
|
|
144
|
+
}>, at: {
|
|
145
|
+
op: string;
|
|
146
|
+
cwd: string;
|
|
147
|
+
}, act: () => Promise<{
|
|
148
|
+
result: T;
|
|
149
|
+
detail: Record<string, string | number | boolean>;
|
|
150
|
+
}>): Promise<{
|
|
151
|
+
result: T;
|
|
152
|
+
pushWarning?: string;
|
|
153
|
+
}>;
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* chant's gated requests (chant#4551, #292): a request that is not a
|
|
3
|
+
* migration apply, such as `yodel cleanup`'s drop or `yodel init
|
|
4
|
+
* --baseline`'s record, asked for, approved, spent and finished on chant's
|
|
5
|
+
* gate ledger. chant writes every line: the pending fact in
|
|
6
|
+
* `_gates/<op>.jsonl` (its `gate` the request's subject, its `planDigest`
|
|
7
|
+
* chant's `gatedRequestDigest` of the request), and the `applied` and
|
|
8
|
+
* `finished` lines in `_gates/<op>/applied.jsonl`. `chant ledger gates` and
|
|
9
|
+
* `chant query` read them.
|
|
10
|
+
*
|
|
11
|
+
* The installed chant has them from chant 0.124.55.
|
|
12
|
+
* {@link gatedRequests} imports `@intentius/chant/lifecycle/gated-request`
|
|
13
|
+
* lazily, with the specifier in a variable, so this compiles and runs on a
|
|
14
|
+
* published chant without it: the callers then keep their own gate on the
|
|
15
|
+
* migrations Op, as before. The types below are the parts yodel reads,
|
|
16
|
+
* written out here for the same reason.
|
|
17
|
+
*
|
|
18
|
+
* A requester's own approval never counts (chant's rule for every gated
|
|
19
|
+
* request). The requester is the user chant names an approver by:
|
|
20
|
+
* `GITHUB_ACTOR`, else `GITLAB_USER_LOGIN`, else `USER`.
|
|
21
|
+
*/
|
|
22
|
+
let api;
|
|
23
|
+
/**
|
|
24
|
+
* chant's gated-request API, once, or undefined when the installed chant has
|
|
25
|
+
* none. `YODEL_GATED_REQUESTS=0` turns it off, so a project can keep the old
|
|
26
|
+
* gate names until every machine that approves runs a chant with them.
|
|
27
|
+
*/
|
|
28
|
+
export function gatedRequests(env = process.env) {
|
|
29
|
+
if (env.YODEL_GATED_REQUESTS === "0")
|
|
30
|
+
return Promise.resolve(undefined);
|
|
31
|
+
api ??= (async () => {
|
|
32
|
+
const specifier = "@intentius/chant/lifecycle/gated-request";
|
|
33
|
+
let m;
|
|
34
|
+
try {
|
|
35
|
+
m = (await import(specifier));
|
|
36
|
+
}
|
|
37
|
+
catch {
|
|
38
|
+
return undefined;
|
|
39
|
+
}
|
|
40
|
+
const all = ["requestGate", "spendGatedRequest", "finishGatedRequest", "readGatedRequests", "gatedRequestDigest"];
|
|
41
|
+
return all.every((k) => typeof m[k] === "function") ? m : undefined;
|
|
42
|
+
})();
|
|
43
|
+
return api;
|
|
44
|
+
}
|
|
45
|
+
/** The requester, named as chant names an approver. */
|
|
46
|
+
export function requester(env = process.env) {
|
|
47
|
+
return env.GITHUB_ACTOR || env.GITLAB_USER_LOGIN || env.USER || "unknown";
|
|
48
|
+
}
|
|
49
|
+
const sameFields = (a, b) => Object.keys(a).length === Object.keys(b).length && Object.entries(a).every(([k, v]) => b[k] === v);
|
|
50
|
+
/**
|
|
51
|
+
* Ask for the request, or read its approval. A request with the same kind,
|
|
52
|
+
* subject, requester and fields that has not applied keeps its first `at`,
|
|
53
|
+
* so asking again digests the same and finds the approval recorded for it.
|
|
54
|
+
*/
|
|
55
|
+
export async function askGatedRequest(gated, a) {
|
|
56
|
+
const by = a.by ?? requester();
|
|
57
|
+
const standing = (await gated.readGatedRequests(a.op, { cwd: a.cwd }).catch(() => []))
|
|
58
|
+
.filter((r) => r.applied === undefined && r.request.kind === a.kind && r.request.subject === a.subject && r.request.by === by && sameFields(r.request.fields, a.fields))
|
|
59
|
+
.at(-1);
|
|
60
|
+
const request = { kind: a.kind, subject: a.subject, by, at: standing?.request.at ?? a.now ?? new Date().toISOString(), fields: a.fields };
|
|
61
|
+
return gated.requestGate({
|
|
62
|
+
op: a.op,
|
|
63
|
+
request,
|
|
64
|
+
rules: a.rules,
|
|
65
|
+
description: a.description,
|
|
66
|
+
cwd: a.cwd,
|
|
67
|
+
...(a.base ? { base: a.base } : {}),
|
|
68
|
+
...(a.now ? { now: a.now } : {}),
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Spend the approval, run `act`, and record how it ended. The applied line
|
|
73
|
+
* is pushed before `act` runs, so two runs never act on one approval; a
|
|
74
|
+
* throw from `act` finishes the request `failed` and is thrown again.
|
|
75
|
+
*/
|
|
76
|
+
export async function spendAndAct(gated, approved, at, act) {
|
|
77
|
+
const gate = approved.request.subject;
|
|
78
|
+
const applied = await gated.spendGatedRequest({ op: at.op, gate, digest: approved.digest, approval: approved.approval, cwd: at.cwd });
|
|
79
|
+
let done;
|
|
80
|
+
try {
|
|
81
|
+
done = await act();
|
|
82
|
+
}
|
|
83
|
+
catch (e) {
|
|
84
|
+
const error = (e instanceof Error ? e.message : String(e)).slice(0, 2000);
|
|
85
|
+
await gated.finishGatedRequest({ op: at.op, gate, digest: approved.digest, applied: applied.timestamp, result: "failed", detail: { error }, cwd: at.cwd }).catch(() => undefined);
|
|
86
|
+
throw e;
|
|
87
|
+
}
|
|
88
|
+
const finished = await gated.finishGatedRequest({ op: at.op, gate, digest: approved.digest, applied: applied.timestamp, result: "applied", detail: done.detail, cwd: at.cwd });
|
|
89
|
+
return { result: done.result, ...(finished.pushWarning ? { pushWarning: finished.pushWarning } : {}) };
|
|
90
|
+
}
|
|
91
|
+
//# sourceMappingURL=gated-request.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gated-request.js","sourceRoot":"","sources":["../../src/chant/gated-request.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AA+CH,IAAI,GAAqD,CAAC;AAE1D;;;;GAIG;AACH,MAAM,UAAU,aAAa,CAAC,MAAyB,OAAO,CAAC,GAAG;IAChE,IAAI,GAAG,CAAC,oBAAoB,KAAK,GAAG;QAAE,OAAO,OAAO,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IACxE,GAAG,KAAK,CAAC,KAAK,IAAI,EAAE;QAClB,MAAM,SAAS,GAAG,0CAA0C,CAAC;QAC7D,IAAI,CAAuC,CAAC;QAC5C,IAAI,CAAC;YACH,CAAC,GAAG,CAAC,MAAM,MAAM,CAAC,SAAS,CAAC,CAA6B,CAAC;QAC5D,CAAC;QAAC,MAAM,CAAC;YACP,OAAO,SAAS,CAAC;QACnB,CAAC;QACD,MAAM,GAAG,GAAiC,CAAC,aAAa,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,oBAAoB,CAAC,CAAC;QAChJ,OAAO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,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC;AACzG,CAAC"}
|
package/dist/chant/plan.d.ts
CHANGED
|
@@ -23,13 +23,11 @@ export interface Plan {
|
|
|
23
23
|
*/
|
|
24
24
|
refused: ClassifiedChange[];
|
|
25
25
|
}
|
|
26
|
-
/** Exit code: the plan has a change that needs a rebuild (or expand-and-contract) Op. */
|
|
27
|
-
export declare const PLAN_NEEDS_OP = 2;
|
|
28
26
|
/**
|
|
29
|
-
* `
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
*
|
|
27
|
+
* `1` when a live object in the declared databases could not be read
|
|
28
|
+
* (chant's `unreadable`, an object whose definition does not parse, #46): a
|
|
29
|
+
* plan that cannot say what it would do to it is not one to apply. `3` when
|
|
30
|
+
* any change needs its own Op, which a person runs. `0` otherwise.
|
|
33
31
|
*/
|
|
34
32
|
export declare function planExitCode(plan: Plan): number;
|
|
35
33
|
/** The live objects a ClickHouse plan could not read, as chant names them. */
|
package/dist/chant/plan.js
CHANGED
|
@@ -5,16 +5,17 @@
|
|
|
5
5
|
* `planPgAgainstServer` for Postgres) rather than through the CLI.
|
|
6
6
|
*/
|
|
7
7
|
import { YodelError } from "../project.js";
|
|
8
|
-
|
|
9
|
-
export const PLAN_NEEDS_OP = 2;
|
|
8
|
+
import { EXIT_WAITING, EXIT_FAILED } from "../exit.js";
|
|
10
9
|
/**
|
|
11
|
-
* `
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
10
|
+
* `1` when a live object in the declared databases could not be read
|
|
11
|
+
* (chant's `unreadable`, an object whose definition does not parse, #46): a
|
|
12
|
+
* plan that cannot say what it would do to it is not one to apply. `3` when
|
|
13
|
+
* any change needs its own Op, which a person runs. `0` otherwise.
|
|
15
14
|
*/
|
|
16
15
|
export function planExitCode(plan) {
|
|
17
|
-
|
|
16
|
+
if (unreadableOf(plan).length > 0)
|
|
17
|
+
return EXIT_FAILED;
|
|
18
|
+
return plan.refused.length > 0 ? EXIT_WAITING : 0;
|
|
18
19
|
}
|
|
19
20
|
/** The live objects a ClickHouse plan could not read, as chant names them. */
|
|
20
21
|
export const unreadableOf = (plan) => (plan.dialect === "clickhouse" ? (plan.diff.unreadable ?? []) : []);
|
package/dist/chant/plan.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plan.js","sourceRoot":"","sources":["../../src/chant/plan.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAKH,OAAO,EAAE,UAAU,EAAmD,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"plan.js","sourceRoot":"","sources":["../../src/chant/plan.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAKH,OAAO,EAAE,UAAU,EAAmD,MAAM,eAAe,CAAC;AAE5F,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAkBvD;;;;;GAKG;AACH,MAAM,UAAU,YAAY,CAAC,IAAU;IACrC,IAAI,YAAY,CAAC,IAAI,CAAC,CAAC,MAAM,GAAG,CAAC;QAAE,OAAO,WAAW,CAAC;IACtD,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC;AACpD,CAAC;AAED,8EAA8E;AAC9E,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,IAAU,EAA2D,EAAE,CAAC,CAAC,IAAI,CAAC,OAAO,KAAK,YAAY,CAAC,CAAC,CAAC,CAAE,IAAI,CAAC,IAAmB,CAAC,UAAU,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;AAEzL;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,eAAe,CAAC,IAAU,EAAE,KAAY;IACtD,MAAM,OAAO,GAAG,IAAI,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAA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AmD,CAAC,CAAC;QAC3F,OAAO,YAAY,CAAC,IAAI,CAAC,IAAoB,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC;IAC5D,CAAC;IACD,MAAM,EAAE,UAAU,EAAE,GAAG,MAAM,MAAM,CAAC,qDAAqD,CAAC,CAAC;IAC3F,OAAO,UAAU,CAAC,IAAI,CAAC,IAAkB,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC;AACxD,CAAC"}
|
package/dist/chant/process.d.ts
CHANGED
|
@@ -8,6 +8,11 @@
|
|
|
8
8
|
* not whatever `chant` is first on PATH. That chant's `bin/` goes first on the
|
|
9
9
|
* child's PATH, because chant's Op activities shell out to `chant` themselves
|
|
10
10
|
* (`lifecycleDiff` runs `chant lifecycle diff`).
|
|
11
|
+
*
|
|
12
|
+
* A child runs in chant's own words, not yodel's (#287): ../chant/apply.ts
|
|
13
|
+
* reads chant's `approve: chant approve ...` line from its output for the
|
|
14
|
+
* `chantApprove` field scripts use. `yodel chant <args>` is the line that
|
|
15
|
+
* runs chant in yodel's words (../commands/chant.ts).
|
|
11
16
|
*/
|
|
12
17
|
export interface ChantInstall {
|
|
13
18
|
/** The `@intentius/chant` package directory. */
|
package/dist/chant/process.js
CHANGED
|
@@ -8,6 +8,11 @@
|
|
|
8
8
|
* not whatever `chant` is first on PATH. That chant's `bin/` goes first on the
|
|
9
9
|
* child's PATH, because chant's Op activities shell out to `chant` themselves
|
|
10
10
|
* (`lifecycleDiff` runs `chant lifecycle diff`).
|
|
11
|
+
*
|
|
12
|
+
* A child runs in chant's own words, not yodel's (#287): ../chant/apply.ts
|
|
13
|
+
* reads chant's `approve: chant approve ...` line from its output for the
|
|
14
|
+
* `chantApprove` field scripts use. `yodel chant <args>` is the line that
|
|
15
|
+
* runs chant in yodel's words (../commands/chant.ts).
|
|
11
16
|
*/
|
|
12
17
|
import { spawn } from "node:child_process";
|
|
13
18
|
import { createRequire } from "node:module";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"process.js","sourceRoot":"","sources":["../../src/chant/process.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"process.js","sourceRoot":"","sources":["../../src/chant/process.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACrD,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAazC,IAAI,OAAiC,CAAC;AAEtC,iDAAiD;AACjD,MAAM,UAAU,YAAY;IAC1B,IAAI,OAAO;QAAE,OAAO,OAAO,CAAC;IAC5B,MAAM,OAAO,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAC/C,sEAAsE;IACtE,MAAM,IAAI,GAAG,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,kBAAkB,CAAC,CAAC,CAAC,CAAC;IACnE,OAAO,GAAG;QACR,IAAI;QACJ,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,SAAS,CAAC;QACzC,GAAG,EAAE,IAAI,CAAC,IAAI,EAAE,KAAK,CAAC;QACtB,MAAM,EAAE,aAAa,CAAC,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI;KACnD,CAAC;IACF,OAAO,OAAO,CAAC;AACjB,CAAC;AAgBD,6FAA6F;AAC7F,MAAM,UAAU,QAAQ,CAAC,OAA0B,OAAO,CAAC,GAAG;IAC5D,MAAM,EAAE,GAAG,EAAE,GAAG,YAAY,EAAE,CAAC;IAC/B,OAAO,EAAE,GAAG,IAAI,EAAE,IAAI,EAAE,CAAC,GAAG,EAAE,IAAI,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC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ands chant the change set of its runs'
|
|
4
|
+
* parts; chant stores it under its digest in `_change-sets/` on
|
|
5
|
+
* chant/lifecycle and the wave's pending fact cites it as `changeSet`.
|
|
6
|
+
* `yodel approve` shows that stored plan, the one the approval was asked
|
|
7
|
+
* for, beside the plan as it reads now.
|
|
8
|
+
*
|
|
9
|
+
* A pending fact written by a chant before chant#4551, or by a wave that ran
|
|
10
|
+
* yodel's own plan callbacks, cites none: {@link storedPlanText} is then
|
|
11
|
+
* undefined and nothing changes. The field is read structurally, so this
|
|
12
|
+
* compiles against a published chant without it.
|
|
13
|
+
*/
|
|
14
|
+
import type { GateLedgerPort } from "@intentius/chant/op/gate";
|
|
15
|
+
/** The change-set digest the newest pending fact of `gate` cites for `digest`, if any. */
|
|
16
|
+
export declare function citedChangeSet(ledger: GateLedgerPort, op: string, gate: string, digest: string): Promise<string | undefined>;
|
|
17
|
+
/**
|
|
18
|
+
* The stored plan the pending fact of `gate` cites for `digest`, rendered as
|
|
19
|
+
* chant's plan summary, with a line naming where it is stored. Undefined
|
|
20
|
+
* when the fact cites none or nothing is stored under it; a stored file that
|
|
21
|
+
* is not that change set is said so.
|
|
22
|
+
*/
|
|
23
|
+
export declare function storedPlanText(dir: string, ledger: GateLedgerPort, op: string, gate: string, digest: string): Promise<string | undefined>;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/** The change-set digest the newest pending fact of `gate` cites for `digest`, if any. */
|
|
2
|
+
export async function citedChangeSet(ledger, op, gate, digest) {
|
|
3
|
+
const { pending } = await ledger.read(op);
|
|
4
|
+
const fact = pending.filter((p) => p.gate === gate && p.planDigest === digest).at(-1);
|
|
5
|
+
const cited = fact?.changeSet;
|
|
6
|
+
return typeof cited === "string" && cited !== "" ? cited : undefined;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* The stored plan the pending fact of `gate` cites for `digest`, rendered as
|
|
10
|
+
* chant's plan summary, with a line naming where it is stored. Undefined
|
|
11
|
+
* when the fact cites none or nothing is stored under it; a stored file that
|
|
12
|
+
* is not that change set is said so.
|
|
13
|
+
*/
|
|
14
|
+
export async function storedPlanText(dir, ledger, op, gate, digest) {
|
|
15
|
+
let cited;
|
|
16
|
+
try {
|
|
17
|
+
cited = await citedChangeSet(ledger, op, gate, digest);
|
|
18
|
+
}
|
|
19
|
+
catch {
|
|
20
|
+
return undefined;
|
|
21
|
+
}
|
|
22
|
+
if (!cited)
|
|
23
|
+
return undefined;
|
|
24
|
+
const { readStoredChangeSet } = await import("@intentius/chant/lifecycle/change-set-store");
|
|
25
|
+
const read = await readStoredChangeSet(cited, { cwd: dir }).catch((e) => ({ status: "malformed", message: e instanceof Error ? e.message : String(e) }));
|
|
26
|
+
if (read.status === "missing")
|
|
27
|
+
return undefined;
|
|
28
|
+
if (read.status === "malformed")
|
|
29
|
+
return `The plan this approval was asked for (${cited}) cannot be shown: ${read.message}\n`;
|
|
30
|
+
const { groupChangeSet, renderPlanSummaryText } = await import("@intentius/chant/plan-summary");
|
|
31
|
+
return `The plan this approval was asked for, as chant stored it (${cited}, chant change-set show ${cited}):\n${renderPlanSummaryText(groupChangeSet(read.document))}`;
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=stored-plan.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stored-plan.js","sourceRoot":"","sources":["../../src/chant/stored-plan.ts"],"names":[],"mappings":"AAeA,0FAA0F;AAC1F,MAAM,CAAC,KAAK,UAAU,cAAc,CAAC,MAAsB,EAAE,EAAU,EAAE,IAAY,EAAE,MAAc;IACnG,MAAM,EAAE,OAAO,EAAE,GAAG,MAAM,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IAC1C,MAAM,IAAI,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,IAAI,IAAI,CAAC,CAAC,UAAU,KAAK,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,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AK,OAAO,qBAAqB,CAAC,cAAc,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,EAAE,CAAC;AACzK,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The floor's version and install line, in a module that imports nothing
|
|
3
|
+
* (#298). src/chant-floor.ts re-exports them; src/commands/upgrade.ts reads
|
|
4
|
+
* them from here, since chant-floor.ts imports the feature-detects, one of
|
|
5
|
+
* which (src/mcp/tools.ts, through src/cli.ts) imports the commands, and a
|
|
6
|
+
* `--help` text built at load would otherwise find them not yet defined when
|
|
7
|
+
* chant-floor.ts is the first module loaded.
|
|
8
|
+
*/
|
|
9
|
+
/** The first chant (and sql lexicon) whose CI yodel's pipelines run on. */
|
|
10
|
+
export declare const CHANT_CI_FLOOR = "0.124.55";
|
|
11
|
+
/** The packages a project pins at the floor, chant and the sql lexicon, at one version as the templates pin them. */
|
|
12
|
+
export declare const CHANT_PACKAGES: readonly ["@intentius/chant", "@intentius/chant-lexicon-sql"];
|
|
13
|
+
/** The line that installs the floor, exact as the templates pin chant. */
|
|
14
|
+
export declare const installLine: (version?: string) => string;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The floor's version and install line, in a module that imports nothing
|
|
3
|
+
* (#298). src/chant-floor.ts re-exports them; src/commands/upgrade.ts reads
|
|
4
|
+
* them from here, since chant-floor.ts imports the feature-detects, one of
|
|
5
|
+
* which (src/mcp/tools.ts, through src/cli.ts) imports the commands, and a
|
|
6
|
+
* `--help` text built at load would otherwise find them not yet defined when
|
|
7
|
+
* chant-floor.ts is the first module loaded.
|
|
8
|
+
*/
|
|
9
|
+
/** The first chant (and sql lexicon) whose CI yodel's pipelines run on. */
|
|
10
|
+
export const CHANT_CI_FLOOR = "0.124.55";
|
|
11
|
+
/** The packages a project pins at the floor, chant and the sql lexicon, at one version as the templates pin them. */
|
|
12
|
+
export const CHANT_PACKAGES = ["@intentius/chant", "@intentius/chant-lexicon-sql"];
|
|
13
|
+
/** The line that installs the floor, exact as the templates pin chant. */
|
|
14
|
+
export const installLine = (version = CHANT_CI_FLOOR) => `npm install -E ${CHANT_PACKAGES.map((p) => `${p}@${version}`).join(" ")}`;
|
|
15
|
+
//# sourceMappingURL=chant-floor-version.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chant-floor-version.js","sourceRoot":"","sources":["../src/chant-floor-version.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,2EAA2E;AAC3E,MAAM,CAAC,MAAM,cAAc,GAAG,UAAU,CAAC;AAEzC,qHAAqH;AACrH,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,kBAAkB,EAAE,8BAA8B,CAAU,CAAC;AAE5F,0EAA0E;AAC1E,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,UAAkB,cAAc,EAAU,EAAE,CAAC,kBAAkB,cAAc,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,CAAC,IAAI,OAAO,EAAE,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The chant release yodel's pipelines move onto chant's product pipeline
|
|
3
|
+
* with (#298, tracker #285).
|
|
4
|
+
*
|
|
5
|
+
* Every part of chant CI yodel uses is feature-detected (src/ci-words.ts,
|
|
6
|
+
* src/ci/render.ts, src/ci/check-hooks.ts, src/ci/login.ts,
|
|
7
|
+
* src/chant/gated-request.ts, src/chant/confirm.ts, src/mcp/chant-hook.ts,
|
|
8
|
+
* src/exit.ts), so a project keeps the pipelines it has until its chant is
|
|
9
|
+
* at least {@link CHANT_CI_FLOOR}. `yodel upgrade` (src/commands/upgrade.ts)
|
|
10
|
+
* then moves it in one commit, and docs/chant-ci.md says so, keyed to the
|
|
11
|
+
* same number.
|
|
12
|
+
*
|
|
13
|
+
* chant names that release `NEXT_RELEASE` until the maintainer cuts it
|
|
14
|
+
* (chant's packages/core/src/release-floors.ts, `CI_PRODUCT_FLOOR`). The
|
|
15
|
+
* release of yodel that takes it as its floor (#299) sets CHANT_CI_FLOOR
|
|
16
|
+
* (src/chant-floor-version.ts, re-exported here) to
|
|
17
|
+
* the version chant published, and test/upgrade.test.ts checks that the
|
|
18
|
+
* docs name the same one.
|
|
19
|
+
*/
|
|
20
|
+
export { CHANT_CI_FLOOR, CHANT_PACKAGES, installLine } from "./chant-floor-version.js";
|
|
21
|
+
/**
|
|
22
|
+
* The version of `pkg` that yodel's own imports resolve to, or undefined
|
|
23
|
+
* when it is not installed. The package's entry is resolved and its
|
|
24
|
+
* package.json found above it, since chant exports no `./package.json`.
|
|
25
|
+
*/
|
|
26
|
+
export declare function installedVersion(pkg: string, from?: string): string | undefined;
|
|
27
|
+
/** One part of chant CI yodel uses, and whether the installed chant has it. */
|
|
28
|
+
export interface ChantPart {
|
|
29
|
+
/** What a person reads in `yodel upgrade`'s list. */
|
|
30
|
+
name: string;
|
|
31
|
+
/** The page section of docs/chant-ci.md that describes it. */
|
|
32
|
+
section: string;
|
|
33
|
+
has: boolean;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* The parts of chant CI yodel feature-detects, in the order docs/chant-ci.md
|
|
37
|
+
* lists them. Each check is the one the command that uses it makes, so the
|
|
38
|
+
* list says what `yodel ci` and the other commands will do with this chant.
|
|
39
|
+
* Variables that keep yodel's own path (`YODEL_GATED_REQUESTS=0`,
|
|
40
|
+
* `YODEL_OWN_CONFIRM=1`) are not read here: the list is about chant.
|
|
41
|
+
*/
|
|
42
|
+
export declare function chantParts(): Promise<ChantPart[]>;
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The chant release yodel's pipelines move onto chant's product pipeline
|
|
3
|
+
* with (#298, tracker #285).
|
|
4
|
+
*
|
|
5
|
+
* Every part of chant CI yodel uses is feature-detected (src/ci-words.ts,
|
|
6
|
+
* src/ci/render.ts, src/ci/check-hooks.ts, src/ci/login.ts,
|
|
7
|
+
* src/chant/gated-request.ts, src/chant/confirm.ts, src/mcp/chant-hook.ts,
|
|
8
|
+
* src/exit.ts), so a project keeps the pipelines it has until its chant is
|
|
9
|
+
* at least {@link CHANT_CI_FLOOR}. `yodel upgrade` (src/commands/upgrade.ts)
|
|
10
|
+
* then moves it in one commit, and docs/chant-ci.md says so, keyed to the
|
|
11
|
+
* same number.
|
|
12
|
+
*
|
|
13
|
+
* chant names that release `NEXT_RELEASE` until the maintainer cuts it
|
|
14
|
+
* (chant's packages/core/src/release-floors.ts, `CI_PRODUCT_FLOOR`). The
|
|
15
|
+
* release of yodel that takes it as its floor (#299) sets CHANT_CI_FLOOR
|
|
16
|
+
* (src/chant-floor-version.ts, re-exported here) to
|
|
17
|
+
* the version chant published, and test/upgrade.test.ts checks that the
|
|
18
|
+
* docs name the same one.
|
|
19
|
+
*/
|
|
20
|
+
import { readFileSync } from "node:fs";
|
|
21
|
+
import { createRequire } from "node:module";
|
|
22
|
+
import { dirname, join } from "node:path";
|
|
23
|
+
import { chantProduct } from "./ci-words.js";
|
|
24
|
+
import { chantLocksWaves, hasSqlCapability } from "./ci/render.js";
|
|
25
|
+
import { chantCheckHooks } from "./ci/check-hooks.js";
|
|
26
|
+
import { chantTrade } from "./ci/login.js";
|
|
27
|
+
import { gatedRequests } from "./chant/gated-request.js";
|
|
28
|
+
import { chantConfirm } from "./chant/confirm.js";
|
|
29
|
+
import { chantHooks } from "./mcp/chant-hook.js";
|
|
30
|
+
import { useChantExitTable } from "./exit.js";
|
|
31
|
+
export { CHANT_CI_FLOOR, CHANT_PACKAGES, installLine } from "./chant-floor-version.js";
|
|
32
|
+
/**
|
|
33
|
+
* The version of `pkg` that yodel's own imports resolve to, or undefined
|
|
34
|
+
* when it is not installed. The package's entry is resolved and its
|
|
35
|
+
* package.json found above it, since chant exports no `./package.json`.
|
|
36
|
+
*/
|
|
37
|
+
export function installedVersion(pkg, from = import.meta.url) {
|
|
38
|
+
let at;
|
|
39
|
+
try {
|
|
40
|
+
at = createRequire(from).resolve(pkg);
|
|
41
|
+
}
|
|
42
|
+
catch {
|
|
43
|
+
return undefined;
|
|
44
|
+
}
|
|
45
|
+
for (let dir = dirname(at); dir !== dirname(dir); dir = dirname(dir)) {
|
|
46
|
+
try {
|
|
47
|
+
const json = JSON.parse(readFileSync(join(dir, "package.json"), "utf8"));
|
|
48
|
+
if (json.name === pkg && typeof json.version === "string")
|
|
49
|
+
return json.version;
|
|
50
|
+
}
|
|
51
|
+
catch {
|
|
52
|
+
// no package.json here; keep going up
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
return undefined;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* The parts of chant CI yodel feature-detects, in the order docs/chant-ci.md
|
|
59
|
+
* lists them. Each check is the one the command that uses it makes, so the
|
|
60
|
+
* list says what `yodel ci` and the other commands will do with this chant.
|
|
61
|
+
* Variables that keep yodel's own path (`YODEL_GATED_REQUESTS=0`,
|
|
62
|
+
* `YODEL_OWN_CONFIRM=1`) are not read here: the list is about chant.
|
|
63
|
+
*/
|
|
64
|
+
export async function chantParts() {
|
|
65
|
+
const product = (await chantProduct()) !== undefined;
|
|
66
|
+
const parts = [
|
|
67
|
+
["product pipeline (words, jobs, yodel chant)", "the-pipelines", Promise.resolve(product)],
|
|
68
|
+
["exit-code table", "exit-codes", useChantExitTable().then((t) => t === "chant")],
|
|
69
|
+
["sql capability (waves with no callback)", "the-apply-waves", hasSqlCapability()],
|
|
70
|
+
["lock grain and stand-down", "locks", chantLocksWaves()],
|
|
71
|
+
["check hooks", "the-check-on-chants-check-hooks", chantCheckHooks().then((m) => m !== undefined)],
|
|
72
|
+
["cloud identity trade", "cloud-login", chantTrade().then((m) => m !== undefined)],
|
|
73
|
+
["gated requests and run records", "records-on-the-ledger", gatedRequests({}).then((m) => m !== undefined)],
|
|
74
|
+
["confirmation at a terminal", "yodel-approve", chantConfirm({}).then((m) => m !== undefined)],
|
|
75
|
+
["MCP tool hook and traces", "mcp-and-traces", chantHooks().then((m) => m !== undefined)],
|
|
76
|
+
];
|
|
77
|
+
const out = [];
|
|
78
|
+
for (const [name, section, has] of parts)
|
|
79
|
+
out.push({ name, section, has: await has.catch(() => false) });
|
|
80
|
+
return out;
|
|
81
|
+
}
|
|
82
|
+
//# sourceMappingURL=chant-floor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chant-floor.js","sourceRoot":"","sources":["../src/chant-floor.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAC7C,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AACnE,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AACzD,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAE9C,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAEvF;;;;GAIG;AACH,MAAM,UAAU,gBAAgB,CAAC,GAAW,EAAE,OAAe,MAAM,CAAC,IAAI,CAAC,GAAG;IAC1E,IAAI,EAAU,CAAC;IACf,IAAI,CAAC;QACH,EAAE,GAAG,aAAa,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,CAA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E,UAAU,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,SAAS,CAAC,CAAC;QAClF,CAAC,gCAAgC,EAAE,uBAAuB,EAAE,aAAa,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,SAAS,CAAC,CAAC;QAC3G,CAAC,4BAA4B,EAAE,eAAe,EAAE,YAAY,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,SAAS,CAAC,CAAC;QAC9F,CAAC,0BAA0B,EAAE,gBAAgB,EAAE,UAAU,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,SAAS,CAAC,CAAC;KAC1F,CAAC;IACF,MAAM,GAAG,GAAgB,EAAE,CAAC;IAC5B,KAAK,MAAM,CAAC,IAAI,EAAE,OAAO,EAAE,GAAG,CAAC,IAAI,KAAK;QAAE,GAAG,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,GAAG,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;IACzG,OAAO,GAAG,CAAC;AACb,CAAC"}
|
package/dist/check/run.js
CHANGED
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
*/
|
|
14
14
|
import { mkdtempSync, rmSync } from "node:fs";
|
|
15
15
|
import { join, relative } from "node:path";
|
|
16
|
-
import { YodelError } from "../project.js";
|
|
16
|
+
import { YodelError, yodelRefusal } from "../project.js";
|
|
17
17
|
import { buildSchema } from "../chant/build.js";
|
|
18
18
|
import { importLive } from "../init/live.js";
|
|
19
19
|
import { createMigration, writeMigration } from "../migrations/index.js";
|
|
@@ -121,7 +121,7 @@ export async function runCheck(project, env, server, migrations, options) {
|
|
|
121
121
|
const processEnv = options.processEnv ?? process.env;
|
|
122
122
|
const occupied = await server.occupied();
|
|
123
123
|
if (occupied.length > 0 && !options.reset) {
|
|
124
|
-
throw
|
|
124
|
+
throw yodelRefusal(`${server.where} already holds ${occupied.join(", ")}; yodel check replays into an empty scope (a throwaway server). Pass --reset to empty it first, never on a server whose data matters`);
|
|
125
125
|
}
|
|
126
126
|
await server.clear();
|
|
127
127
|
const work = mkdtempSync(join(project.dir, ".yodel-check-migrations-"));
|