@intentius/chant 0.124.30 → 0.124.31

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (72) hide show
  1. package/dist/cli/main.d.ts.map +1 -1
  2. package/dist/cli/main.js +38 -4
  3. package/dist/cli/parse-args.d.ts.map +1 -1
  4. package/dist/cli/parse-args.js +50 -0
  5. package/dist/cli/registry.d.ts +18 -0
  6. package/dist/cli/registry.d.ts.map +1 -1
  7. package/dist/op/local-executor.d.ts +12 -0
  8. package/dist/op/local-executor.d.ts.map +1 -1
  9. package/dist/op/local-executor.js +22 -3
  10. package/dist/op/redact.d.ts +34 -0
  11. package/dist/op/redact.d.ts.map +1 -0
  12. package/dist/op/redact.js +94 -0
  13. package/dist/op/step-console.d.ts +2 -0
  14. package/dist/op/step-console.d.ts.map +1 -1
  15. package/dist/op/step-console.js +5 -2
  16. package/dist/pr-forge.d.ts +17 -0
  17. package/dist/pr-forge.d.ts.map +1 -1
  18. package/dist/pr-forge.js +12 -6
  19. package/dist/pr-report-url.d.ts +8 -0
  20. package/dist/pr-report-url.d.ts.map +1 -1
  21. package/dist/pr-report-url.js +47 -1
  22. package/dist/wave-runtime.mjs +159 -159
  23. package/dist/workspace/ci-run-index.d.ts +96 -0
  24. package/dist/workspace/ci-run-index.d.ts.map +1 -0
  25. package/dist/workspace/ci-run-index.js +162 -0
  26. package/dist/workspace/ci-run-index.schema.json +50 -0
  27. package/dist/workspace/ci-run.d.ts +84 -7
  28. package/dist/workspace/ci-run.d.ts.map +1 -1
  29. package/dist/workspace/ci-run.js +241 -14
  30. package/dist/workspace/ci-runner-key.d.ts +120 -0
  31. package/dist/workspace/ci-runner-key.d.ts.map +1 -0
  32. package/dist/workspace/ci-runner-key.js +217 -0
  33. package/dist/workspace/ci-secrets.d.ts +65 -0
  34. package/dist/workspace/ci-secrets.d.ts.map +1 -0
  35. package/dist/workspace/ci-secrets.js +211 -0
  36. package/dist/workspace/ci-serve.d.ts +13 -0
  37. package/dist/workspace/ci-serve.d.ts.map +1 -1
  38. package/dist/workspace/ci-serve.js +69 -13
  39. package/dist/workspace/reason-codes.d.ts +6 -2
  40. package/dist/workspace/reason-codes.d.ts.map +1 -1
  41. package/dist/workspace/reason-codes.js +7 -2
  42. package/dist/workspace/trust/trust-write.d.ts +109 -0
  43. package/dist/workspace/trust/trust-write.d.ts.map +1 -0
  44. package/dist/workspace/trust/trust-write.js +320 -0
  45. package/dist/workspace/trust-write.schema.json +265 -0
  46. package/package.json +1 -1
  47. package/src/cli/main.test.ts +1 -0
  48. package/src/cli/main.ts +38 -4
  49. package/src/cli/parse-args.ts +36 -0
  50. package/src/cli/registry.ts +18 -0
  51. package/src/op/local-executor.ts +31 -3
  52. package/src/op/redact.ts +93 -0
  53. package/src/op/step-console.ts +7 -2
  54. package/src/pr-forge.test.ts +29 -0
  55. package/src/pr-forge.ts +30 -6
  56. package/src/pr-report-url.ts +53 -1
  57. package/src/workspace/ci-run-index.schema.json +50 -0
  58. package/src/workspace/ci-run-index.test.ts +353 -0
  59. package/src/workspace/ci-run-index.ts +192 -0
  60. package/src/workspace/ci-run.test.ts +337 -37
  61. package/src/workspace/ci-run.ts +277 -15
  62. package/src/workspace/ci-runner-key.test.ts +166 -0
  63. package/src/workspace/ci-runner-key.ts +250 -0
  64. package/src/workspace/ci-secrets.test.ts +106 -0
  65. package/src/workspace/ci-secrets.ts +213 -0
  66. package/src/workspace/ci-serve.test.ts +136 -37
  67. package/src/workspace/ci-serve.ts +66 -13
  68. package/src/workspace/reason-codes.test.ts +2 -0
  69. package/src/workspace/reason-codes.ts +7 -2
  70. package/src/workspace/trust/trust-write.test.ts +179 -0
  71. package/src/workspace/trust/trust-write.ts +377 -0
  72. package/src/workspace/trust-write.schema.json +265 -0
@@ -0,0 +1,96 @@
1
+ /**
2
+ * The run index (#4098, epic #4101): where the chant runner says which jobs it
3
+ * ran, at the `--report-url` root, for behold and the demo kiosk to find runs
4
+ * without a forge or a workflow file.
5
+ *
6
+ * ```
7
+ * <url>/runs/index.json
8
+ * ```
9
+ *
10
+ * One document, `ci-run-index/v1` (`ci-run-index.schema.json`). Each settled
11
+ * `chant ci run` job with `--report-url` set adds an entry to its front, so
12
+ * the newest run is first, and the list is cut to the newest `limit` entries,
13
+ * 200 by default. An entry's `key` is the folder the job's report went to
14
+ * (`reportKey`, `<pr>/<commit>`), so a reader goes from the index to
15
+ * `<url>/<key>/pr-<job>.json`.
16
+ *
17
+ * The update reads the index, changes it and writes it back through the same
18
+ * `file://` and `s3://` paths the report upload uses (pr-report-url.ts). A
19
+ * `file://` write goes through a temporary name and a rename. Two runners
20
+ * updating one index at once can lose an entry, and that is out of scope:
21
+ * `chant ci serve` is one host. Within one process the updates for one URL
22
+ * take turns, so `ci serve --max-jobs 2` does not race itself.
23
+ *
24
+ * An index that can't be parsed is replaced with a warning. An index this
25
+ * chant can't read for any other reason, or a newer contract, is left alone
26
+ * with a warning. Nothing here fails a job.
27
+ */
28
+ import type { RunOrigin } from "../lifecycle/release-ledger.js";
29
+ import type { CommandContext } from "../cli/registry.js";
30
+ import { type ReportGet, type ReportPut, type ReportTarget } from "../pr-report-url.js";
31
+ export declare const CI_RUN_INDEX_SCHEMA_ID = "https://intentius.io/chant/schemas/workspace/ci-run-index/v1/ci-run-index.schema.json";
32
+ export declare const CI_RUN_INDEX_CONTRACT = 1;
33
+ /** The first chant that writes the index. */
34
+ export declare const CI_RUN_INDEX_FLOOR = "0.124.31";
35
+ /** Where the index is kept, below the report URL. */
36
+ export declare const CI_RUN_INDEX_KEY = "runs/index.json";
37
+ /** How many entries the index keeps unless told otherwise. */
38
+ export declare const CI_RUN_INDEX_LIMIT = 200;
39
+ /** One job the runner ran. */
40
+ export interface CiRunIndexEntry {
41
+ job: "plan" | "apply";
42
+ /** The pull request, or null when the job found none. */
43
+ pr: number | null;
44
+ commit: string;
45
+ status: "ok" | "fail";
46
+ /** Why a failed job failed: the `failure.code` of its run record. */
47
+ failure?: {
48
+ code: string;
49
+ };
50
+ member?: string;
51
+ started: string;
52
+ ended: string;
53
+ runId: string;
54
+ /** The folder the job's report is under, below the report URL: `<pr>/<commit>[/<member>]`. */
55
+ key: string;
56
+ runOrigin: RunOrigin;
57
+ }
58
+ export interface CiRunIndex {
59
+ $schema: typeof CI_RUN_INDEX_SCHEMA_ID;
60
+ contract: typeof CI_RUN_INDEX_CONTRACT;
61
+ chant: string;
62
+ /** When the index was last written. */
63
+ updated: string;
64
+ /** Newest first. */
65
+ runs: CiRunIndexEntry[];
66
+ }
67
+ /** The index as `text` holds it, or why it can't be used: `corrupt` is replaced, `newer` is left alone. */
68
+ export declare function parseCiRunIndex(text: string): {
69
+ index: CiRunIndex;
70
+ } | {
71
+ corrupt: string;
72
+ } | {
73
+ newer: number;
74
+ };
75
+ /** `entry` at the front of `runs`, replacing an entry with its run id, cut to the newest `limit`. */
76
+ export declare function addRunEntry(runs: readonly CiRunIndexEntry[], entry: CiRunIndexEntry, limit: number): CiRunIndexEntry[];
77
+ /**
78
+ * Add `entry` to the index at `target`. Never throws: a problem is a warning
79
+ * and the index stays as it was, or is replaced when it was unreadable JSON.
80
+ */
81
+ export declare function updateCiRunIndex(input: {
82
+ target: ReportTarget;
83
+ entry: CiRunIndexEntry;
84
+ limit?: number;
85
+ warn: (message: string) => void;
86
+ now?: () => Date;
87
+ put?: ReportPut;
88
+ get?: ReportGet;
89
+ }): Promise<void>;
90
+ /** The index at `target`, or null when none is there. Throws a line a person can read when it can't be read. */
91
+ export declare function readCiRunIndex(target: ReportTarget, get?: ReportGet): Promise<CiRunIndex | null>;
92
+ /** The text `chant ci runs` prints: one line per run, newest first. */
93
+ export declare function formatCiRunIndex(index: CiRunIndex): string;
94
+ /** `chant ci runs` (#4098): list the index at the report URL. */
95
+ export declare function runCiRuns(ctx: CommandContext): Promise<number>;
96
+ //# sourceMappingURL=ci-run-index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ci-run-index.d.ts","sourceRoot":"","sources":["../../src/worksp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E,eAAe,EAAE,CAAC;CACzB;AAID,2GAA2G;AAC3G,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG;IAAE,KAAK,EAAE,UAAU,CAAA;CAAE,GAAG;IAAE,OAAO,EAAE,MAAM,CAAA;CAAE,GAAG;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE,CAc7G;AAED,qGAAqG;AACrG,wBAAgB,WAAW,CAAC,IAAI,EAAE,SAAS,eAAe,EAAE,EAAE,KAAK,EAAE,eAAe,EAAE,KAAK,EAAE,MAAM,GAAG,eAAe,EAAE,CAEtH;AAKD;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE;IACtC,MAAM,EAAE,YAAY,CAAC;IACrB,KAAK,EAAE,eAAe,CAAC;IACvB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IAChC,GAAG,CAAC,EAAE,MAAM,IAAI,CAAC;IACjB,GAAG,CAAC,EAAE,SAAS,CAAC;IAChB,GAAG,CAAC,EAAE,SAAS,CAAC;CACjB,GAAG,OAAO,CAAC,IAAI,CAAC,CAuChB;AAED,gHAAgH;AAChH,wBAAsB,cAAc,CAAC,MAAM,EAAE,YAAY,EAAE,GAAG,GAAE,SAA6B,GAAG,OAAO,CAAC,UAAU,GAAG,IAAI,CAAC,CAQzH;AAED,uEAAuE;AACvE,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,UAAU,GAAG,MAAM,CAS1D;AAID,iEAAiE;AACjE,wBAAsB,SAAS,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CAcpE"}
@@ -0,0 +1,162 @@
1
+ /**
2
+ * The run index (#4098, epic #4101): where the chant runner says which jobs it
3
+ * ran, at the `--report-url` root, for behold and the demo kiosk to find runs
4
+ * without a forge or a workflow file.
5
+ *
6
+ * ```
7
+ * <url>/runs/index.json
8
+ * ```
9
+ *
10
+ * One document, `ci-run-index/v1` (`ci-run-index.schema.json`). Each settled
11
+ * `chant ci run` job with `--report-url` set adds an entry to its front, so
12
+ * the newest run is first, and the list is cut to the newest `limit` entries,
13
+ * 200 by default. An entry's `key` is the folder the job's report went to
14
+ * (`reportKey`, `<pr>/<commit>`), so a reader goes from the index to
15
+ * `<url>/<key>/pr-<job>.json`.
16
+ *
17
+ * The update reads the index, changes it and writes it back through the same
18
+ * `file://` and `s3://` paths the report upload uses (pr-report-url.ts). A
19
+ * `file://` write goes through a temporary name and a rename. Two runners
20
+ * updating one index at once can lose an entry, and that is out of scope:
21
+ * `chant ci serve` is one host. Within one process the updates for one URL
22
+ * take turns, so `ci serve --max-jobs 2` does not race itself.
23
+ *
24
+ * An index that can't be parsed is replaced with a warning. An index this
25
+ * chant can't read for any other reason, or a newer contract, is left alone
26
+ * with a warning. Nothing here fails a job.
27
+ */
28
+ import { formatError } from "../cli/format.js";
29
+ import { parseReportUrl, reportGet, reportPut } from "../pr-report-url.js";
30
+ import { readerVersion } from "./declaration.js";
31
+ export const CI_RUN_INDEX_SCHEMA_ID = "https://intentius.io/chant/schemas/workspace/ci-run-index/v1/ci-run-index.schema.json";
32
+ export const CI_RUN_INDEX_CONTRACT = 1;
33
+ /** The first chant that writes the index. */
34
+ export const CI_RUN_INDEX_FLOOR = "0.124.31";
35
+ /** Where the index is kept, below the report URL. */
36
+ export const CI_RUN_INDEX_KEY = "runs/index.json";
37
+ /** How many entries the index keeps unless told otherwise. */
38
+ export const CI_RUN_INDEX_LIMIT = 200;
39
+ const messageOf = (err) => (err instanceof Error ? err.message : String(err));
40
+ /** The index as `text` holds it, or why it can't be used: `corrupt` is replaced, `newer` is left alone. */
41
+ export function parseCiRunIndex(text) {
42
+ let doc;
43
+ try {
44
+ doc = JSON.parse(text);
45
+ }
46
+ catch (err) {
47
+ return { corrupt: `it is not JSON (${messageOf(err)})` };
48
+ }
49
+ if (doc === null || typeof doc !== "object" || Array.isArray(doc))
50
+ return { corrupt: "it is not an object" };
51
+ const d = doc;
52
+ if (typeof d.contract === "number" && d.contract > CI_RUN_INDEX_CONTRACT)
53
+ return { newer: d.contract };
54
+ if (d.contract !== CI_RUN_INDEX_CONTRACT)
55
+ return { corrupt: "it is not a ci-run-index document" };
56
+ if (!Array.isArray(d.runs))
57
+ return { corrupt: "it has no runs list" };
58
+ const runs = d.runs.filter((r) => r !== null && typeof r === "object" && typeof r.runId === "string");
59
+ return { index: { ...doc, runs } };
60
+ }
61
+ /** `entry` at the front of `runs`, replacing an entry with its run id, cut to the newest `limit`. */
62
+ export function addRunEntry(runs, entry, limit) {
63
+ return [entry, ...runs.filter((r) => r.runId !== entry.runId)].slice(0, limit);
64
+ }
65
+ /** The turn each index URL is waiting for, so updates in one process run one after another. */
66
+ const turns = new Map();
67
+ /**
68
+ * Add `entry` to the index at `target`. Never throws: a problem is a warning
69
+ * and the index stays as it was, or is replaced when it was unreadable JSON.
70
+ */
71
+ export function updateCiRunIndex(input) {
72
+ const where = `${input.target.url}/${CI_RUN_INDEX_KEY}`;
73
+ const put = input.put ?? reportPut(input.target);
74
+ const get = input.get ?? reportGet(input.target);
75
+ const limit = Math.max(1, Math.floor(input.limit ?? CI_RUN_INDEX_LIMIT));
76
+ const work = async () => {
77
+ let runs = [];
78
+ try {
79
+ const text = await get(CI_RUN_INDEX_KEY);
80
+ if (text !== null) {
81
+ const parsed = parseCiRunIndex(text);
82
+ if ("corrupt" in parsed)
83
+ input.warn(`the run index at ${where} is replaced, since ${parsed.corrupt}`);
84
+ else if ("newer" in parsed)
85
+ return input.warn(`the run index at ${where} is contract ${parsed.newer}, which this chant does not write; it is left as it is`);
86
+ else
87
+ runs = parsed.index.runs;
88
+ }
89
+ }
90
+ catch (err) {
91
+ return input.warn(`could not read the run index at ${where}, so it is not updated: ${messageOf(err)}`);
92
+ }
93
+ const index = {
94
+ $schema: CI_RUN_INDEX_SCHEMA_ID,
95
+ contract: CI_RUN_INDEX_CONTRACT,
96
+ chant: readerVersion(),
97
+ updated: (input.now?.() ?? new Date()).toISOString(),
98
+ runs: addRunEntry(runs, input.entry, limit),
99
+ };
100
+ try {
101
+ await put(CI_RUN_INDEX_KEY, JSON.stringify(index, null, 2) + "\n", "application/json");
102
+ }
103
+ catch (err) {
104
+ input.warn(`could not write the run index at ${where}: ${messageOf(err)}`);
105
+ }
106
+ };
107
+ const previous = turns.get(where) ?? Promise.resolve();
108
+ const next = previous.then(work, work);
109
+ const settled = next.catch(() => undefined);
110
+ turns.set(where, settled);
111
+ void settled.then(() => {
112
+ if (turns.get(where) === settled)
113
+ turns.delete(where);
114
+ });
115
+ return next.catch((err) => input.warn(`could not update the run index at ${where}: ${messageOf(err)}`));
116
+ }
117
+ /** The index at `target`, or null when none is there. Throws a line a person can read when it can't be read. */
118
+ export async function readCiRunIndex(target, get = reportGet(target)) {
119
+ const where = `${target.url}/${CI_RUN_INDEX_KEY}`;
120
+ const text = await get(CI_RUN_INDEX_KEY);
121
+ if (text === null)
122
+ return null;
123
+ const parsed = parseCiRunIndex(text);
124
+ if ("corrupt" in parsed)
125
+ throw new Error(`the run index at ${where} is unusable: ${parsed.corrupt}`);
126
+ if ("newer" in parsed)
127
+ throw new Error(`the run index at ${where} is contract ${parsed.newer}; this chant reads contract ${CI_RUN_INDEX_CONTRACT}`);
128
+ return parsed.index;
129
+ }
130
+ /** The text `chant ci runs` prints: one line per run, newest first. */
131
+ export function formatCiRunIndex(index) {
132
+ if (index.runs.length === 0)
133
+ return "no runs in the index";
134
+ return index.runs
135
+ .map((r) => {
136
+ const pr = r.pr === null ? "no PR" : `PR ${r.pr}`;
137
+ const why = r.status === "fail" ? ` (${r.failure?.code ?? "failed"})` : "";
138
+ return `${r.ended} ${r.job.padEnd(5)} ${r.status}${why} ${pr} ${r.commit.slice(0, 12)} ${r.runId} ${r.key}`;
139
+ })
140
+ .join("\n");
141
+ }
142
+ const RUNS_USAGE = "chant ci runs --report-url <s3://<bucket>/<prefix> | file://<directory>> [--json]";
143
+ /** `chant ci runs` (#4098): list the index at the report URL. */
144
+ export async function runCiRuns(ctx) {
145
+ try {
146
+ const raw = ctx.args.reportUrl;
147
+ if (!raw)
148
+ throw new Error("--report-url names where the index is kept");
149
+ const target = parseReportUrl(raw);
150
+ if ("error" in target)
151
+ throw new Error(target.error);
152
+ const index = await readCiRunIndex(target);
153
+ if (index === null)
154
+ throw new Error(`there is no run index at ${target.url}/${CI_RUN_INDEX_KEY}`);
155
+ console.log(ctx.args.json ? JSON.stringify(index, null, 2) : formatCiRunIndex(index));
156
+ return 0;
157
+ }
158
+ catch (err) {
159
+ console.error(formatError({ message: `chant ci runs: ${messageOf(err)}`, hint: RUNS_USAGE }));
160
+ return 1;
161
+ }
162
+ }
@@ -0,0 +1,50 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://intentius.io/chant/schemas/workspace/ci-run-index/v1/ci-run-index.schema.json",
4
+ "title": "chant ci run index",
5
+ "description": "The runs the chant runner has run, kept at <report-url>/runs/index.json (#4098, epic #4101) so a reader outside CI finds them without a forge or a workflow file. `chant ci run` adds an entry to the front after each job settles when --report-url is set, so the list is newest first, and keeps the newest 200 entries unless --run-index-limit says otherwise. `chant ci runs --json` prints the same document. An entry's `key` is the folder the job's report is under, below the report URL. The update is a read, a change and a write of the whole file, through the same s3:// and file:// paths the report upload uses; a file:// write goes through a temporary name and a rename. Two runners updating one index at once can lose an entry. That is out of scope, because `chant ci serve` is one host. Version 1 of the workspace read contract. Readers ignore fields they do not know; a field is only ever added within a version. Written by chant 0.124.31 and newer.",
6
+ "type": "object",
7
+ "required": ["$schema", "contract", "chant", "updated", "runs"],
8
+ "properties": {
9
+ "$schema": { "const": "https://intentius.io/chant/schemas/workspace/ci-run-index/v1/ci-run-index.schema.json" },
10
+ "contract": { "const": 1 },
11
+ "chant": { "type": "string", "description": "The chant that last wrote the index." },
12
+ "updated": { "type": "string", "description": "When the index was last written." },
13
+ "runs": {
14
+ "type": "array",
15
+ "description": "Newest first, at most the limit the writer was given (200 by default).",
16
+ "items": { "$ref": "#/$defs/run" }
17
+ }
18
+ },
19
+ "$defs": {
20
+ "run": {
21
+ "type": "object",
22
+ "required": ["job", "pr", "commit", "status", "started", "ended", "runId", "key", "runOrigin"],
23
+ "if": { "properties": { "status": { "const": "fail" } } },
24
+ "then": { "required": ["failure"], "properties": { "failure": { "type": "object" } } },
25
+ "properties": {
26
+ "job": { "enum": ["plan", "apply"] },
27
+ "pr": { "type": ["integer", "null"], "minimum": 1, "description": "The pull or merge request number: the one the job's report names, else --pr. null when neither has one." },
28
+ "commit": { "type": "string", "pattern": "^[0-9a-f]{40,64}$", "description": "The full commit the job ran at." },
29
+ "status": { "enum": ["ok", "fail"] },
30
+ "failure": {
31
+ "type": "object",
32
+ "required": ["code"],
33
+ "description": "Present when status is fail. The same code the run record's failure carries: setup-failed, build-failed, a report's refusal or status, or command-failed.",
34
+ "properties": { "code": { "type": "string" } }
35
+ },
36
+ "member": { "type": "string", "pattern": "^[a-z0-9][a-z0-9-]{0,39}$", "description": "The workspace member whose pipeline the job ran for. Absent outside a member." },
37
+ "started": { "type": "string", "description": "ISO-8601 instant the job started." },
38
+ "ended": { "type": "string", "description": "ISO-8601 instant the job settled." },
39
+ "runId": { "type": "string", "description": "The Op run id, as in the run ledger on chant/lifecycle." },
40
+ "key": { "type": "string", "description": "reportKey(pr, commit): <pr>/<commit>, with /<member> after for a member, and unknown for a missing pr. The job's report is <report-url>/<key>/pr-<job>.json." },
41
+ "runOrigin": {
42
+ "type": "object",
43
+ "required": ["forge"],
44
+ "description": "Where the run says it ran. { forge: \"chant\" } for a job the chant runner ran.",
45
+ "properties": { "forge": { "type": "string" } }
46
+ }
47
+ }
48
+ }
49
+ }
50
+ }
@@ -22,7 +22,10 @@
22
22
  * own variables. The forge values a generated job reads from `${{ ... }}`
23
23
  * expressions or GitLab's predefined variables come from flags here:
24
24
  * `BASE_SHA` from `--base`, `PR_NUMBER` from `--pr`, and the commit from
25
- * `--commit`.
25
+ * `--commit`. The values a forge job gets from repository secrets come from
26
+ * the host's secrets file (`--secrets`, ./ci-secrets.ts, #4096), and every
27
+ * secret value is redacted from the run's events, record, copied report and
28
+ * output by the executor's `redact` option.
26
29
  *
27
30
  * The steps run in a fresh checkout of the commit: a detached `git worktree`
28
31
  * in a temporary directory outside the repository, removed when the run
@@ -37,14 +40,20 @@
37
40
  * key is given, so `chant ci tick --source runs` (#4044) judges the commit
38
41
  * from it. Its events are `kind: "pipeline"` and `runtime: "ci"`, and the
39
42
  * record and the events carry `runOrigin: { forge: "chant" }`.
43
+ *
44
+ * With a forge client (#4097) the job also sets a commit status at its
45
+ * commit: `pending` when it starts, `success` or `failure` when it settles.
46
+ * A status the forge refuses is a warning and never fails the job.
40
47
  */
41
48
  import { type PrLoopJob, type PrLoopPipelineOptions } from "../components/pr-pipeline.js";
42
- import { type ForgeKind } from "../pr-forge.js";
49
+ import { type CommitStatus, type ForgeKind } from "../pr-forge.js";
43
50
  import type { CommandContext } from "../cli/registry.js";
44
51
  import type { RunOrigin } from "../lifecycle/release-ledger.js";
45
52
  import { type OpRunResult, type StepRecord } from "../op/local-executor.js";
46
53
  import type { OpRunFailureReason, OpRunRecord } from "../op/runtime.js";
47
54
  import type { OpConfig } from "../op/types.js";
55
+ import { type Redact } from "../op/redact.js";
56
+ import { type CiSecrets } from "./ci-secrets.js";
48
57
  /** The two jobs a pull-request pipeline has. */
49
58
  export type CiJobName = PrLoopJob["jobName"];
50
59
  export declare const CI_JOB_NAMES: readonly CiJobName[];
@@ -74,11 +83,14 @@ export declare class CiRunError extends Error {
74
83
  }
75
84
  /**
76
85
  * The job's environment: the runner's base variables, the forge variables
77
- * and `passEnv` names it has, `CHANT_ENV` as a generated workflow sets it,
78
- * the commit as the forge spells it, and the job's own variables. A job
79
- * variable the forge fills from an expression comes from a flag, or from
80
- * the runner's environment for a token such as `GITHUB_TOKEN`; a literal
81
- * one, such as `CHANT_RUN_EVENTS_DIR`, is kept as it is.
86
+ * and `passEnv` names it has, the job's secrets from the host's secrets file
87
+ * (#4096), `CHANT_ENV` as a generated workflow sets it, the commit as the
88
+ * forge spells it, and the job's own variables. A job variable the forge
89
+ * fills from an expression comes from a flag, or from a secret or the
90
+ * runner's environment for a token such as `GITHUB_TOKEN`; a literal one,
91
+ * such as `CHANT_RUN_EVENTS_DIR`, is kept as it is. A secret replaces the
92
+ * runner's variable of the same name, and none replaces a variable the
93
+ * runner sets for the job. `CHANT_RUNNER_KEY` is never in it.
82
94
  */
83
95
  export declare function ciJobEnv(job: PrLoopJob, input: {
84
96
  forge: ForgeKind;
@@ -86,6 +98,8 @@ export declare function ciJobEnv(job: PrLoopJob, input: {
86
98
  values: CiRunValues;
87
99
  hostEnv: Record<string, string | undefined>;
88
100
  passEnv?: readonly string[];
101
+ /** The secrets this job gets, from {@link ciSecretsFor}. */
102
+ secrets?: Record<string, string>;
89
103
  }): Record<string, string>;
90
104
  /** What {@link ciJobOp} builds the Op from. */
91
105
  export interface CiJobOpInput {
@@ -132,6 +146,51 @@ export declare function ciJobFailure(input: {
132
146
  records: readonly StepRecord[];
133
147
  reportDir: string;
134
148
  }): OpRunFailureReason | undefined;
149
+ /** What posts a job's commit status (#4097): the `setCommitStatus` of a GitHub or Forgejo client. */
150
+ export interface CiStatusClient {
151
+ setCommitStatus(sha: string, status: CommitStatus): Promise<void>;
152
+ }
153
+ /** Where a job's status goes (#4097). */
154
+ export interface CiStatusConfig {
155
+ client: CiStatusClient;
156
+ /** `--status-url`: the link the status carries, `{key}` standing for `<pr>/<commit>[/<member>]`. Otherwise an https `--report-url` is used. */
157
+ urlTemplate?: string;
158
+ }
159
+ /**
160
+ * A job's status context: `chant/pr-plan` for the plan, and for the apply
161
+ * `chant/<gate>`, which is `chant/pr-apply` unless `--gate` renamed the gate.
162
+ * pr-plan's own status is `chant/plan` (../pr-loop.ts), a different context.
163
+ */
164
+ export declare function ciStatusContext(job: CiJobName, gate?: string): string;
165
+ /**
166
+ * The link a job's status carries: the `--status-url` template with `{key}`
167
+ * filled, else the https `--report-url` followed by the key and a slash, else
168
+ * none (an `s3://` or `file://` URL is not one a browser opens).
169
+ */
170
+ export declare function ciStatusUrl(input: {
171
+ urlTemplate?: string;
172
+ reportUrl?: string;
173
+ pr?: number;
174
+ commit: string;
175
+ member?: string;
176
+ }): string | undefined;
177
+ /** What the settled status says: a short summary, or on failure the record's code and reason. */
178
+ export declare function ciStatusSettled(op: string, result: Pick<CiRunResult, "status" | "record" | "failure">, seconds: number): Pick<CommitStatus, "state" | "description">;
179
+ /**
180
+ * The status client for `chant ci run` and `chant ci serve` (#4097), or none:
181
+ * off with `--no-status`, on GitLab (its client has no commit status call
182
+ * here), and without a forge token. A token with the rest of the forge's
183
+ * variables missing gives a warning instead.
184
+ */
185
+ export declare function ciStatusFromEnv(input: {
186
+ forge: ForgeKind;
187
+ hostEnv: Record<string, string | undefined>;
188
+ noStatus?: boolean;
189
+ statusUrl?: string;
190
+ }): {
191
+ status?: CiStatusConfig;
192
+ warning?: string;
193
+ };
135
194
  /** What `chant ci run` runs. */
136
195
  export interface CiRunRequest {
137
196
  /** Where the command was run: the project, or a workspace member's directory. */
@@ -156,8 +215,16 @@ export interface CiRunRequest {
156
215
  passEnv?: readonly string[];
157
216
  /** The runner's environment. Default `process.env`. */
158
217
  hostEnv?: Record<string, string | undefined>;
218
+ /**
219
+ * The host's secrets file, read (#4096, `--secrets`): the job gets the
220
+ * secrets its allowlist names, and every value in it is redacted from the
221
+ * run's events, record, copied report and output.
222
+ */
223
+ secrets?: CiSecrets;
159
224
  /** `--output`: where the job's report is copied, from `cwd`. Default `.chant/pr`. */
160
225
  output?: string;
226
+ /** `--run-index-limit`: how many runs the index at `loop.reportUrl` keeps (#4098). Default 200. */
227
+ runIndexLimit?: number;
161
228
  /** A runner key, PEM, that signs the run's record. */
162
229
  runnerKey?: string;
163
230
  /**
@@ -181,6 +248,8 @@ export interface CiRunRequest {
181
248
  * failed. `chant ci serve` names one per `prApplyRecordKey`.
182
249
  */
183
250
  resumeRecord?: string;
251
+ /** Set a commit status at the job's commit (#4097). Absent: none is set. `chant ci run` builds it from the environment. */
252
+ status?: CiStatusConfig;
184
253
  signal?: AbortSignal;
185
254
  }
186
255
  export interface CiRunResult {
@@ -215,8 +284,16 @@ export declare function ciJobPlace(cwd: string, top: string): {
215
284
  * before anything runs when the request can't be run.
216
285
  */
217
286
  export declare function ciRun(req: CiRunRequest): Promise<CiRunResult>;
287
+ /**
288
+ * Redact every text file under `dir` in place (#4096): the job's report, its
289
+ * change set and its component events, as `ci run` copied them out. A
290
+ * JSON file stays JSON. A file with a NUL byte is taken as binary and left.
291
+ */
292
+ export declare function redactTree(dir: string, redact: Redact): void;
218
293
  /** The text `chant ci run` prints when the run settles. */
219
294
  export declare function formatCiRun(r: CiRunResult): string;
295
+ /** The secrets file `--secrets` names, else the one `CHANT_CI_SECRETS` names, read; undefined when neither names one (#4096). */
296
+ export declare function ciSecretsOf(flag: string | undefined, env?: Record<string, string | undefined>): CiSecrets | undefined;
220
297
  /** `chant ci run plan|apply` (#4094). */
221
298
  export declare function runCiRun(ctx: CommandContext): Promise<number>;
222
299
  //# sourceMappingURL=ci-run.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ci-run.d.ts","sourceRoot":"","sources":["../../src/workspace/ci-run.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AAMH,OAAO,EAA+E,KAAK,SAAS,EAAE,KAAK,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AACpK,OAAO,EAA4B,KAAK,SAAS,EAAE,MAAM,aAAa,CAAC;AACvE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAEtD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAC;AAK7D,OAAO,EAA8B,KAAK,WAAW,EAAE,KAAK,UAAU,EAAE,MAAM,sBAAsB,CAAC;AACrG,OAAO,KAAK,EAAE,kBAAkB,EAAE,WAAW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