@intentius/sql-yodeler 0.13.4 → 0.14.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/ci/login.d.ts +6 -0
- package/dist/ci/login.js +11 -0
- package/dist/ci/login.js.map +1 -1
- package/dist/ci/pipeline.d.ts +126 -0
- package/dist/ci/pipeline.js +292 -0
- package/dist/ci/pipeline.js.map +1 -0
- package/dist/ci/render.d.ts +49 -3
- package/dist/ci/render.js +220 -12
- package/dist/ci/render.js.map +1 -1
- package/dist/ci-words.d.ts +11 -1
- package/dist/ci-words.js +9 -0
- package/dist/ci-words.js.map +1 -1
- package/dist/commands/chant.js +4 -2
- package/dist/commands/chant.js.map +1 -1
- package/dist/commands/ci.js +36 -1
- package/dist/commands/ci.js.map +1 -1
- package/dist/commands/config.js +2 -0
- package/dist/commands/config.js.map +1 -1
- package/dist/commands/index.js +5 -0
- package/dist/commands/index.js.map +1 -1
- package/dist/commands/plan.js +28 -4
- package/dist/commands/plan.js.map +1 -1
- package/dist/commands/report.d.ts +2 -2
- package/dist/commands/report.js +3 -2
- package/dist/commands/report.js.map +1 -1
- package/dist/commands/stages.d.ts +9 -0
- package/dist/commands/stages.js +122 -0
- package/dist/commands/stages.js.map +1 -0
- package/dist/config/define.d.ts +205 -1
- package/dist/config/define.js +2 -0
- package/dist/config/define.js.map +1 -1
- package/dist/config/load.d.ts +6 -0
- package/dist/config/load.js +64 -7
- package/dist/config/load.js.map +1 -1
- package/dist/config/vocabulary.d.ts +28 -0
- package/dist/config/vocabulary.js +73 -0
- package/dist/config/vocabulary.js.map +1 -0
- package/dist/pr/note.d.ts +14 -1
- package/dist/pr/note.js +19 -3
- package/dist/pr/note.js.map +1 -1
- package/dist/project.d.ts +2 -1
- package/dist/report/chant-audit.d.ts +22 -0
- package/dist/report/chant-audit.js +30 -0
- package/dist/report/chant-audit.js.map +1 -0
- package/dist/report/jsonl.d.ts +16 -13
- package/dist/report/jsonl.js +26 -19
- package/dist/report/jsonl.js.map +1 -1
- package/dist/schemas.d.ts +1 -1
- package/dist/waves/index.js +21 -4
- package/dist/waves/index.js.map +1 -1
- package/package.json +7 -7
- package/schemas/report.schema.json +27 -1
package/dist/ci/login.d.ts
CHANGED
|
@@ -97,6 +97,12 @@ export declare function jobLogins(login: CiLogin | undefined, held: ReadonlyArra
|
|
|
97
97
|
* name, and Azure logs the `az` command line in too, as before.
|
|
98
98
|
*/
|
|
99
99
|
export declare function forgejoLoginSpec(logins: readonly Login[]): CloudLoginSpec;
|
|
100
|
+
/**
|
|
101
|
+
* A Forgejo login as lines of the step that runs yodel (chant's `sameStep`):
|
|
102
|
+
* the promote job of a pipeline stage (#384) runs its command in one step,
|
|
103
|
+
* where a variable written to $GITHUB_ENV would arrive too late.
|
|
104
|
+
*/
|
|
105
|
+
export declare function forgejoLoginLines(logins: readonly Login[]): string[];
|
|
100
106
|
/** The login steps of a job on `forge`, for `logins`: chant's trade on GitHub and GitLab, the runner's token file on Forgejo. */
|
|
101
107
|
export declare function loginSteps(forge: LoginForge, logins: readonly Login[]): LoginSteps;
|
|
102
108
|
/** What is wrong with yodel.config.ts `ci.login`, if anything. */
|
package/dist/ci/login.js
CHANGED
|
@@ -124,6 +124,17 @@ function forgejoSteps(logins) {
|
|
|
124
124
|
const out = forgejoCloudLogin(forgejoLoginSpec(logins));
|
|
125
125
|
return { steps: out.steps.map((st) => ({ name: st.name, lines: st.run })), variables: {} };
|
|
126
126
|
}
|
|
127
|
+
/**
|
|
128
|
+
* A Forgejo login as lines of the step that runs yodel (chant's `sameStep`):
|
|
129
|
+
* the promote job of a pipeline stage (#384) runs its command in one step,
|
|
130
|
+
* where a variable written to $GITHUB_ENV would arrive too late.
|
|
131
|
+
*/
|
|
132
|
+
export function forgejoLoginLines(logins) {
|
|
133
|
+
const spec = forgejoLoginSpec(logins);
|
|
134
|
+
if (Object.keys(spec).length === 0)
|
|
135
|
+
return [];
|
|
136
|
+
return forgejoCloudLogin(spec, { sameStep: true }).steps.flatMap((st) => st.run);
|
|
137
|
+
}
|
|
127
138
|
/** The login steps of a job on `forge`, for `logins`: chant's trade on GitHub and GitLab, the runner's token file on Forgejo. */
|
|
128
139
|
export function loginSteps(forge, logins) {
|
|
129
140
|
if (logins.length === 0)
|
package/dist/ci/login.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"login.js","sourceRoot":"","sources":["../../src/ci/login.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAEH,OAAO,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAChH,OAAO,EAAE,iBAAiB,EAAuB,MAAM,2BAA2B,CAAC;AAWnF,4EAA4E;AAC5E,MAAM,UAAU,SAAS,CAAC,MAAwB;IAChD,MAAM,IAAI,GAAc,EAAE,CAAC;IAC3B,KAAK,MAAM,CAAC,IAAI,MAAM,EAAE,CAAC;QACvB,IAAI,CAAC,CAAC,KAAK,KAAK,KAAK;YAAE,IAAI,CAAC,GAAG,GAAG,EAAE,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,OAAO,EAAE,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC,MAAM,IAAI,WAAW,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC;aACvH,IAAI,CAAC,CAAC,KAAK,KAAK,KAAK;YAAE,IAAI,CAAC,GAAG,GAAG,EAAE,cAAc,EAAE,CAAC,CAAC,MAAM,CAAC,cAAc,EAAE,QAAQ,EAAE,CAAC,CAAC,MAAM,CAAC,wBAAwB,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC;QACvJ,kFAAkF;;YAC7E,IAAI,CAAC,KAAK,GAAG,EAAE,QAAQ,EAAE,CAAC,CAAC,MAAM,CAAC,QAAQ,EAAE,QAAQ,EAAE,CAAC,CAAC,MAAM,CAAC,QAA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AQ,CAAC,KAAK,CAAC;QAAE,OAAO,GAAG,KAAK,kDAAkD,CAAC;IACxF,OAAO,aAAa,CAAC,KAAK,EAAE,KAAK,EAAE,IAAI,CAAC,CAAC;AAC3C,CAAC"}
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The environments as stages of chant's pipeline (#384): `.chant/pipeline.ts`
|
|
3
|
+
* from yodel.config.ts, with chant's helpers.
|
|
4
|
+
*
|
|
5
|
+
* `ci.promotion` turns it on. yodel maps its config onto the stage keys of
|
|
6
|
+
* chant's vocabulary and hands them to chant's `pipelineFromConfig`, which
|
|
7
|
+
* writes the declaration; `pipelineSource` writes the file's text and
|
|
8
|
+
* `checkPipelineFile` is what `yodel ci --check` runs on it. Each stage's
|
|
9
|
+
* one wave is the environment's wave as `waves` and the sql lexicon's
|
|
10
|
+
* `sql-migrate` step have it today, so the gate, the approval mode, the
|
|
11
|
+
* tenant runs and the steps around apply stay yodel's keys.
|
|
12
|
+
*
|
|
13
|
+
* The merge applies the first stage. Its op-waves spec, which yodel commits
|
|
14
|
+
* as `yodel-waves.json` and every wave job reads at the base commit, is the
|
|
15
|
+
* first stage's spec from the folded file (`stageWavesSpec`), under the op
|
|
16
|
+
* name the ledger has held since the waves began, `yodel-apply`, so
|
|
17
|
+
* approvals keep counting. The last wave cuts a release (`yodel chant release
|
|
18
|
+
* cut`), and each later stage takes it through `yodel promote --to <env>`,
|
|
19
|
+
* whose gate chant reads from the folded file at the default branch.
|
|
20
|
+
*
|
|
21
|
+
* Everything here maps config. The gates, the risk score, the soak, the
|
|
22
|
+
* holds, the sets and the refusal of `onVerifyFail: "rollback"` on a
|
|
23
|
+
* `sql-migrate` stage are chant's.
|
|
24
|
+
*/
|
|
25
|
+
import { type CiConfig } from "../config/define.js";
|
|
26
|
+
/** The committed file chant folds. */
|
|
27
|
+
export declare const PIPELINE_TS = ".chant/pipeline.ts";
|
|
28
|
+
/** What the file's header names: the product, its config and the command that writes it again. */
|
|
29
|
+
export declare const PIPELINE_SOURCE_OPTIONS: {
|
|
30
|
+
readonly product: "yodel";
|
|
31
|
+
readonly config: "yodel.config.ts";
|
|
32
|
+
readonly command: "yodel ci";
|
|
33
|
+
};
|
|
34
|
+
/** Whether the project's environments are chant pipeline stages: `ci.promotion` is set. */
|
|
35
|
+
export declare const pipelineOn: (ci: Pick<CiConfig, "promotion"> | undefined) => boolean;
|
|
36
|
+
/** The line `chant.config.ts` carries under `ci.promotion`, so the merge's release cut waits for the merge commit's checks on the forge (#395). */
|
|
37
|
+
export declare const RELEASE_GREEN_LINE = "release: { green: \"forge-checks\" }";
|
|
38
|
+
/**
|
|
39
|
+
* What `yodel ci` tells a project under `ci.promotion` whose
|
|
40
|
+
* `chant.config.ts` names no `release.green`, or undefined. The merge's
|
|
41
|
+
* last wave of the first stage cuts the release (`release cut auto --yes
|
|
42
|
+
* --wait-checks`), and without `release.green` chant picks the gate: `chant`
|
|
43
|
+
* (a `ci/green/<sha>` tag the merge never writes) once the repository holds
|
|
44
|
+
* any `ci/green/` tag, else `forge-checks`. yodel does not write
|
|
45
|
+
* `chant.config.ts`, so it names the line. A project that sets
|
|
46
|
+
* `release.green` itself, or turns the cut off, hears nothing.
|
|
47
|
+
*/
|
|
48
|
+
export declare function releaseGreenNote(ci: Pick<CiConfig, "promotion" | "release"> | undefined, chantConfig: Record<string, unknown>): string | undefined;
|
|
49
|
+
/** The directories a wave job writes its plans and outcomes under, beside the waves spec. */
|
|
50
|
+
export declare const WAVE_WORK_DIRS = ".chant/op-waves/*/";
|
|
51
|
+
/**
|
|
52
|
+
* Under `ci.promotion` with the cut on, add {@link WAVE_WORK_DIRS} to the
|
|
53
|
+
* project's .gitignore. The first stage's last wave cuts the release in the
|
|
54
|
+
* same job, after the apply, and chant's cut refuses a tree with an
|
|
55
|
+
* untracked file (release-worktree-dirty), which the wave's own plans would
|
|
56
|
+
* be. True when the file changed.
|
|
57
|
+
*/
|
|
58
|
+
export declare function ignoreWaveWorkDirs(ci: Pick<CiConfig, "promotion" | "release"> | undefined, dir: string): boolean;
|
|
59
|
+
/** The stage keys yodel reads under `ci.environments.<env>`, in camelCase. */
|
|
60
|
+
export declare const STAGE_KEYS: readonly ["hold", "freeze", "failureTolerance", "approvalRules", "risk", "soak", "canary", "onVerifyFail", "after", "queue", "urgent", "pauseAfterRollback", "publish", "reads", "config", "secrets", "imports"];
|
|
61
|
+
/**
|
|
62
|
+
* What is wrong with the pipeline keys of `ci`, as yodel reads them, or
|
|
63
|
+
* undefined. `waves` is the waves' environments in order. The values are
|
|
64
|
+
* chant's to check when `yodel ci` writes the file; here are the rules that
|
|
65
|
+
* are yodel's: the promotion order is the waves' order, a stage is one of
|
|
66
|
+
* them, a key is a stage key, and a soak check is of a kind a SQL project
|
|
67
|
+
* has a reader for.
|
|
68
|
+
*/
|
|
69
|
+
export declare function pipelineConfigProblem(ci: Record<string, unknown>, waves: readonly string[] | undefined, where: string): string | undefined;
|
|
70
|
+
/** A wave of a stage, as `waves` and the sql lexicon's step have it: the forge-free part of yodel's waves spec. */
|
|
71
|
+
export interface StageWave {
|
|
72
|
+
name: string;
|
|
73
|
+
runs: Array<{
|
|
74
|
+
target: string;
|
|
75
|
+
op: string;
|
|
76
|
+
}>;
|
|
77
|
+
gate: string;
|
|
78
|
+
shares?: number;
|
|
79
|
+
approval?: string;
|
|
80
|
+
hooks?: unknown;
|
|
81
|
+
}
|
|
82
|
+
/** What {@link pipelineDeclaration} reads. */
|
|
83
|
+
export interface PipelineInput {
|
|
84
|
+
/** The pipeline's name, the op its stage gates are recorded under. */
|
|
85
|
+
name: string;
|
|
86
|
+
ci: CiConfig;
|
|
87
|
+
/** The waves spec under yodel's words, without a forge's job settings: its waves become the stages' waves, the rest the pipeline's `defaults`. */
|
|
88
|
+
spec: {
|
|
89
|
+
name: string;
|
|
90
|
+
waves: StageWave[];
|
|
91
|
+
} & Record<string, unknown>;
|
|
92
|
+
/** The command the release cut runs as, in place of `chant`. */
|
|
93
|
+
bin: string[];
|
|
94
|
+
}
|
|
95
|
+
/** A stage's `holds.risk`: its own `risk`, else `ci.risk.approveAbove` for every stage. */
|
|
96
|
+
export declare function stageRisk(ci: CiConfig, env: string): {
|
|
97
|
+
approveAbove?: number;
|
|
98
|
+
quorum?: Array<Record<string, unknown>>;
|
|
99
|
+
} | undefined;
|
|
100
|
+
/** A stage's `risk` as chant's `pipelineFromConfig` reads it: its own keys, with `ci.risk.approveAbove` where the stage sets no threshold. */
|
|
101
|
+
export declare function stageRiskConfig(ci: CiConfig, env: string): {
|
|
102
|
+
approveAbove?: number;
|
|
103
|
+
approvalRules?: Array<Record<string, unknown>>;
|
|
104
|
+
} | undefined;
|
|
105
|
+
/** The pipeline's declaration from yodel.config.ts, through chant's `pipelineFromConfig`. Throws what chant refuses. */
|
|
106
|
+
export declare function pipelineDeclaration(input: PipelineInput): Promise<import("@intentius/chant/pipeline").PipelineDeclaration>;
|
|
107
|
+
/** The text of `.chant/pipeline.ts` for `declaration`, chant's `pipelineSource`. */
|
|
108
|
+
export declare function pipelineText(declaration: import("@intentius/chant/pipeline").PipelineDeclaration): Promise<string>;
|
|
109
|
+
/**
|
|
110
|
+
* The first stage's op-waves spec from the folded text: what the merge
|
|
111
|
+
* applies. It keeps the op name the ledger holds the waves under, `name`.
|
|
112
|
+
* Throws when the text does not fold.
|
|
113
|
+
*/
|
|
114
|
+
export declare function firstStageSpec(text: string, name: string): Promise<Record<string, unknown> & {
|
|
115
|
+
name: string;
|
|
116
|
+
waves: StageWave[];
|
|
117
|
+
}>;
|
|
118
|
+
/** The stages after the first: the ones the promote jobs reach. */
|
|
119
|
+
export declare const laterStages: (ci: CiConfig) => string[];
|
|
120
|
+
/**
|
|
121
|
+
* chant's environment sets from `ci.environments.<env>` and `ci.configSets`,
|
|
122
|
+
* or undefined when no stage names a set. Every wave environment gets a
|
|
123
|
+
* set, an empty one when it names none, since chant refuses an environment
|
|
124
|
+
* the sets leave out.
|
|
125
|
+
*/
|
|
126
|
+
export declare function environmentSetsOf(ci: CiConfig | undefined, envs: readonly string[]): import("@intentius/chant/components").EnvironmentSets | undefined;
|
|
@@ -0,0 +1,292 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The environments as stages of chant's pipeline (#384): `.chant/pipeline.ts`
|
|
3
|
+
* from yodel.config.ts, with chant's helpers.
|
|
4
|
+
*
|
|
5
|
+
* `ci.promotion` turns it on. yodel maps its config onto the stage keys of
|
|
6
|
+
* chant's vocabulary and hands them to chant's `pipelineFromConfig`, which
|
|
7
|
+
* writes the declaration; `pipelineSource` writes the file's text and
|
|
8
|
+
* `checkPipelineFile` is what `yodel ci --check` runs on it. Each stage's
|
|
9
|
+
* one wave is the environment's wave as `waves` and the sql lexicon's
|
|
10
|
+
* `sql-migrate` step have it today, so the gate, the approval mode, the
|
|
11
|
+
* tenant runs and the steps around apply stay yodel's keys.
|
|
12
|
+
*
|
|
13
|
+
* The merge applies the first stage. Its op-waves spec, which yodel commits
|
|
14
|
+
* as `yodel-waves.json` and every wave job reads at the base commit, is the
|
|
15
|
+
* first stage's spec from the folded file (`stageWavesSpec`), under the op
|
|
16
|
+
* name the ledger has held since the waves began, `yodel-apply`, so
|
|
17
|
+
* approvals keep counting. The last wave cuts a release (`yodel chant release
|
|
18
|
+
* cut`), and each later stage takes it through `yodel promote --to <env>`,
|
|
19
|
+
* whose gate chant reads from the folded file at the default branch.
|
|
20
|
+
*
|
|
21
|
+
* Everything here maps config. The gates, the risk score, the soak, the
|
|
22
|
+
* holds, the sets and the refusal of `onVerifyFail: "rollback"` on a
|
|
23
|
+
* `sql-migrate` stage are chant's.
|
|
24
|
+
*/
|
|
25
|
+
import { existsSync, readFileSync, writeFileSync } from "node:fs";
|
|
26
|
+
import { join } from "node:path";
|
|
27
|
+
import { CI_SOAK_CHECK_KINDS } from "../config/define.js";
|
|
28
|
+
/** The committed file chant folds. */
|
|
29
|
+
export const PIPELINE_TS = ".chant/pipeline.ts";
|
|
30
|
+
/** What the file's header names: the product, its config and the command that writes it again. */
|
|
31
|
+
export const PIPELINE_SOURCE_OPTIONS = { product: "yodel", config: "yodel.config.ts", command: "yodel ci" };
|
|
32
|
+
/** Whether the project's environments are chant pipeline stages: `ci.promotion` is set. */
|
|
33
|
+
export const pipelineOn = (ci) => ci?.promotion !== undefined;
|
|
34
|
+
/** The line `chant.config.ts` carries under `ci.promotion`, so the merge's release cut waits for the merge commit's checks on the forge (#395). */
|
|
35
|
+
export const RELEASE_GREEN_LINE = 'release: { green: "forge-checks" }';
|
|
36
|
+
/**
|
|
37
|
+
* What `yodel ci` tells a project under `ci.promotion` whose
|
|
38
|
+
* `chant.config.ts` names no `release.green`, or undefined. The merge's
|
|
39
|
+
* last wave of the first stage cuts the release (`release cut auto --yes
|
|
40
|
+
* --wait-checks`), and without `release.green` chant picks the gate: `chant`
|
|
41
|
+
* (a `ci/green/<sha>` tag the merge never writes) once the repository holds
|
|
42
|
+
* any `ci/green/` tag, else `forge-checks`. yodel does not write
|
|
43
|
+
* `chant.config.ts`, so it names the line. A project that sets
|
|
44
|
+
* `release.green` itself, or turns the cut off, hears nothing.
|
|
45
|
+
*/
|
|
46
|
+
export function releaseGreenNote(ci, chantConfig) {
|
|
47
|
+
if (!pipelineOn(ci) || ci?.release?.cut === false)
|
|
48
|
+
return undefined;
|
|
49
|
+
const green = isRecord(chantConfig.release) ? chantConfig.release.green : undefined;
|
|
50
|
+
if (green !== undefined)
|
|
51
|
+
return undefined;
|
|
52
|
+
return `chant.config.ts: set ${RELEASE_GREEN_LINE} in it, so the release cut on merge waits for the merge commit's checks on the forge`;
|
|
53
|
+
}
|
|
54
|
+
/** The directories a wave job writes its plans and outcomes under, beside the waves spec. */
|
|
55
|
+
export const WAVE_WORK_DIRS = ".chant/op-waves/*/";
|
|
56
|
+
/**
|
|
57
|
+
* Under `ci.promotion` with the cut on, add {@link WAVE_WORK_DIRS} to the
|
|
58
|
+
* project's .gitignore. The first stage's last wave cuts the release in the
|
|
59
|
+
* same job, after the apply, and chant's cut refuses a tree with an
|
|
60
|
+
* untracked file (release-worktree-dirty), which the wave's own plans would
|
|
61
|
+
* be. True when the file changed.
|
|
62
|
+
*/
|
|
63
|
+
export function ignoreWaveWorkDirs(ci, dir) {
|
|
64
|
+
if (!pipelineOn(ci) || ci?.release?.cut === false)
|
|
65
|
+
return false;
|
|
66
|
+
const path = join(dir, ".gitignore");
|
|
67
|
+
const before = existsSync(path) ? readFileSync(path, "utf8") : "";
|
|
68
|
+
if (before.split(/\r?\n/).some((l) => l.trim() === WAVE_WORK_DIRS))
|
|
69
|
+
return false;
|
|
70
|
+
writeFileSync(path, `${before}${before === "" || before.endsWith("\n") ? "" : "\n"}${WAVE_WORK_DIRS}\n`);
|
|
71
|
+
return true;
|
|
72
|
+
}
|
|
73
|
+
/** The stage keys yodel reads under `ci.environments.<env>`, in camelCase. */
|
|
74
|
+
export const STAGE_KEYS = [
|
|
75
|
+
"hold",
|
|
76
|
+
"freeze",
|
|
77
|
+
"failureTolerance",
|
|
78
|
+
"approvalRules",
|
|
79
|
+
"risk",
|
|
80
|
+
"soak",
|
|
81
|
+
"canary",
|
|
82
|
+
"onVerifyFail",
|
|
83
|
+
"after",
|
|
84
|
+
"queue",
|
|
85
|
+
"urgent",
|
|
86
|
+
"pauseAfterRollback",
|
|
87
|
+
"publish",
|
|
88
|
+
"reads",
|
|
89
|
+
"config",
|
|
90
|
+
"secrets",
|
|
91
|
+
"imports",
|
|
92
|
+
];
|
|
93
|
+
/** `value` without the keys `keys`. */
|
|
94
|
+
const omit = (value, keys) => Object.fromEntries(Object.entries(value).filter(([k]) => !keys.includes(k)));
|
|
95
|
+
const isRecord = (v) => typeof v === "object" && v !== null && !Array.isArray(v);
|
|
96
|
+
/**
|
|
97
|
+
* What is wrong with the pipeline keys of `ci`, as yodel reads them, or
|
|
98
|
+
* undefined. `waves` is the waves' environments in order. The values are
|
|
99
|
+
* chant's to check when `yodel ci` writes the file; here are the rules that
|
|
100
|
+
* are yodel's: the promotion order is the waves' order, a stage is one of
|
|
101
|
+
* them, a key is a stage key, and a soak check is of a kind a SQL project
|
|
102
|
+
* has a reader for.
|
|
103
|
+
*/
|
|
104
|
+
export function pipelineConfigProblem(ci, waves, where) {
|
|
105
|
+
const promotion = ci.promotion;
|
|
106
|
+
const stageKeys = ["environments", "approvalRules", "risk", "configSets", "release", "recheck"].filter((k) => ci[k] !== undefined);
|
|
107
|
+
if (promotion === undefined) {
|
|
108
|
+
// Without a pipeline, the sets reach the wave jobs and the risk score the plan note; the rest are stage keys.
|
|
109
|
+
const only = stageKeys.filter((k) => k !== "risk" && k !== "configSets" && k !== "environments");
|
|
110
|
+
if (only.length > 0)
|
|
111
|
+
return `${where}.${String(only[0])}: a pipeline key, read with ci.promotion; set ci.promotion to the environments in order`;
|
|
112
|
+
const envs = ci.environments;
|
|
113
|
+
if (envs === undefined)
|
|
114
|
+
return undefined;
|
|
115
|
+
if (!isRecord(envs))
|
|
116
|
+
return `${where}.environments: a map of stage settings, keyed by environment`;
|
|
117
|
+
for (const [env, stage] of Object.entries(envs)) {
|
|
118
|
+
const at = `${where}.environments.${env}`;
|
|
119
|
+
if (waves && !waves.includes(env))
|
|
120
|
+
return `${at}: ${env} has no wave (waves: ${waves.join(", ")})`;
|
|
121
|
+
const problem = stageProblem(stage, at);
|
|
122
|
+
if (problem)
|
|
123
|
+
return problem;
|
|
124
|
+
const staged = Object.keys(stage).filter((k) => !["config", "secrets", "imports", "risk"].includes(k));
|
|
125
|
+
if (staged.length > 0)
|
|
126
|
+
return `${at}.${String(staged[0])}: a stage key, read with ci.promotion; set ci.promotion to the environments in order`;
|
|
127
|
+
}
|
|
128
|
+
return undefined;
|
|
129
|
+
}
|
|
130
|
+
if (!Array.isArray(promotion) || promotion.length === 0 || !promotion.every((e) => typeof e === "string" && e !== ""))
|
|
131
|
+
return `${where}.promotion: the environments in promotion order, a list of names`;
|
|
132
|
+
if (waves && (promotion.length !== waves.length || promotion.some((e, i) => e !== waves[i]))) {
|
|
133
|
+
return `${where}.promotion: ${promotion.join(", ")}; the waves apply ${waves.join(", ")}, and the promotion order is the waves' order`;
|
|
134
|
+
}
|
|
135
|
+
const envs = ci.environments;
|
|
136
|
+
if (envs !== undefined) {
|
|
137
|
+
if (!isRecord(envs))
|
|
138
|
+
return `${where}.environments: a map of stage settings, keyed by environment`;
|
|
139
|
+
for (const [env, stage] of Object.entries(envs)) {
|
|
140
|
+
const at = `${where}.environments.${env}`;
|
|
141
|
+
if (!promotion.includes(env))
|
|
142
|
+
return `${at}: ${env} is not a stage (ci.promotion: ${promotion.join(", ")})`;
|
|
143
|
+
const problem = stageProblem(stage, at);
|
|
144
|
+
if (problem)
|
|
145
|
+
return problem;
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
for (const key of ["approvalRules"])
|
|
149
|
+
if (ci[key] !== undefined && !Array.isArray(ci[key]))
|
|
150
|
+
return `${where}.${key}: a list of approval rules`;
|
|
151
|
+
const release = ci.release;
|
|
152
|
+
if (release !== undefined && !(isRecord(release) && Object.keys(release).every((k) => k === "cut" || k === "label") && (release.cut === undefined || typeof release.cut === "boolean") && (release.label === undefined || typeof release.label === "string"))) {
|
|
153
|
+
return `${where}.release: { cut?: true or false, label?: a label, or "auto" }`;
|
|
154
|
+
}
|
|
155
|
+
const recheck = ci.recheck;
|
|
156
|
+
if (recheck !== undefined && !(isRecord(recheck) && Object.keys(recheck).every((k) => k === "schedule") && typeof recheck.schedule === "string" && recheck.schedule.trim().split(/\s+/).length === 5)) {
|
|
157
|
+
return `${where}.recheck: { schedule } with a five-field cron, such as { schedule: "*/15 * * * *" }`;
|
|
158
|
+
}
|
|
159
|
+
return undefined;
|
|
160
|
+
}
|
|
161
|
+
/** One stage's settings: the stage keys, and soak checks of the kinds a SQL project reads. */
|
|
162
|
+
function stageProblem(stage, at) {
|
|
163
|
+
if (!isRecord(stage))
|
|
164
|
+
return `${at}: a map of stage settings`;
|
|
165
|
+
for (const k of Object.keys(stage))
|
|
166
|
+
if (!STAGE_KEYS.includes(k))
|
|
167
|
+
return `${at}.${k}: unknown stage setting (expected ${STAGE_KEYS.join(", ")})`;
|
|
168
|
+
const soak = stage.soak;
|
|
169
|
+
if (soak !== undefined) {
|
|
170
|
+
if (!isRecord(soak) || typeof soak.duration !== "string")
|
|
171
|
+
return `${at}.soak: { duration, checks?, overrides? }, such as { duration: "30m", checks: [...] }`;
|
|
172
|
+
const lists = [soak.checks, ...(Array.isArray(soak.overrides) ? soak.overrides.map((o) => (isRecord(o) ? o.checks : undefined)) : [])];
|
|
173
|
+
for (const list of lists) {
|
|
174
|
+
if (list === undefined)
|
|
175
|
+
continue;
|
|
176
|
+
if (!Array.isArray(list))
|
|
177
|
+
return `${at}.soak.checks: a list of checks`;
|
|
178
|
+
for (const check of list) {
|
|
179
|
+
const kind = isRecord(check) ? check.kind : undefined;
|
|
180
|
+
if (!CI_SOAK_CHECK_KINDS.includes(kind)) {
|
|
181
|
+
return `${at}.soak: a check of kind ${JSON.stringify(kind)}; a SQL stage soaks on ${CI_SOAK_CHECK_KINDS.join(", ")} checks${kind === "health" ? " (the sql lexicon has no lifecycle health reader)" : ""}`;
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
const risk = stage.risk;
|
|
187
|
+
if (risk !== undefined && !(isRecord(risk) && Object.keys(risk).every((k) => k === "approveAbove" || k === "approvalRules")))
|
|
188
|
+
return `${at}.risk: { approveAbove?, approvalRules? }`;
|
|
189
|
+
return undefined;
|
|
190
|
+
}
|
|
191
|
+
const ruleOf = (r) => ("all" in r ? { ...r, all: r.all.map(ruleOf) } : "any" in r ? { ...r, any: r.any.map(ruleOf) } : { ...r });
|
|
192
|
+
/** The quorum rules a stage's `risk.approvalRules` adds over its score, as chant's `holds.risk.quorum` takes them. */
|
|
193
|
+
function riskQuorum(rules) {
|
|
194
|
+
if (!rules || rules.length === 0)
|
|
195
|
+
return undefined;
|
|
196
|
+
return rules.map((r) => ({ ...(r.name !== undefined ? { name: r.name } : {}), count: r.count, ...(r.roles ? { roles: [...r.roles] } : {}), ...(r.notAuthor ? { notAuthor: true } : {}), ...(r.proven ? { proven: true } : {}) }));
|
|
197
|
+
}
|
|
198
|
+
/** A stage's `holds.risk`: its own `risk`, else `ci.risk.approveAbove` for every stage. */
|
|
199
|
+
export function stageRisk(ci, env) {
|
|
200
|
+
const own = ci.environments?.[env]?.risk;
|
|
201
|
+
const approveAbove = own?.approveAbove ?? ci.risk?.approveAbove;
|
|
202
|
+
const quorum = riskQuorum(own?.approvalRules);
|
|
203
|
+
if (approveAbove === undefined && quorum === undefined)
|
|
204
|
+
return undefined;
|
|
205
|
+
return { ...(approveAbove !== undefined ? { approveAbove } : {}), ...(quorum ? { quorum } : {}) };
|
|
206
|
+
}
|
|
207
|
+
/** A stage's `risk` as chant's `pipelineFromConfig` reads it: its own keys, with `ci.risk.approveAbove` where the stage sets no threshold. */
|
|
208
|
+
export function stageRiskConfig(ci, env) {
|
|
209
|
+
const own = ci.environments?.[env]?.risk;
|
|
210
|
+
const approveAbove = own?.approveAbove ?? ci.risk?.approveAbove;
|
|
211
|
+
const rules = own?.approvalRules && own.approvalRules.length > 0 ? own.approvalRules.map(ruleOf) : undefined;
|
|
212
|
+
if (approveAbove === undefined && rules === undefined)
|
|
213
|
+
return undefined;
|
|
214
|
+
return { ...(approveAbove !== undefined ? { approveAbove } : {}), ...(rules ? { approvalRules: rules } : {}) };
|
|
215
|
+
}
|
|
216
|
+
/** The pipeline's declaration from yodel.config.ts, through chant's `pipelineFromConfig`. Throws what chant refuses. */
|
|
217
|
+
export async function pipelineDeclaration(input) {
|
|
218
|
+
const { pipelineFromConfig, verifyRollbackProblems } = await import("@intentius/chant/pipeline");
|
|
219
|
+
const { ci } = input;
|
|
220
|
+
const promotion = ci.promotion ?? [];
|
|
221
|
+
const { waves } = input.spec;
|
|
222
|
+
const defaults = omit(input.spec, ["name", "waves"]);
|
|
223
|
+
const byEnv = Object.fromEntries(promotion.map((env) => [env, waves.filter((w) => w.name === env)]));
|
|
224
|
+
const environments = Object.fromEntries(promotion.map((env) => {
|
|
225
|
+
const stage = ci.environments?.[env] ?? {};
|
|
226
|
+
const { approvalRules } = stage;
|
|
227
|
+
const keys = omit(stage, ["risk", "approvalRules", "config", "secrets", "imports"]);
|
|
228
|
+
// The risk keys (chant's `environments.<name>.risk`): the stage's own, else `ci.risk.approveAbove`; chant puts them on the gate's `holds.risk`.
|
|
229
|
+
const risk = stageRiskConfig(ci, env);
|
|
230
|
+
return [env, { ...keys, ...(approvalRules ? { approvalRules: approvalRules.map(ruleOf) } : {}), ...(risk ? { risk } : {}) }];
|
|
231
|
+
}));
|
|
232
|
+
const declaration = pipelineFromConfig({
|
|
233
|
+
name: input.name,
|
|
234
|
+
promotion,
|
|
235
|
+
environments: environments,
|
|
236
|
+
...(ci.approvalRules ? { approvalRules: ci.approvalRules.map(ruleOf) } : {}),
|
|
237
|
+
waves: byEnv,
|
|
238
|
+
defaults,
|
|
239
|
+
release: { ...(ci.release?.cut !== undefined ? { cut: ci.release.cut } : {}), ...(ci.release?.label !== undefined ? { label: ci.release.label } : {}), bin: [...input.bin] },
|
|
240
|
+
...(ci.recheck ? { recheck: { schedule: ci.recheck.schedule } } : {}),
|
|
241
|
+
});
|
|
242
|
+
// chant refuses onVerifyFail: "rollback" on a stage that applies a sql-migrate step: a migration that ran stays run.
|
|
243
|
+
const step = defaults.step;
|
|
244
|
+
const refused = verifyRollbackProblems({ spec: declaration, steps: step?.kind ? [{ where: "defaults.step", kind: step.kind }] : [], capability: () => undefined });
|
|
245
|
+
if (refused.length > 0)
|
|
246
|
+
throw new Error(`yodel.config.ts: ci.environments: ${refused.join("; ")}`);
|
|
247
|
+
return declaration;
|
|
248
|
+
}
|
|
249
|
+
/** The text of `.chant/pipeline.ts` for `declaration`, chant's `pipelineSource`. */
|
|
250
|
+
export async function pipelineText(declaration) {
|
|
251
|
+
const { pipelineSource } = await import("@intentius/chant/pipeline");
|
|
252
|
+
return pipelineSource(declaration, PIPELINE_SOURCE_OPTIONS);
|
|
253
|
+
}
|
|
254
|
+
/**
|
|
255
|
+
* The first stage's op-waves spec from the folded text: what the merge
|
|
256
|
+
* applies. It keeps the op name the ledger holds the waves under, `name`.
|
|
257
|
+
* Throws when the text does not fold.
|
|
258
|
+
*/
|
|
259
|
+
export async function firstStageSpec(text, name) {
|
|
260
|
+
const { foldPipelineSource, pipelineFindingLine, stageWavesSpec } = await import("@intentius/chant/pipeline");
|
|
261
|
+
const folded = foldPipelineSource(text, PIPELINE_TS);
|
|
262
|
+
if ("finding" in folded)
|
|
263
|
+
throw new Error(pipelineFindingLine(PIPELINE_TS, folded.finding));
|
|
264
|
+
const first = folded.spec.stages[0];
|
|
265
|
+
if (!first)
|
|
266
|
+
throw new Error(`${PIPELINE_TS}: the pipeline has no stage`);
|
|
267
|
+
const spec = omit(stageWavesSpec(folded.spec, first.name), ["labels"]);
|
|
268
|
+
return { ...spec, name, waves: spec.waves };
|
|
269
|
+
}
|
|
270
|
+
/** The stages after the first: the ones the promote jobs reach. */
|
|
271
|
+
export const laterStages = (ci) => (ci.promotion ?? []).slice(1);
|
|
272
|
+
/**
|
|
273
|
+
* chant's environment sets from `ci.environments.<env>` and `ci.configSets`,
|
|
274
|
+
* or undefined when no stage names a set. Every wave environment gets a
|
|
275
|
+
* set, an empty one when it names none, since chant refuses an environment
|
|
276
|
+
* the sets leave out.
|
|
277
|
+
*/
|
|
278
|
+
export function environmentSetsOf(ci, envs) {
|
|
279
|
+
const named = Object.entries(ci?.environments ?? {}).filter(([, s]) => s.config !== undefined || s.secrets !== undefined || s.imports !== undefined);
|
|
280
|
+
if (named.length === 0 && ci?.configSets === undefined)
|
|
281
|
+
return undefined;
|
|
282
|
+
const set = (s) => ({
|
|
283
|
+
...(s?.imports ? { imports: [...s.imports] } : {}),
|
|
284
|
+
...(s?.config ? { config: { ...s.config } } : {}),
|
|
285
|
+
...(s?.secrets ? { secrets: structuredClone(s.secrets) } : {}),
|
|
286
|
+
});
|
|
287
|
+
return {
|
|
288
|
+
environments: Object.fromEntries(envs.map((env) => [env, set(ci?.environments?.[env])])),
|
|
289
|
+
...(ci?.configSets ? { configSets: structuredClone(ci.configSets) } : {}),
|
|
290
|
+
};
|
|
291
|
+
}
|
|
292
|
+
//# sourceMappingURL=pipeline.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pipeline.js","sourceRoot":"","sources":["../../src/ci/pipeline.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAClE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,mBAAmB,EAA0D,MAAM,qBAAqB,CAAC;AAElH,sCAAsC;AACtC,MAAM,CAAC,MAAM,WAAW,GAAG,oBAAoB,CAAC;AAEhD,kGAAkG;AAClG,MAAM,CAAC,MAAM,uBAAuB,GAAG,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,iBAAiB,EAAE,OAAO,EAAE,UAAU,EAAW,CAAC;AAErH,2FAA2F;AAC3F,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,EAA2C,EAAW,EAAE,CAAC,EAAE,EAAE,SAAS,KAAK,SAAS,CAAC;AAEhH,mJAAmJ;AACnJ,MAAM,CAAC,MAAM,kBAAkB,GAAG,oCAAoC,CAAC;AAEvE;;;;;;;;;GASG;AACH,MAAM,UAAU,gBAAgB,CAAC,EAAuD,EAAE,WAAoC;IAC5H,IAAI,CAAC,UAAU,CAAC,EAAE,CAAC,IAAI,EAAE,EAAE,OAAO,EAAE,GAAG,KAAK,KAAK;QAAE,OAAO,SAAS,CAAC;IACpE,MAAM,KAAK,GAAG,QAAQ,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC;IACpF,IA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EAAE,CAAC;QAClD,GAAG,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,EAAE,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QACjD,GAAG,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,eAAe,CAAC,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;KAC/D,CAAC,CAAC;IACH,OAAO;QACL,YAAY,EAAE,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,GAAG,EAAE,GAAG,CAAC,EAAE,EAAE,YAAY,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;QACxF,GAAG,CAAC,EAAE,EAAE,UAAU,CAAC,CAAC,CAAC,EAAE,UAAU,EAAE,eAAe,CAAC,EAAE,CAAC,UAAU,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;KAC1E,CAAC;AACJ,CAAC"}
|
package/dist/ci/render.d.ts
CHANGED
|
@@ -76,7 +76,8 @@
|
|
|
76
76
|
* yodel ci renders through chant's product pipeline (chant#4550) with
|
|
77
77
|
* yodel's words (#289, ../ci-words.ts): {@link productWaves}.
|
|
78
78
|
*/
|
|
79
|
-
import { type ApplySteps, type ApprovalMode, type CiEvidence, type CiLogin, type RespondNew, type RespondRebase, type WaveGate } from "../config/define.js";
|
|
79
|
+
import { type ApplySteps, type ApprovalMode, type CiAgentWaveRefused, type CiConfig, type CiEvidence, type CiLogin, type RespondNew, type RespondRebase, type RespondWaveRefused, type WaveGate } from "../config/define.js";
|
|
80
|
+
import type { EnvironmentSets } from "@intentius/chant/components";
|
|
80
81
|
import type { OpWaveHooks } from "@intentius/chant/op";
|
|
81
82
|
import { type CloudToken, type Role } from "../credentials.js";
|
|
82
83
|
import { type CheckHook } from "./check-hooks.js";
|
|
@@ -171,6 +172,18 @@ export interface Environments {
|
|
|
171
172
|
respondNew?: RespondNew;
|
|
172
173
|
/** yodel.config.ts `ci.respond.rebase` (#313): what answers `/yodel rebase`. Default `comment`, or `off` when a reader's password is cloud-minted. */
|
|
173
174
|
respondRebase?: RespondRebase;
|
|
175
|
+
/** yodel.config.ts `ci.respond.wave-refused`: whether a wave that applied nothing posts chant's diff of the plan. Unset, the spec says nothing and chant's default answers. */
|
|
176
|
+
respondWaveRefused?: RespondWaveRefused;
|
|
177
|
+
/** yodel.config.ts `ci.agent["wave-refused"]`: the model run of `respond.wave-refused: "summary"`. */
|
|
178
|
+
agentWaveRefused?: CiAgentWaveRefused;
|
|
179
|
+
/**
|
|
180
|
+
* yodel.config.ts `ci` with `ci.promotion` set (#384): the environments are
|
|
181
|
+
* stages of chant's pipeline, `.chant/pipeline.ts` is written from it, the
|
|
182
|
+
* merge applies the first stage and the promote jobs the rest.
|
|
183
|
+
*/
|
|
184
|
+
pipeline?: CiConfig;
|
|
185
|
+
/** chant's environment sets from `ci.environments.<env>` and `ci.configSets` (#384): each wave job and promote job gets its stage's set. */
|
|
186
|
+
environmentSets?: EnvironmentSets;
|
|
174
187
|
}
|
|
175
188
|
/** yodel's checks and the project's tools as check-hook presets for `forge` (#294). */
|
|
176
189
|
export declare function checkHooksOf(envs_: Environments): CheckHook[];
|
|
@@ -379,6 +392,18 @@ interface WavesSpec {
|
|
|
379
392
|
idTokens?: Record<string, string>;
|
|
380
393
|
hooks?: OpWaveHooks;
|
|
381
394
|
}>;
|
|
395
|
+
/** The responses a wave job posts (chant's `respond`): `wave-refused` as `ci.respond.wave-refused` sets it; absent when the project leaves it unset, so the rendered files are as before. */
|
|
396
|
+
respond?: {
|
|
397
|
+
"wave-refused": RespondWaveRefused;
|
|
398
|
+
};
|
|
399
|
+
/** chant's `waveSummary`, the model run of `wave-refused: summary`: `ci.agent["wave-refused"]` mapped onto chant's field names. Present with that mode only. */
|
|
400
|
+
waveSummary?: {
|
|
401
|
+
command?: string;
|
|
402
|
+
keyEnv?: string;
|
|
403
|
+
timeout?: number;
|
|
404
|
+
maxRuns?: number;
|
|
405
|
+
maxCostUsd?: number;
|
|
406
|
+
};
|
|
382
407
|
/** The scheduled resume job (yodel.config.ts `ci.resume`); only the pipelines are rendered from it, the spec file leaves it out. */
|
|
383
408
|
resume?: {
|
|
384
409
|
schedule: string;
|
|
@@ -412,7 +437,7 @@ export interface WaveJobSettings {
|
|
|
412
437
|
*/
|
|
413
438
|
export declare function wavesSpec(waves: readonly Wave[], job?: (env: string) => WaveJobSettings, resume?: {
|
|
414
439
|
schedule: string;
|
|
415
|
-
}): WavesSpec;
|
|
440
|
+
}, waveRefused?: RespondWaveRefused, summary?: CiAgentWaveRefused): WavesSpec;
|
|
416
441
|
/** The sql lexicon's capability for a versioned environment (chant#4569). */
|
|
417
442
|
export declare const SQL_MIGRATE = "sql-migrate";
|
|
418
443
|
/**
|
|
@@ -426,6 +451,26 @@ export declare const SQL_MIGRATE = "sql-migrate";
|
|
|
426
451
|
* variables and OIDC tokens in the spec.
|
|
427
452
|
*/
|
|
428
453
|
export declare function applyPipelines(dir: string, envs: Environments, product: ChantProduct): Promise<RenderedFile[]>;
|
|
454
|
+
/**
|
|
455
|
+
* The job's token a GitHub or Forgejo wave job's command gets, with the
|
|
456
|
+
* scopes it needs beside chant's own, or undefined for none. A refused
|
|
457
|
+
* wave's diff is posted with it: pull request comments, and the tracking
|
|
458
|
+
* issue a wave with no pull request uses. With `ci.promotion` the first
|
|
459
|
+
* stage's last wave cuts the release, and under `release.green:
|
|
460
|
+
* "forge-checks"` (chant's default without `ci.green`) the cut reads the
|
|
461
|
+
* merge commit's checks and statuses with it (#395).
|
|
462
|
+
*/
|
|
463
|
+
export declare function commandToken(forge: Forge, respondWaveRefused: RespondWaveRefused | undefined, pipeline: CiConfig | undefined): {
|
|
464
|
+
commandToken: {
|
|
465
|
+
permissions: Record<string, "read" | "write">;
|
|
466
|
+
};
|
|
467
|
+
} | undefined;
|
|
468
|
+
/** The reject comment workflow's job (#384). */
|
|
469
|
+
export declare const REJECT_JOB = "reject";
|
|
470
|
+
/** Where the promote jobs go on GitLab: their own file, which `.gitlab-ci.yml` includes. */
|
|
471
|
+
export declare const GITLAB_PROMOTE_FILE = ".gitlab/yodel-apply-promote.gitlab-ci.yml";
|
|
472
|
+
/** The stage chant's GitLab promote jobs run in: they name none, so GitLab's default. */
|
|
473
|
+
export declare const PROMOTE_STAGE = "test";
|
|
429
474
|
/** yodel.config.ts `waves`, checked against the environments; one wave per environment, gate `always`, without it. */
|
|
430
475
|
export declare function readWaves(dir: string, envs: readonly string[]): Promise<Wave[]>;
|
|
431
476
|
/**
|
|
@@ -541,11 +586,12 @@ export declare function requireProduct(): Promise<ChantProduct>;
|
|
|
541
586
|
* check hooks into when the project has none on disk: the one `yodel
|
|
542
587
|
* upgrade` adds (#298). A project with no declaration, in its directory or
|
|
543
588
|
* given here, keeps the lint job's own steps ({@link checkHooksDeclaration}).
|
|
544
|
-
* `options.respondNew` and `options.
|
|
589
|
+
* `options.respondNew`, `options.respondRebase` and `options.respondWaveRefused` stand in for yodel.config.ts `ci.respond`.
|
|
545
590
|
*/
|
|
546
591
|
export declare function render(dir: string, options?: {
|
|
547
592
|
declaration?: RenderedFile;
|
|
548
593
|
respondNew?: RespondNew;
|
|
549
594
|
respondRebase?: RespondRebase;
|
|
595
|
+
respondWaveRefused?: RespondWaveRefused;
|
|
550
596
|
}): Promise<RenderedFile[]>;
|
|
551
597
|
export {};
|