@intentius/chant 0.124.30 → 0.124.32
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/bin/chant +7 -2
- package/dist/cli/commands/check-lexicon-plugin.d.ts +7 -4
- package/dist/cli/commands/check-lexicon-plugin.d.ts.map +1 -1
- package/dist/cli/commands/check-lexicon-plugin.js +10 -7
- package/dist/cli/commands/check-lexicon.d.ts.map +1 -1
- package/dist/cli/commands/check-lexicon.js +18 -12
- package/dist/cli/commands/import.d.ts +10 -0
- package/dist/cli/commands/import.d.ts.map +1 -1
- package/dist/cli/commands/import.js +37 -0
- package/dist/cli/commands/init-lexicon/templates/project.d.ts.map +1 -1
- package/dist/cli/commands/init-lexicon/templates/project.js +4 -3
- package/dist/cli/commands/onboard.d.ts.map +1 -1
- package/dist/cli/commands/onboard.js +8 -4
- package/dist/cli/commands/update.d.ts.map +1 -1
- package/dist/cli/commands/update.js +2 -1
- package/dist/cli/dependencies.d.ts +18 -0
- package/dist/cli/dependencies.d.ts.map +1 -0
- package/dist/cli/dependencies.js +120 -0
- package/dist/cli/handlers/build.d.ts.map +1 -1
- package/dist/cli/handlers/build.js +23 -4
- package/dist/cli/handlers/fan-out.d.ts.map +1 -1
- package/dist/cli/handlers/fan-out.js +12 -4
- package/dist/cli/handlers/graph.d.ts.map +1 -1
- package/dist/cli/handlers/graph.js +16 -6
- package/dist/cli/handlers/lint.d.ts.map +1 -1
- package/dist/cli/handlers/lint.js +6 -0
- package/dist/cli/handlers/operator.d.ts +2 -2
- package/dist/cli/handlers/operator.js +3 -3
- package/dist/cli/handlers/pr.d.ts +14 -0
- package/dist/cli/handlers/pr.d.ts.map +1 -1
- package/dist/cli/handlers/pr.js +488 -32
- package/dist/cli/handlers/promote.d.ts.map +1 -1
- package/dist/cli/handlers/promote.js +3 -1
- package/dist/cli/handlers/run.d.ts +13 -1
- package/dist/cli/handlers/run.d.ts.map +1 -1
- package/dist/cli/handlers/run.js +38 -15
- package/dist/cli/main.d.ts.map +1 -1
- package/dist/cli/main.js +74 -12
- package/dist/cli/parse-args.d.ts.map +1 -1
- package/dist/cli/parse-args.js +65 -0
- package/dist/cli/registry.d.ts +29 -2
- package/dist/cli/registry.d.ts.map +1 -1
- package/dist/cli/registry.js +6 -2
- package/dist/codegen/generate-post-synth-barrel.js +2 -2
- package/dist/codegen/lexicon-regen.d.ts +4 -0
- package/dist/codegen/lexicon-regen.d.ts.map +1 -1
- package/dist/codegen/lexicon-regen.js +1 -1
- package/dist/codegen/pinned-upgrade.js +2 -2
- package/dist/components/capability.d.ts +44 -3
- package/dist/components/capability.d.ts.map +1 -1
- package/dist/components/capability.js +21 -0
- package/dist/components/changed-files.d.ts +7 -1
- package/dist/components/changed-files.d.ts.map +1 -1
- package/dist/components/changed-files.js +9 -1
- package/dist/components/driver.d.ts +38 -0
- package/dist/components/driver.d.ts.map +1 -1
- package/dist/components/driver.js +47 -6
- package/dist/components/fan-out-record.d.ts +6 -1
- package/dist/components/fan-out-record.d.ts.map +1 -1
- package/dist/components/fan-out-record.js +24 -0
- package/dist/components/fan-out-run.d.ts +20 -0
- package/dist/components/fan-out-run.d.ts.map +1 -1
- package/dist/components/fan-out-run.js +21 -1
- package/dist/components/pr-pipeline.d.ts +65 -2
- package/dist/components/pr-pipeline.d.ts.map +1 -1
- package/dist/components/pr-pipeline.js +107 -15
- package/dist/components/pr-run.d.ts +127 -29
- package/dist/components/pr-run.d.ts.map +1 -1
- package/dist/components/pr-run.js +290 -70
- package/dist/components/wave-plan.d.ts +5 -2
- package/dist/components/wave-plan.d.ts.map +1 -1
- package/dist/components/wave-plan.js +12 -1
- package/dist/discovery/fold-import.d.ts.map +1 -1
- package/dist/discovery/fold-import.js +16 -6
- package/dist/discovery/sandbox/bundle.d.ts.map +1 -1
- package/dist/discovery/sandbox/bundle.js +6 -0
- package/dist/discovery/specifier-resolve.d.ts.map +1 -1
- package/dist/discovery/specifier-resolve.js +8 -2
- package/dist/fold/fold.d.ts.map +1 -1
- package/dist/fold/fold.js +68 -1
- package/dist/fold/subset.d.ts +37 -0
- package/dist/fold/subset.d.ts.map +1 -1
- package/dist/fold/subset.js +88 -0
- package/dist/lexicon-module.d.ts +10 -0
- package/dist/lexicon-module.d.ts.map +1 -1
- package/dist/lexicon-module.js +53 -8
- package/dist/lexicon-plugin-helpers.d.ts.map +1 -1
- package/dist/lexicon-plugin-helpers.js +6 -4
- package/dist/lexicon.d.ts +2 -0
- package/dist/lexicon.d.ts.map +1 -1
- package/dist/lifecycle/affected.d.ts.map +1 -1
- package/dist/lifecycle/affected.js +7 -1
- package/dist/lifecycle/release-ledger.d.ts +21 -0
- package/dist/lifecycle/release-ledger.d.ts.map +1 -1
- package/dist/lifecycle/release-ledger.js +24 -0
- package/dist/lifecycle/work-dir.d.ts +45 -0
- package/dist/lifecycle/work-dir.d.ts.map +1 -0
- package/dist/lifecycle/work-dir.js +78 -0
- package/dist/lint/discover.d.ts +17 -9
- package/dist/lint/discover.d.ts.map +1 -1
- package/dist/lint/discover.js +62 -54
- package/dist/module-source.d.ts +57 -0
- package/dist/module-source.d.ts.map +1 -0
- package/dist/module-source.js +104 -0
- package/dist/op/activities/factory.js +1 -1
- package/dist/op/discover.d.ts.map +1 -1
- package/dist/op/discover.js +13 -3
- package/dist/op/gate.d.ts.map +1 -1
- package/dist/op/gate.js +3 -0
- package/dist/op/local-executor.d.ts +12 -0
- package/dist/op/local-executor.d.ts.map +1 -1
- package/dist/op/local-executor.js +22 -3
- package/dist/op/op-waves-run.d.ts.map +1 -1
- package/dist/op/op-waves-run.js +20 -5
- package/dist/op/operator.d.ts +2 -2
- package/dist/op/operator.js +2 -2
- package/dist/op/redact.d.ts +34 -0
- package/dist/op/redact.d.ts.map +1 -0
- package/dist/op/redact.js +94 -0
- package/dist/op/step-console.d.ts +2 -0
- package/dist/op/step-console.d.ts.map +1 -1
- package/dist/op/step-console.js +5 -2
- package/dist/op/steward.d.ts +6 -4
- package/dist/op/steward.d.ts.map +1 -1
- package/dist/op/steward.js +5 -3
- package/dist/op/work-lease-run.d.ts +20 -7
- package/dist/op/work-lease-run.d.ts.map +1 -1
- package/dist/op/work-lease-run.js +56 -12
- package/dist/pr-forge.d.ts +27 -0
- package/dist/pr-forge.d.ts.map +1 -1
- package/dist/pr-forge.js +51 -6
- package/dist/pr-loop.d.ts +141 -4
- package/dist/pr-loop.d.ts.map +1 -1
- package/dist/pr-loop.js +122 -6
- package/dist/pr-report-url.d.ts +10 -2
- package/dist/pr-report-url.d.ts.map +1 -1
- package/dist/pr-report-url.js +52 -6
- package/dist/ts-loader.d.ts +38 -4
- package/dist/ts-loader.d.ts.map +1 -1
- package/dist/ts-loader.js +190 -16
- package/dist/wave-runtime.mjs +208 -208
- package/dist/workspace/chant-migrations/fountain-retired-kinds.d.ts +34 -0
- package/dist/workspace/chant-migrations/fountain-retired-kinds.d.ts.map +1 -0
- package/dist/workspace/chant-migrations/fountain-retired-kinds.js +176 -0
- package/dist/workspace/chant-migrations.d.ts.map +1 -1
- package/dist/workspace/chant-migrations.js +2 -0
- package/dist/workspace/checks/boxes.d.ts +6 -6
- package/dist/workspace/checks/boxes.js +9 -9
- package/dist/workspace/ci-green-forge.d.ts +6 -4
- package/dist/workspace/ci-green-forge.d.ts.map +1 -1
- package/dist/workspace/ci-green.d.ts +28 -12
- package/dist/workspace/ci-green.d.ts.map +1 -1
- package/dist/workspace/ci-green.js +49 -21
- package/dist/workspace/ci-list.schema.json +12 -6
- package/dist/workspace/ci-report-url.d.ts +18 -0
- package/dist/workspace/ci-report-url.d.ts.map +1 -0
- package/dist/workspace/ci-report-url.js +33 -0
- package/dist/workspace/ci-run-index.d.ts +108 -0
- package/dist/workspace/ci-run-index.d.ts.map +1 -0
- package/dist/workspace/ci-run-index.js +164 -0
- package/dist/workspace/ci-run-index.schema.json +52 -0
- package/dist/workspace/ci-run.d.ts +159 -9
- package/dist/workspace/ci-run.d.ts.map +1 -1
- package/dist/workspace/ci-run.js +419 -50
- package/dist/workspace/ci-runner-key.d.ts +133 -0
- package/dist/workspace/ci-runner-key.d.ts.map +1 -0
- package/dist/workspace/ci-runner-key.js +237 -0
- package/dist/workspace/ci-secrets.d.ts +65 -0
- package/dist/workspace/ci-secrets.d.ts.map +1 -0
- package/dist/workspace/ci-secrets.js +211 -0
- package/dist/workspace/ci-serve.d.ts +67 -4
- package/dist/workspace/ci-serve.d.ts.map +1 -1
- package/dist/workspace/ci-serve.js +240 -35
- package/dist/workspace/declaration.d.ts +8 -0
- package/dist/workspace/declaration.d.ts.map +1 -1
- package/dist/workspace/declaration.js +11 -2
- package/dist/workspace/declaration.schema.json +7 -2
- package/dist/workspace/export.d.ts +1 -1
- package/dist/workspace/export.d.ts.map +1 -1
- package/dist/workspace/export.js +7 -3
- package/dist/workspace/ls.d.ts +6 -1
- package/dist/workspace/ls.d.ts.map +1 -1
- package/dist/workspace/ls.js +1 -0
- package/dist/workspace/ls.schema.json +7 -1
- package/dist/workspace/pin-integrity.d.ts.map +1 -1
- package/dist/workspace/pin-integrity.js +3 -2
- package/dist/workspace/pr-report.schema.json +74 -7
- package/dist/workspace/reason-codes.d.ts +7 -3
- package/dist/workspace/reason-codes.d.ts.map +1 -1
- package/dist/workspace/reason-codes.js +9 -4
- package/dist/workspace/run-event.schema.json +3 -1
- package/dist/workspace/status.schema.json +3 -1
- package/dist/workspace/trust/trust-write.d.ts +109 -0
- package/dist/workspace/trust/trust-write.d.ts.map +1 -0
- package/dist/workspace/trust/trust-write.js +320 -0
- package/dist/workspace/trust-write.schema.json +265 -0
- package/dist/workspace/write-scope.d.ts +9 -0
- package/dist/workspace/write-scope.d.ts.map +1 -1
- package/dist/workspace/write-scope.js +11 -1
- package/package.json +1 -1
- package/src/__fixtures__/pr-loop/pr-apply-wave-waiting.note.golden.md +48 -0
- package/src/cli/commands/__fixtures__/init-lexicon-output/package.json +3 -3
- package/src/cli/commands/audit.test.ts +2 -2
- package/src/cli/commands/check-lexicon-plugin.test.ts +9 -0
- package/src/cli/commands/check-lexicon-plugin.ts +11 -8
- package/src/cli/commands/check-lexicon.test.ts +1 -1
- package/src/cli/commands/check-lexicon.ts +16 -11
- package/src/cli/commands/import.ts +40 -0
- package/src/cli/commands/init-lexicon/templates/project.ts +4 -3
- package/src/cli/commands/init-lexicon.test.ts +8 -5
- package/src/cli/commands/onboard.test.ts +45 -0
- package/src/cli/commands/onboard.ts +8 -4
- package/src/cli/commands/update.test.ts +6 -0
- package/src/cli/commands/update.ts +4 -1
- package/src/cli/compiled-cli.e2e.test.ts +76 -11
- package/src/cli/dependencies.e2e.test.ts +101 -0
- package/src/cli/dependencies.test.ts +93 -0
- package/src/cli/dependencies.ts +122 -0
- package/src/cli/handlers/build.test.ts +69 -0
- package/src/cli/handlers/build.ts +20 -4
- package/src/cli/handlers/fan-out.test.ts +73 -0
- package/src/cli/handlers/fan-out.ts +11 -4
- package/src/cli/handlers/graph.test.ts +76 -0
- package/src/cli/handlers/graph.ts +19 -12
- package/src/cli/handlers/lint.test.ts +42 -0
- package/src/cli/handlers/lint.ts +6 -0
- package/src/cli/handlers/operator.ts +3 -3
- package/src/cli/handlers/pr-waves.test.ts +449 -0
- package/src/cli/handlers/pr.test.ts +134 -0
- package/src/cli/handlers/pr.ts +523 -31
- package/src/cli/handlers/promote.test.ts +26 -1
- package/src/cli/handlers/promote.ts +3 -2
- package/src/cli/handlers/run-components-exit.test.ts +99 -0
- package/src/cli/handlers/run-signer.test.ts +79 -0
- package/src/cli/handlers/run.ts +34 -16
- package/src/cli/main.test.ts +19 -0
- package/src/cli/main.ts +73 -12
- package/src/cli/parse-args.ts +48 -0
- package/src/cli/registry.ts +35 -4
- package/src/codegen/generate-post-synth-barrel.ts +2 -2
- package/src/codegen/lexicon-regen.ts +1 -1
- package/src/codegen/pinned-upgrade.ts +2 -2
- package/src/codegen/post-synth-barrel-guards.test.ts +6 -11
- package/src/components/capability.ts +51 -3
- package/src/components/changed-files.test.ts +16 -1
- package/src/components/changed-files.ts +9 -1
- package/src/components/driver.test.ts +36 -1
- package/src/components/driver.ts +76 -4
- package/src/components/fan-out-record.ts +29 -1
- package/src/components/fan-out-run.test.ts +35 -0
- package/src/components/fan-out-run.ts +40 -1
- package/src/components/pr-pipeline.test.ts +100 -0
- package/src/components/pr-pipeline.ts +132 -17
- package/src/components/pr-run.test.ts +323 -18
- package/src/components/pr-run.ts +354 -75
- package/src/components/wave-plan.ts +16 -4
- package/src/discovery/fold-host-method.test.ts +87 -0
- package/src/discovery/fold-import.ts +15 -5
- package/src/discovery/fold-package-composite.test.ts +27 -0
- package/src/discovery/fold-specifiers.test.ts +8 -0
- package/src/discovery/sandbox/bundle.ts +6 -0
- package/src/discovery/specifier-resolve.ts +8 -2
- package/src/fold/fold.test.ts +72 -0
- package/src/fold/fold.ts +71 -0
- package/src/fold/subset.test.ts +31 -0
- package/src/fold/subset.ts +99 -0
- package/src/lexicon-dist.e2e.test.ts +254 -0
- package/src/lexicon-module.test.ts +47 -0
- package/src/lexicon-module.ts +49 -7
- package/src/lexicon-plugin-helpers.ts +6 -4
- package/src/lexicon.ts +2 -0
- package/src/lifecycle/affected.test.ts +7 -0
- package/src/lifecycle/affected.ts +6 -1
- package/src/lifecycle/release-ledger.ts +34 -0
- package/src/lifecycle/work-dir.test.ts +77 -0
- package/src/lifecycle/work-dir.ts +82 -0
- package/src/lint/discover.test.ts +46 -2
- package/src/lint/discover.ts +55 -49
- package/src/module-source.test.ts +85 -0
- package/src/module-source.ts +112 -0
- package/src/op/activities/factory.ts +1 -1
- package/src/op/discover-root.test.ts +31 -2
- package/src/op/discover.ts +14 -4
- package/src/op/gate.test.ts +30 -0
- package/src/op/gate.ts +3 -0
- package/src/op/local-executor.ts +31 -3
- package/src/op/op-waves-run.ts +20 -5
- package/src/op/op-waves.test.ts +49 -0
- package/src/op/operator.ts +2 -2
- package/src/op/redact.ts +93 -0
- package/src/op/step-console.ts +7 -2
- package/src/op/steward.ts +6 -4
- package/src/op/work-lease-run.test.ts +88 -2
- package/src/op/work-lease-run.ts +52 -12
- package/src/pr-forge-bundle.test.ts +2 -2
- package/src/pr-forge.test.ts +71 -0
- package/src/pr-forge.ts +70 -6
- package/src/pr-loop-bundle.test.ts +2 -1
- package/src/pr-loop.test.ts +117 -1
- package/src/pr-loop.ts +252 -10
- package/src/pr-report-url.ts +58 -6
- package/src/terraform/__fixtures__/advise.test.ts +21 -2
- package/src/ts-loader.test.ts +89 -1
- package/src/ts-loader.ts +180 -13
- package/src/workspace/changes.test.ts +1 -1
- package/src/workspace/chant-migrations/fountain-retired-kinds.test.ts +33 -0
- package/src/workspace/chant-migrations/fountain-retired-kinds.ts +190 -0
- package/src/workspace/chant-migrations.e2e.test.ts +5 -0
- package/src/workspace/chant-migrations.ts +2 -0
- package/src/workspace/checks/boxes.ts +9 -9
- package/src/workspace/ci-green-forge.ts +6 -4
- package/src/workspace/ci-green-runs.test.ts +53 -11
- package/src/workspace/ci-green.test.ts +1 -1
- package/src/workspace/ci-green.ts +50 -22
- package/src/workspace/ci-list.schema.json +12 -6
- package/src/workspace/ci-report-url.test.ts +220 -0
- package/src/workspace/ci-report-url.ts +33 -0
- package/src/workspace/ci-run-index.schema.json +52 -0
- package/src/workspace/ci-run-index.test.ts +392 -0
- package/src/workspace/ci-run-index.ts +206 -0
- package/src/workspace/ci-run.test.ts +520 -42
- package/src/workspace/ci-run.ts +483 -51
- package/src/workspace/ci-runner-key.test.ts +204 -0
- package/src/workspace/ci-runner-key.ts +275 -0
- package/src/workspace/ci-secrets.test.ts +106 -0
- package/src/workspace/ci-secrets.ts +213 -0
- package/src/workspace/ci-serve.test.ts +282 -39
- package/src/workspace/ci-serve.ts +231 -34
- package/src/workspace/declaration.schema.json +7 -2
- package/src/workspace/declaration.test.ts +23 -0
- package/src/workspace/declaration.ts +19 -3
- package/src/workspace/export.ts +6 -3
- package/src/workspace/ls.schema.json +7 -1
- package/src/workspace/ls.ts +7 -2
- package/src/workspace/pin-integrity.test.ts +5 -0
- package/src/workspace/pin-integrity.ts +3 -2
- package/src/workspace/pr-report.schema.json +74 -7
- package/src/workspace/reason-codes.test.ts +2 -0
- package/src/workspace/reason-codes.ts +9 -4
- package/src/workspace/run-event.schema.json +3 -1
- package/src/workspace/status.schema.json +3 -1
- package/src/workspace/trust/trust-write.test.ts +179 -0
- package/src/workspace/trust/trust-write.ts +377 -0
- package/src/workspace/trust-write.schema.json +265 -0
- package/src/workspace/write-scope.test.ts +29 -1
- package/src/workspace/write-scope.ts +12 -1
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Redaction of secret values (#4096): what a run writes about itself, with
|
|
3
|
+
* each secret value replaced by `***`.
|
|
4
|
+
*
|
|
5
|
+
* The executor (./local-executor.ts) takes a {@link Redact} and applies it
|
|
6
|
+
* where a run writes: each run-event line, each line a step prints, and the
|
|
7
|
+
* run record before it is signed and stored. `chant ci run` builds one from
|
|
8
|
+
* the host's secrets file and the job's secret-looking variables
|
|
9
|
+
* (../workspace/ci-secrets.ts).
|
|
10
|
+
*
|
|
11
|
+
* A value shorter than {@link REDACT_MIN_LENGTH} characters is not
|
|
12
|
+
* redacted: a two- or three-character value matches too much ordinary text.
|
|
13
|
+
*/
|
|
14
|
+
/** What every redacted value is replaced with. */
|
|
15
|
+
export const REDACTED = "***";
|
|
16
|
+
/** The shortest value redacted. Shorter values are left as they are. */
|
|
17
|
+
export const REDACT_MIN_LENGTH = 4;
|
|
18
|
+
const escapeRegExp = (s) => s.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
19
|
+
/**
|
|
20
|
+
* The redactor for `values`, or undefined when none is long enough to
|
|
21
|
+
* redact. A value that spans lines is also redacted line by line, since
|
|
22
|
+
* step output reaches a reader one line at a time.
|
|
23
|
+
*/
|
|
24
|
+
export function redactorOf(values) {
|
|
25
|
+
const all = new Set();
|
|
26
|
+
const add = (v) => {
|
|
27
|
+
if (v.length < REDACT_MIN_LENGTH)
|
|
28
|
+
return;
|
|
29
|
+
all.add(v);
|
|
30
|
+
// As a JSON string spells it, for a value with a quote, a backslash or a control character in it.
|
|
31
|
+
all.add(JSON.stringify(v).slice(1, -1));
|
|
32
|
+
};
|
|
33
|
+
for (const value of values) {
|
|
34
|
+
add(value);
|
|
35
|
+
if (value.includes("\n"))
|
|
36
|
+
for (const line of value.split(/\r?\n/))
|
|
37
|
+
add(line.trim());
|
|
38
|
+
}
|
|
39
|
+
if (all.size === 0)
|
|
40
|
+
return undefined;
|
|
41
|
+
// Longest first, so a value that contains another is replaced whole.
|
|
42
|
+
const pattern = new RegExp([...all].sort((a, b) => b.length - a.length).map(escapeRegExp).join("|"), "g");
|
|
43
|
+
return (text) => (typeof text === "string" && text.length >= REDACT_MIN_LENGTH ? text.replace(pattern, REDACTED) : text);
|
|
44
|
+
}
|
|
45
|
+
/** `value` with `redact` applied to every string in it, keys included. Numbers, booleans and nulls are kept. */
|
|
46
|
+
export function redactDeep(value, redact) {
|
|
47
|
+
if (typeof value === "string")
|
|
48
|
+
return redact(value);
|
|
49
|
+
if (Array.isArray(value))
|
|
50
|
+
return value.map((v) => redactDeep(v, redact));
|
|
51
|
+
if (value !== null && typeof value === "object") {
|
|
52
|
+
const out = {};
|
|
53
|
+
for (const [k, v] of Object.entries(value))
|
|
54
|
+
out[redact(k)] = redactDeep(v, redact);
|
|
55
|
+
return out;
|
|
56
|
+
}
|
|
57
|
+
return value;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* A JSON value's text, as `JSON.stringify` wrote it, with `redact` applied to
|
|
61
|
+
* its strings: parsed, redacted and written again, so a short value such as
|
|
62
|
+
* `true` that is also a secret doesn't break the document. Undefined when
|
|
63
|
+
* `text` is not JSON.
|
|
64
|
+
*/
|
|
65
|
+
function redactJsonText(text, redact) {
|
|
66
|
+
let parsed;
|
|
67
|
+
try {
|
|
68
|
+
parsed = JSON.parse(text);
|
|
69
|
+
}
|
|
70
|
+
catch {
|
|
71
|
+
return undefined;
|
|
72
|
+
}
|
|
73
|
+
if (parsed === null || typeof parsed !== "object")
|
|
74
|
+
return undefined;
|
|
75
|
+
const indent = /^[[{]\r?\n(\s+)/.exec(text)?.[1]?.length;
|
|
76
|
+
const trailing = /\s*$/.exec(text)?.[0] ?? "";
|
|
77
|
+
return `${JSON.stringify(redactDeep(parsed, redact), null, indent)}${trailing}`;
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* A file's or line's text redacted: a JSON document as JSON, each line of a
|
|
81
|
+
* JSON Lines text as JSON, and any other text, or line, as text. The text
|
|
82
|
+
* comes back unchanged when it holds no secret.
|
|
83
|
+
*/
|
|
84
|
+
export function redactText(text, redact) {
|
|
85
|
+
if (redact(text) === text)
|
|
86
|
+
return text;
|
|
87
|
+
const whole = redactJsonText(text, redact);
|
|
88
|
+
if (whole !== undefined)
|
|
89
|
+
return whole;
|
|
90
|
+
return text
|
|
91
|
+
.split("\n")
|
|
92
|
+
.map((line) => (redact(line) === line ? line : (redactJsonText(line, redact) ?? redact(line))))
|
|
93
|
+
.join("\n");
|
|
94
|
+
}
|
|
@@ -28,6 +28,8 @@ export declare const STEP_HEARTBEAT_ENV = "CHANT_STEP_HEARTBEAT";
|
|
|
28
28
|
export interface RunConsole {
|
|
29
29
|
write: (line: string) => void;
|
|
30
30
|
heartbeatMs?: number;
|
|
31
|
+
/** Applied to each line before it is written, and to a step's call before it is cut to a label (#4096). */
|
|
32
|
+
redact?: (text: string) => string;
|
|
31
33
|
}
|
|
32
34
|
/** Run `fn` as a run whose steps print through `run`. Without one, steps get no console. */
|
|
33
35
|
export declare function withRunConsole<T>(run: RunConsole | undefined, fn: () => Promise<T>): Promise<T>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"step-console.d.ts","sourceRoot":"","sources":["../../src/op/step-console.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAKH,+EAA+E;AAC/E,eAAO,MAAM,yBAAyB,QAAS,CAAC;AAEhD,iGAAiG;AACjG,eAAO,MAAM,kBAAkB,yBAAyB,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AC,IAAI,EAAE,MAAM,GAAG,IAAI,CAEjD;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,IAAI;IAAE,IAAI,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAAC;IAAC,GAAG,IAAI,IAAI,CAAA;CAAE,CAmBtF;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,GAAG,GAAE,MAAM,CAAC,UAAwB,EAAE,IAAI,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,GAAG,MAAM,CAU9G"}
|
package/dist/op/step-console.js
CHANGED
|
@@ -43,7 +43,10 @@ function formatArgs(args) {
|
|
|
43
43
|
export function stepLabel(fn, args, id) {
|
|
44
44
|
if (id)
|
|
45
45
|
return id;
|
|
46
|
-
|
|
46
|
+
// A secret in the call is redacted before the label is cut, so a cut never leaves part of one.
|
|
47
|
+
const redact = runStore.getStore()?.redact;
|
|
48
|
+
const raw = `${fn}(${formatArgs(args)})`;
|
|
49
|
+
const call = (redact ? redact(raw) : raw).replace(/\s+/g, " ");
|
|
47
50
|
return call.length > MAX_LABEL ? `${call.slice(0, MAX_LABEL - 4)}...)` : call;
|
|
48
51
|
}
|
|
49
52
|
/**
|
|
@@ -55,7 +58,7 @@ export async function withStepConsole(opts, fn) {
|
|
|
55
58
|
const run = runStore.getStore();
|
|
56
59
|
if (!run)
|
|
57
60
|
return fn();
|
|
58
|
-
const
|
|
61
|
+
const write = run.redact ? (line) => run.write(run.redact(line)) : run.write;
|
|
59
62
|
const prefix = `[${opts.phase}] ${opts.label}`;
|
|
60
63
|
const started = Date.now();
|
|
61
64
|
let spoke = false;
|
package/dist/op/steward.d.ts
CHANGED
|
@@ -5,9 +5,11 @@
|
|
|
5
5
|
* A steward runs a fixed list of Ops, each on its own `schedule` when it has
|
|
6
6
|
* one, one Op at a time. Where it runs is its form:
|
|
7
7
|
*
|
|
8
|
-
* - `fountain`: the fountain lexicon's `Steward` composite, an `acp` Agent
|
|
9
|
-
*
|
|
10
|
-
*
|
|
8
|
+
* - `fountain`: the fountain lexicon's `Steward` composite, an `acp` Agent
|
|
9
|
+
* whose runs `chant run <op> --on fountain` sends to one long-lived
|
|
10
|
+
* conversation, resumed by channel_id. A turn is one `chant run <op>` in
|
|
11
|
+
* that conversation. Managoat has no scheduler, so a scheduled Op's cron
|
|
12
|
+
* fires from a clock outside it (a CI schedule, a CronJob).
|
|
11
13
|
* - `local`: `chant operator --steward <name>` in the box itself, for a box
|
|
12
14
|
* with no Fountain behind it (a docker compose box, a Sprites box). The same
|
|
13
15
|
* Ops on the same crons, each run under its operator lease, and the steward
|
|
@@ -124,7 +126,7 @@ export interface StewardBeside {
|
|
|
124
126
|
readonly ready: ActivityStep | null;
|
|
125
127
|
}
|
|
126
128
|
export interface StewardDeclarationConfig {
|
|
127
|
-
/** The steward's name. On Fountain, the Agent's and the
|
|
129
|
+
/** The steward's name. On Fountain, the Agent's, and the key of its conversation. */
|
|
128
130
|
name: string;
|
|
129
131
|
/** The Ops it runs. A scheduled one runs on its cron; any other runs when asked. */
|
|
130
132
|
ops: StewardOpInput[];
|
package/dist/op/steward.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"steward.d.ts","sourceRoot":"","sources":["../../src/op/steward.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"steward.d.ts","sourceRoot":"","sources":["../../src/op/steward.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqFG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAKtD,uDAAuD;AACvD,eAAO,MAAM,YAAY,mBAAmB,CAAC;AAE7C,4BAA4B;AAC5B,eAAO,MAAM,aAAa,YAAI,OAAO,EAAE,UAAU,CAAU,CAAC;AAC5D,MAAM,MAAM,W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,GAAG;IAAE,KAAK,EAAE,OAAO,CAAC;IAAC,IAAI,EAAE,MAAM,EAAE,CAAA;CAAE,GAAG,IAAI,CAYxF;AAED,sEAAsE;AACtE,wBAAgB,cAAc,CAAC,OAAO,EAAE,IAAI,CAAC,kBAAkB,EAAE,MAAM,CAAC,EAAE,GAAG,GAAE,MAA4B,GAAG,WAAW,CAExH;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAExD;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAE5D;AAED;;;GAGG;AACH,wBAAgB,WAAW,CACzB,QAAQ,EAAE,GAAG,CAAC,MAAM,EAAE;IAAE,WAAW,EAAE,kBAAkB,CAAA;CAAE,CAAC,EAC1D,IAAI,EAAE,MAAM,GACX,kBAAkB,GAAG,MAAM,CAU7B"}
|
package/dist/op/steward.js
CHANGED
|
@@ -5,9 +5,11 @@
|
|
|
5
5
|
* A steward runs a fixed list of Ops, each on its own `schedule` when it has
|
|
6
6
|
* one, one Op at a time. Where it runs is its form:
|
|
7
7
|
*
|
|
8
|
-
* - `fountain`: the fountain lexicon's `Steward` composite, an `acp` Agent
|
|
9
|
-
*
|
|
10
|
-
*
|
|
8
|
+
* - `fountain`: the fountain lexicon's `Steward` composite, an `acp` Agent
|
|
9
|
+
* whose runs `chant run <op> --on fountain` sends to one long-lived
|
|
10
|
+
* conversation, resumed by channel_id. A turn is one `chant run <op>` in
|
|
11
|
+
* that conversation. Managoat has no scheduler, so a scheduled Op's cron
|
|
12
|
+
* fires from a clock outside it (a CI schedule, a CronJob).
|
|
11
13
|
* - `local`: `chant operator --steward <name>` in the box itself, for a box
|
|
12
14
|
* with no Fountain behind it (a docker compose box, a Sprites box). The same
|
|
13
15
|
* Ops on the same crons, each run under its operator lease, and the steward
|
|
@@ -39,10 +39,11 @@
|
|
|
39
39
|
*
|
|
40
40
|
* An Op with `changesCheckout` (applying a build, `chant workspace upgrade`)
|
|
41
41
|
* must declare `workLease`, and its leased steps get a git worktree of their
|
|
42
|
-
* own: `chant/work/<item>` checked out
|
|
43
|
-
*
|
|
44
|
-
*
|
|
45
|
-
*
|
|
42
|
+
* own: `chant/work/<item>` checked out at `.chant/work/<item>` in the
|
|
43
|
+
* checkout (#2893), which `<git-common-dir>/info/exclude` keeps out of
|
|
44
|
+
* `git status`, from the checkout's HEAD or from the branch as an earlier run
|
|
45
|
+
* left it. The worktree is removed when the run ends and the branch keeps
|
|
46
|
+
* whatever the steps committed, for the runner to deliver. The checkout a coding agent is
|
|
46
47
|
* editing, its index and its uncommitted files, are never touched.
|
|
47
48
|
*
|
|
48
49
|
* A run that ends `not_done` keeps its attempt aside (#3147): whatever the
|
|
@@ -161,11 +162,23 @@ export declare class RunWorkLease {
|
|
|
161
162
|
*/
|
|
162
163
|
claim(resultsById: ReadonlyMap<string, unknown>): Promise<WorkClaimOutcome>;
|
|
163
164
|
/**
|
|
164
|
-
* A worktree for `id` on `chant/work/[<member>/]<id>`,
|
|
165
|
-
*
|
|
166
|
-
*
|
|
165
|
+
* A worktree for `id` on `chant/work/[<member>/]<id>`, at
|
|
166
|
+
* `<checkout>/.chant/work/[<member>/]<id>` (#2893): inside the checkout, so
|
|
167
|
+
* a coding agent may write there and `node_modules` resolves, and in
|
|
168
|
+
* `<git-common-dir>/info/exclude`, so the checkout's own `git status` never
|
|
169
|
+
* lists it. Starts from the branch when an earlier run left it, from HEAD
|
|
170
|
+
* otherwise. A worktree an earlier run left on the branch, here or where
|
|
171
|
+
* older versions made it under the git directory, is removed first.
|
|
167
172
|
*/
|
|
168
173
|
private makeWorktree;
|
|
174
|
+
/**
|
|
175
|
+
* The registered worktrees that have `branch` checked out at a path chant
|
|
176
|
+
* makes work worktrees at: `.chant/work/[<member>/]<id>` in any checkout,
|
|
177
|
+
* or `<git-common-dir>/chant-work/[<member>/]<id>` where versions before
|
|
178
|
+
* #2893 made them. A run that crashed leaves one behind, and `git worktree
|
|
179
|
+
* add` then refuses the branch as already checked out.
|
|
180
|
+
*/
|
|
181
|
+
private staleWorktrees;
|
|
169
182
|
private lose;
|
|
170
183
|
/** One renewal. Refused, the lease is lost; failed otherwise, the next beat retries. */
|
|
171
184
|
private renew;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"work-lease-run.d.ts","sourceRoot":"","sources":["../../src/op/work-lease-run.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"work-lease-run.d.ts","sourceRoot":"","sources":["../../src/op/work-lease-run.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsDG;AAqBH,OAAO,EAA+B,KAAK,aAAa,EAAE,MAAM,mBAAmB,CAAC;AACpF,OAAO,EAAsB,KAAK,QAAQ,EAAE,MAAM,SAAS,CAAC;AAE5D,OAAO,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAC7C,OAAO,EAAE,iBAAiB,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAE7E,wFAAwF;AACxF,eAAO,MAAM,UAAU,eAAe,CAAC;AAEvC,kEAAkE;AAClE,eAAO,MAAM,kBAAkB,gBAAgB,CAAC;AAEhD,iFAAiF;AACjF,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,8EAA8E;IAC9E,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,qBAAqB;IACrB,GAAG,EAAE,MAAM,CAAC;IACZ,2FAA2F;IAC3F,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,kFAAkF;IAClF,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;CACvB;AAED,gEAAgE;AAChE,MAAM,WAAW,kBAAkB;IACjC,8D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AAC,CAc9B;IAED;;;;OAIG;IACG,MAAM,CAAC,MAAM,EAAE,IAAI,GAAG,MAAM,GAAG,OAAO,GAAG,SAAS,EAAE,WAAW,EAAE,WAAW,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAkDhI;IAED;;;;;OAKG;YACW,WAAW;CAyB1B"}
|
|
@@ -39,10 +39,11 @@
|
|
|
39
39
|
*
|
|
40
40
|
* An Op with `changesCheckout` (applying a build, `chant workspace upgrade`)
|
|
41
41
|
* must declare `workLease`, and its leased steps get a git worktree of their
|
|
42
|
-
* own: `chant/work/<item>` checked out
|
|
43
|
-
*
|
|
44
|
-
*
|
|
45
|
-
*
|
|
42
|
+
* own: `chant/work/<item>` checked out at `.chant/work/<item>` in the
|
|
43
|
+
* checkout (#2893), which `<git-common-dir>/info/exclude` keeps out of
|
|
44
|
+
* `git status`, from the checkout's HEAD or from the branch as an earlier run
|
|
45
|
+
* left it. The worktree is removed when the run ends and the branch keeps
|
|
46
|
+
* whatever the steps committed, for the runner to deliver. The checkout a coding agent is
|
|
46
47
|
* editing, its index and its uncommitted files, are never touched.
|
|
47
48
|
*
|
|
48
49
|
* A run that ends `not_done` keeps its attempt aside (#3147): whatever the
|
|
@@ -53,10 +54,11 @@
|
|
|
53
54
|
* stays readable by its lease token (`chant workspace work history`).
|
|
54
55
|
*/
|
|
55
56
|
import { existsSync, rmSync } from "node:fs";
|
|
56
|
-
import { isAbsolute,
|
|
57
|
+
import { isAbsolute, resolve, sep } from "node:path";
|
|
57
58
|
import { getRuntime } from "../runtime-adapter.js";
|
|
58
59
|
import { claimWorkLease, DEFAULT_WORK_LEASE_TTL_MS, isWorkLeaseOutcome, keptAttemptRef, releaseWorkLease, renewWorkLease, workLeaseRef, isWorkItemId, workItemIdProblem, } from "../lifecycle/work-lease.js";
|
|
59
60
|
import { resolveMemberLedger } from "../lifecycle/member-ledger.js";
|
|
61
|
+
import { excludeWorkDir, legacyWorkWorktreePath, LEGACY_WORK_DIR, removeEmptyWorkDirs, WORK_DIR, workWorktreePath } from "../lifecycle/work-dir.js";
|
|
60
62
|
import { currentHolderId } from "../lifecycle/lease.js";
|
|
61
63
|
import { parseDuration } from "./duration.js";
|
|
62
64
|
import { isStepOutputRef, stepOutput } from "./step-output-ref.js";
|
|
@@ -187,9 +189,13 @@ export class RunWorkLease {
|
|
|
187
189
|
return { kind: "unclaimed", refusal: this.refusal, tried };
|
|
188
190
|
}
|
|
189
191
|
/**
|
|
190
|
-
* A worktree for `id` on `chant/work/[<member>/]<id>`,
|
|
191
|
-
*
|
|
192
|
-
*
|
|
192
|
+
* A worktree for `id` on `chant/work/[<member>/]<id>`, at
|
|
193
|
+
* `<checkout>/.chant/work/[<member>/]<id>` (#2893): inside the checkout, so
|
|
194
|
+
* a coding agent may write there and `node_modules` resolves, and in
|
|
195
|
+
* `<git-common-dir>/info/exclude`, so the checkout's own `git status` never
|
|
196
|
+
* lists it. Starts from the branch when an earlier run left it, from HEAD
|
|
197
|
+
* otherwise. A worktree an earlier run left on the branch, here or where
|
|
198
|
+
* older versions made it under the git directory, is removed first.
|
|
193
199
|
*/
|
|
194
200
|
async makeWorktree(id, members) {
|
|
195
201
|
const cwd = this.opts.cwd;
|
|
@@ -197,12 +203,25 @@ export class RunWorkLease {
|
|
|
197
203
|
if (!common.ok)
|
|
198
204
|
throw new Error(`Op "${this.config.name}" changes the checkout, but ${cwd} is not a git checkout: ${common.stderr}`);
|
|
199
205
|
const commonDir = isAbsolute(common.stdout) ? common.stdout : resolve(cwd, common.stdout);
|
|
206
|
+
// The top as the caller spells it (git's --show-toplevel resolves symbolic links).
|
|
207
|
+
const cdup = await git(["rev-parse", "--show-cdup"], cwd);
|
|
208
|
+
if (!cdup.ok)
|
|
209
|
+
throw new Error(`Op "${this.config.name}" changes the checkout, but ${cwd} has no working tree: ${cdup.stderr}`);
|
|
210
|
+
const top = resolve(cwd, cdup.stdout);
|
|
200
211
|
const scope = members.join("/");
|
|
201
212
|
const branch = `${WORK_BRANCH_PREFIX}${scope ? `${scope}/` : ""}${id}`;
|
|
202
|
-
const worktree =
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
213
|
+
const worktree = workWorktreePath(top, members, id);
|
|
214
|
+
const ignored = (await git(["check-ignore", "-q", `${WORK_DIR}/${id}`], top)).ok;
|
|
215
|
+
excludeWorkDir(commonDir, ignored);
|
|
216
|
+
for (const stale of await this.staleWorktrees(branch, commonDir, members, id)) {
|
|
217
|
+
await git(["worktree", "remove", "--force", stale], cwd);
|
|
218
|
+
rmSync(stale, { recursive: true, force: true });
|
|
219
|
+
}
|
|
220
|
+
for (const dir of [worktree, legacyWorkWorktreePath(commonDir, members, id)]) {
|
|
221
|
+
if (!existsSync(dir))
|
|
222
|
+
continue;
|
|
223
|
+
await git(["worktree", "remove", "--force", dir], cwd);
|
|
224
|
+
rmSync(dir, { recursive: true, force: true });
|
|
206
225
|
}
|
|
207
226
|
await git(["worktree", "prune"], cwd);
|
|
208
227
|
const exists = (await git(["rev-parse", "--verify", "--quiet", `refs/heads/${branch}`], cwd)).ok;
|
|
@@ -216,6 +235,30 @@ export class RunWorkLease {
|
|
|
216
235
|
this.start = { base: base.stdout, members };
|
|
217
236
|
return { worktree, branch };
|
|
218
237
|
}
|
|
238
|
+
/**
|
|
239
|
+
* The registered worktrees that have `branch` checked out at a path chant
|
|
240
|
+
* makes work worktrees at: `.chant/work/[<member>/]<id>` in any checkout,
|
|
241
|
+
* or `<git-common-dir>/chant-work/[<member>/]<id>` where versions before
|
|
242
|
+
* #2893 made them. A run that crashed leaves one behind, and `git worktree
|
|
243
|
+
* add` then refuses the branch as already checked out.
|
|
244
|
+
*/
|
|
245
|
+
async staleWorktrees(branch, commonDir, members, id) {
|
|
246
|
+
const list = await git(["worktree", "list", "--porcelain"], this.opts.cwd);
|
|
247
|
+
if (!list.ok)
|
|
248
|
+
return [];
|
|
249
|
+
const tail = [...members, id].join("/");
|
|
250
|
+
const legacy = legacyWorkWorktreePath(commonDir, members, id).split(sep).join("/");
|
|
251
|
+
const out = [];
|
|
252
|
+
for (const block of list.stdout.split(/\n\s*\n/)) {
|
|
253
|
+
const path = /^worktree (.+)$/m.exec(block)?.[1];
|
|
254
|
+
if (!path || !block.split("\n").includes(`branch refs/heads/${branch}`))
|
|
255
|
+
continue;
|
|
256
|
+
const posixPath = path.split(sep).join("/");
|
|
257
|
+
if (posixPath.endsWith(`/${WORK_DIR}/${tail}`) || posixPath === legacy || posixPath.endsWith(`/${LEGACY_WORK_DIR}/${tail}`))
|
|
258
|
+
out.push(path);
|
|
259
|
+
}
|
|
260
|
+
return out;
|
|
261
|
+
}
|
|
219
262
|
lose(why) {
|
|
220
263
|
if (this.lost !== undefined)
|
|
221
264
|
return;
|
|
@@ -333,6 +376,7 @@ export class RunWorkLease {
|
|
|
333
376
|
if (lease.worktree) {
|
|
334
377
|
await git(["worktree", "remove", "--force", lease.worktree], this.opts.cwd).catch(() => undefined);
|
|
335
378
|
rmSync(lease.worktree, { recursive: true, force: true });
|
|
379
|
+
removeEmptyWorkDirs(lease.worktree);
|
|
336
380
|
await git(["worktree", "prune"], this.opts.cwd).catch(() => undefined);
|
|
337
381
|
}
|
|
338
382
|
if (this.lost !== undefined)
|
package/dist/pr-forge.d.ts
CHANGED
|
@@ -59,6 +59,15 @@ export interface ForgeStatus {
|
|
|
59
59
|
/** GitLab only: the pipeline the status belongs to. */
|
|
60
60
|
pipelineId?: number;
|
|
61
61
|
}
|
|
62
|
+
/** A runner job's commit status (#4097): the states GitHub and Forgejo both keep. */
|
|
63
|
+
export interface CommitStatus {
|
|
64
|
+
context: string;
|
|
65
|
+
state: "pending" | "success" | "failure" | "error";
|
|
66
|
+
/** Cut to 140 characters. */
|
|
67
|
+
description: string;
|
|
68
|
+
/** Where the status links to. Omitted from the request when absent. */
|
|
69
|
+
targetUrl?: string;
|
|
70
|
+
}
|
|
62
71
|
/** A commit status's state, as a caller names it. */
|
|
63
72
|
export type ForgeStatusState = "pending" | "running" | "success" | "failed" | "failure" | "canceled" | "error";
|
|
64
73
|
/** Every {@link ForgeStatusState}, for a caller that reads one from its own input. */
|
|
@@ -257,6 +266,14 @@ export interface PrForge {
|
|
|
257
266
|
*/
|
|
258
267
|
addComment(pr: number, body: string): Promise<AddedComment>;
|
|
259
268
|
setStatus(sha: string, status: ForgeStatus): Promise<void>;
|
|
269
|
+
/**
|
|
270
|
+
* GitHub and Forgejo (#4097): set a commit status from a runner's job, one
|
|
271
|
+
* of `pending`, `success`, `failure` or `error`. The request is the one
|
|
272
|
+
* {@link setStatus} sends (`POST /repos/{owner}/{repo}/statuses/{sha}`), with
|
|
273
|
+
* the description cut to 140 characters and `target_url` only when given.
|
|
274
|
+
* `chant ci run` posts a job's progress through it.
|
|
275
|
+
*/
|
|
276
|
+
setCommitStatus?(sha: string, status: CommitStatus): Promise<void>;
|
|
260
277
|
/**
|
|
261
278
|
* Keep one OPEN tracking issue for `marker` in line with `finding`: open
|
|
262
279
|
* it, update its title and body, or, when `finding` is `null` and
|
|
@@ -279,6 +296,16 @@ export interface PrForge {
|
|
|
279
296
|
upsertIssue(marker: string, title: string, body: string): Promise<string | undefined>;
|
|
280
297
|
/** Logins whose standing review approves `pr`. */
|
|
281
298
|
approvers(pr: number): Promise<string[]>;
|
|
299
|
+
/**
|
|
300
|
+
* Logins of the people who wrote `pr` (#4000): its author, and the author
|
|
301
|
+
* and committer of each of its commits. GitHub and Forgejo name a commit's
|
|
302
|
+
* people by the account its email belongs to; a commit whose email is on no
|
|
303
|
+
* account adds nobody. GitLab names them by email only, so each email is
|
|
304
|
+
* looked up among the users (`GET /users?search=`), which matches an
|
|
305
|
+
* account's public email; an email no account shows publicly adds nobody.
|
|
306
|
+
* Sorted, without repeats.
|
|
307
|
+
*/
|
|
308
|
+
authors(pr: number): Promise<string[]>;
|
|
282
309
|
/** The merged pull request that produced `sha`, or null. */
|
|
283
310
|
pullRequestFor(sha: string): Promise<number | null>;
|
|
284
311
|
/**
|
package/dist/pr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MG;AACH,eAAO,MAAM,iBAAiB,EAAE,MAAM,CAAC,SAAS,EAAE,SAAS,MAAM,EAAE,CAIlE,CAAC;AAoBF;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,kBAAkB,CAAC,GAAG,GAAE,GAAiB,EAAE,IAAI,GAAE,kBAAuB,GAAG,WAAW,CAuErG;AAED,8FAA8F;AAC9F,wBAAgB,WAAW,CAAC,MAAM,EAAE,WAAW,EAAE,SAAS,CAAC,EAAE,UAAU,GAAG,OAAO,CAgBhF"}
|
package/dist/pr-forge.js
CHANGED
|
@@ -270,6 +270,14 @@ function githubShaped(kind, opts) {
|
|
|
270
270
|
await api.call("PATCH", `${repo}/issues/${n}`, { state: "closed" });
|
|
271
271
|
},
|
|
272
272
|
};
|
|
273
|
+
const postStatus = async (sha, state, context, description, url) => {
|
|
274
|
+
await api.call("POST", `${repo}/statuses/${sha}`, {
|
|
275
|
+
state: statusStateFor(kind, state),
|
|
276
|
+
context,
|
|
277
|
+
description: description.slice(0, GITHUB_DESCRIPTION),
|
|
278
|
+
...(url ? { target_url: url } : {}),
|
|
279
|
+
});
|
|
280
|
+
};
|
|
273
281
|
return {
|
|
274
282
|
kind,
|
|
275
283
|
host,
|
|
@@ -277,12 +285,10 @@ function githubShaped(kind, opts) {
|
|
|
277
285
|
principalOf: (login) => forgePrincipalOf(kind, host, login),
|
|
278
286
|
...threadCalls(t),
|
|
279
287
|
async setStatus(sha, status) {
|
|
280
|
-
await
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
...(status.url ? { target_url: status.url } : {}),
|
|
285
|
-
});
|
|
288
|
+
await postStatus(sha, status.state, status.context, status.description, status.url);
|
|
289
|
+
},
|
|
290
|
+
async setCommitStatus(sha, status) {
|
|
291
|
+
await postStatus(sha, status.state, status.context, status.description, status.targetUrl);
|
|
286
292
|
},
|
|
287
293
|
async approvers(pr) {
|
|
288
294
|
// A reviewer's newest deciding review is their standing one. A comment
|
|
@@ -301,6 +307,23 @@ function githubShaped(kind, opts) {
|
|
|
301
307
|
}
|
|
302
308
|
return [...standing].filter(([, state]) => state === "APPROVED").map(([login]) => login).sort();
|
|
303
309
|
},
|
|
310
|
+
async authors(pr) {
|
|
311
|
+
const logins = new Set();
|
|
312
|
+
const add = (v) => {
|
|
313
|
+
if (isObject(v) && typeof v.login === "string" && v.login !== "")
|
|
314
|
+
logins.add(v.login);
|
|
315
|
+
};
|
|
316
|
+
const opened = await api.call("GET", `${repo}/pulls/${pr}`);
|
|
317
|
+
if (isObject(opened))
|
|
318
|
+
add(opened.user);
|
|
319
|
+
for (const c of await api.list(`${repo}/pulls/${pr}/commits`, pageParams, pageSize)) {
|
|
320
|
+
if (!isObject(c))
|
|
321
|
+
continue;
|
|
322
|
+
add(c.author);
|
|
323
|
+
add(c.committer);
|
|
324
|
+
}
|
|
325
|
+
return [...logins].sort();
|
|
326
|
+
},
|
|
304
327
|
async pullRequestFor(sha) {
|
|
305
328
|
if (kind === "forgejo") {
|
|
306
329
|
try {
|
|
@@ -555,6 +578,28 @@ export function gitlabForge(opts) {
|
|
|
555
578
|
.filter((l) => l !== undefined);
|
|
556
579
|
return [...new Set(logins)].sort();
|
|
557
580
|
},
|
|
581
|
+
async authors(mr) {
|
|
582
|
+
const logins = new Set();
|
|
583
|
+
const merge = await api.call("GET", `${notes}/${mr}`);
|
|
584
|
+
const author = isObject(merge) ? authorOf(merge) : undefined;
|
|
585
|
+
if (author)
|
|
586
|
+
logins.add(author);
|
|
587
|
+
const emails = new Set();
|
|
588
|
+
for (const c of await api.list(`${notes}/${mr}/commits`, pageParams, 100)) {
|
|
589
|
+
if (!isObject(c))
|
|
590
|
+
continue;
|
|
591
|
+
for (const email of [str(c.author_email), str(c.committer_email)])
|
|
592
|
+
if (email)
|
|
593
|
+
emails.add(email.toLowerCase());
|
|
594
|
+
}
|
|
595
|
+
for (const email of [...emails].sort()) {
|
|
596
|
+
const users = await api.call("GET", `/users?search=${encodeURIComponent(email)}`);
|
|
597
|
+
for (const u of Array.isArray(users) ? users : [])
|
|
598
|
+
if (isObject(u) && typeof u.username === "string")
|
|
599
|
+
logins.add(u.username);
|
|
600
|
+
}
|
|
601
|
+
return [...logins].sort();
|
|
602
|
+
},
|
|
558
603
|
async pullRequestFor(sha) {
|
|
559
604
|
const mrs = await api.call("GET", `${project}/repository/commits/${sha}/merge_requests`);
|
|
560
605
|
if (!Array.isArray(mrs))
|