@intentius/sql-yodeler 0.11.1 → 0.12.1
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/chant/gated-request.d.ts +31 -1
- package/dist/chant/gated-request.js +57 -1
- package/dist/chant/gated-request.js.map +1 -1
- package/dist/chant-floor-version.d.ts +1 -1
- package/dist/chant-floor-version.js +1 -1
- package/dist/chant-floor.d.ts +14 -12
- package/dist/chant-floor.js +33 -19
- package/dist/chant-floor.js.map +1 -1
- package/dist/ci/login.d.ts +22 -47
- package/dist/ci/login.js +35 -82
- package/dist/ci/login.js.map +1 -1
- package/dist/ci/render.d.ts +42 -73
- package/dist/ci/render.js +78 -137
- package/dist/ci/render.js.map +1 -1
- package/dist/ci-words.d.ts +3 -3
- package/dist/ci-words.js +3 -3
- package/dist/commands/apply.d.ts +6 -0
- package/dist/commands/apply.js +34 -12
- package/dist/commands/apply.js.map +1 -1
- package/dist/commands/mcp.js +15 -20
- package/dist/commands/mcp.js.map +1 -1
- package/dist/commands/plan.js +52 -8
- package/dist/commands/plan.js.map +1 -1
- package/dist/commands/revert.js +5 -1
- package/dist/commands/revert.js.map +1 -1
- package/dist/config/define.d.ts +1 -1
- package/dist/config/settings.d.ts +23 -3
- package/dist/config/settings.js +32 -9
- package/dist/config/settings.js.map +1 -1
- package/dist/mcp/chant-hook.d.ts +7 -5
- package/dist/mcp/chant-hook.js +19 -22
- package/dist/mcp/chant-hook.js.map +1 -1
- package/dist/pr/note.d.ts +26 -23
- package/dist/pr/note.js +59 -49
- package/dist/pr/note.js.map +1 -1
- package/dist/pr/part.d.ts +11 -0
- package/dist/pr/part.js +35 -1
- package/dist/pr/part.js.map +1 -1
- package/dist/pr/render.d.ts +0 -4
- package/dist/pr/render.js +5 -62
- package/dist/pr/render.js.map +1 -1
- package/dist/pr/tenants.d.ts +7 -0
- package/dist/pr/tenants.js +25 -0
- package/dist/pr/tenants.js.map +1 -1
- package/dist/versioned/engine.d.ts +1 -1
- package/package.json +7 -7
- package/dist/mcp/server.d.ts +0 -40
- package/dist/mcp/server.js +0 -106
- package/dist/mcp/server.js.map +0 -1
- package/dist/versioned/stand-down.d.ts +0 -44
- package/dist/versioned/stand-down.js +0 -84
- package/dist/versioned/stand-down.js.map +0 -1
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* `yodel apply --stand-down` (`YODEL_STAND_DOWN=1`): an apply that a newer
|
|
3
|
-
* commit will make anyway steps aside instead of queueing for the lock.
|
|
4
|
-
*
|
|
5
|
-
* The branch is the one the run is for: `GITHUB_REF_NAME` (GitHub and
|
|
6
|
-
* Forgejo Actions), `CI_COMMIT_BRANCH` (GitLab CI), else the checked-out
|
|
7
|
-
* branch. Its tip is fetched from `origin`; when that tip is a different
|
|
8
|
-
* commit that contains this one, a newer commit is on the branch, and its
|
|
9
|
-
* own apply job applies the same environment, this run included. Anything
|
|
10
|
-
* that cannot be told (no branch, no origin, a fetch that fails, a tip that
|
|
11
|
-
* does not contain this commit, as after a force-push) is not a newer
|
|
12
|
-
* commit: the apply goes ahead.
|
|
13
|
-
*
|
|
14
|
-
* chant does the same for every product's waves (chant#4581, #293): a waves
|
|
15
|
-
* spec with `standDown: true` exits 6 (`superseded`), and `yodel ci`
|
|
16
|
-
* renders that in place of `YODEL_STAND_DOWN` once the installed chant has
|
|
17
|
-
* it. With such a chant, {@link newerCommit} is chant's
|
|
18
|
-
* `newerCommitOnBranch`, so `yodel apply --stand-down` at a terminal and
|
|
19
|
-
* chant's wave job answer the question the same way. The copy below is the
|
|
20
|
-
* fallback for a published chant without it.
|
|
21
|
-
*/
|
|
22
|
-
import { execFile } from "node:child_process";
|
|
23
|
-
import { promisify } from "node:util";
|
|
24
|
-
const exec = promisify(execFile);
|
|
25
|
-
export const STAND_DOWN_ENV = "YODEL_STAND_DOWN";
|
|
26
|
-
/** Whether the environment asks for stand-down: `YODEL_STAND_DOWN=1` (or `true`). */
|
|
27
|
-
export const standDownFromEnv = (env) => env[STAND_DOWN_ENV] === "1" || env[STAND_DOWN_ENV] === "true";
|
|
28
|
-
async function git(dir, args) {
|
|
29
|
-
try {
|
|
30
|
-
const { stdout } = await exec("git", args, { cwd: dir, timeout: 60_000 });
|
|
31
|
-
return stdout.trim();
|
|
32
|
-
}
|
|
33
|
-
catch {
|
|
34
|
-
return undefined;
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
/** The branch a run is for; see the module comment. */
|
|
38
|
-
export async function runBranch(dir, env) {
|
|
39
|
-
const named = env.GITHUB_REF_NAME || env.CI_COMMIT_BRANCH;
|
|
40
|
-
if (named)
|
|
41
|
-
return named;
|
|
42
|
-
return (await git(dir, ["symbolic-ref", "--quiet", "--short", "HEAD"])) || undefined;
|
|
43
|
-
}
|
|
44
|
-
let chants;
|
|
45
|
-
/** chant's `newerCommitOnBranch` (chant#4581), once, or undefined when the installed chant has none. */
|
|
46
|
-
export function chantNewerCommit() {
|
|
47
|
-
chants ??= (async () => {
|
|
48
|
-
const specifier = "@intentius/chant/op";
|
|
49
|
-
try {
|
|
50
|
-
const m = (await import(specifier));
|
|
51
|
-
return typeof m.OP_WAVE_STAND_DOWN_FLOOR === "string" && typeof m.newerCommitOnBranch === "function" ? m.newerCommitOnBranch : undefined;
|
|
52
|
-
}
|
|
53
|
-
catch {
|
|
54
|
-
return undefined;
|
|
55
|
-
}
|
|
56
|
-
})();
|
|
57
|
-
return chants;
|
|
58
|
-
}
|
|
59
|
-
/** The newer commit on the run's branch, or `undefined` when there is none or it cannot be told: chant's answer when chant has it, else yodel's own. */
|
|
60
|
-
export async function newerCommit(dir, env = process.env) {
|
|
61
|
-
const chant = await chantNewerCommit();
|
|
62
|
-
return chant ? chant(dir, env) : ownNewerCommit(dir, env);
|
|
63
|
-
}
|
|
64
|
-
/** yodel's own answer, for a published chant without chant#4581. */
|
|
65
|
-
export async function ownNewerCommit(dir, env = process.env) {
|
|
66
|
-
const branch = await runBranch(dir, env);
|
|
67
|
-
if (!branch)
|
|
68
|
-
return undefined;
|
|
69
|
-
const head = await git(dir, ["rev-parse", "HEAD"]);
|
|
70
|
-
if (!head)
|
|
71
|
-
return undefined;
|
|
72
|
-
if ((await git(dir, ["fetch", "--quiet", "--no-tags", "origin", `refs/heads/${branch}`])) === undefined)
|
|
73
|
-
return undefined;
|
|
74
|
-
const tip = await git(dir, ["rev-parse", "FETCH_HEAD"]);
|
|
75
|
-
if (!tip || tip === head)
|
|
76
|
-
return undefined;
|
|
77
|
-
// A tip that contains this commit is newer; one that does not (a force-push, another line) is not.
|
|
78
|
-
if ((await git(dir, ["merge-base", "--is-ancestor", head, tip])) === undefined)
|
|
79
|
-
return undefined;
|
|
80
|
-
return { branch, head, tip };
|
|
81
|
-
}
|
|
82
|
-
/** What a run that stands down says. */
|
|
83
|
-
export const standDownLine = (env, n) => `standing down: ${n.branch} on origin is at ${n.tip.slice(0, 12)}, newer than this run's ${n.head.slice(0, 12)}, and its own apply applies ${env}. Nothing was applied by this run.`;
|
|
84
|
-
//# sourceMappingURL=stand-down.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"stand-down.js","sourceRoot":"","sources":["../../src/versioned/stand-down.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAEtC,MAAM,IAAI,GAAG,SAAS,CAAC,QAAQ,CAAC,CAAC;AAEjC,MAAM,CAAC,MAAM,cAAc,GAAG,kBAAkB,CAAC;AAEjD,qFAAqF;AACrF,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,GAAsB,EAAW,EAAE,CAAC,GAAG,CAAC,cAAc,CAAC,KAAK,GAAG,IAAI,GAAG,CAAC,cAAc,CAAC,KAAK,MAAM,CAAC;AAWnI,KAAK,UAAU,GAAG,CAAC,GAAW,EAAE,IAAc;IAC5C,IA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