@intentius/chant 0.124.88 → 0.124.89
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/actor.d.ts +36 -1
- package/dist/actor.d.ts.map +1 -1
- package/dist/actor.js +39 -1
- package/dist/chant-install.d.ts.map +1 -1
- package/dist/chant-install.js +1 -2
- package/dist/ci-base.d.ts +30 -0
- package/dist/ci-base.d.ts.map +1 -0
- package/dist/ci-base.js +33 -0
- package/dist/ci-comment-commands.d.ts +177 -0
- package/dist/ci-comment-commands.d.ts.map +1 -0
- package/dist/ci-comment-commands.js +325 -0
- package/dist/ci-comment-replies.d.ts +40 -0
- package/dist/ci-comment-replies.d.ts.map +1 -0
- package/dist/ci-comment-replies.js +59 -0
- package/dist/ci-evidence-from-job.d.ts +25 -0
- package/dist/ci-evidence-from-job.d.ts.map +1 -1
- package/dist/ci-evidence-from-job.js +43 -2
- package/dist/ci-evidence-jobs.d.ts +30 -1
- package/dist/ci-evidence-jobs.d.ts.map +1 -1
- package/dist/ci-evidence-jobs.js +46 -3
- package/dist/ci-image.d.ts +21 -4
- package/dist/ci-image.d.ts.map +1 -1
- package/dist/ci-image.js +62 -10
- package/dist/ci-note-commands.d.ts +63 -3
- package/dist/ci-note-commands.d.ts.map +1 -1
- package/dist/ci-note-commands.js +69 -35
- package/dist/ci-product-words.d.ts +42 -0
- package/dist/ci-product-words.d.ts.map +1 -1
- package/dist/ci-product-words.js +25 -0
- package/dist/ci-product.d.ts +31 -0
- package/dist/ci-product.d.ts.map +1 -1
- package/dist/ci-product.js +34 -4
- package/dist/cli/commands/build.d.ts.map +1 -1
- package/dist/cli/commands/build.js +29 -2
- package/dist/cli/handlers/approve.d.ts.map +1 -1
- package/dist/cli/handlers/approve.js +2 -1
- package/dist/cli/handlers/ci-check.d.ts +1 -1
- package/dist/cli/handlers/ci-check.d.ts.map +1 -1
- package/dist/cli/handlers/ci-check.js +17 -7
- package/dist/cli/handlers/ci-evidence.d.ts.map +1 -1
- package/dist/cli/handlers/ci-evidence.js +33 -7
- package/dist/cli/handlers/components.d.ts.map +1 -1
- package/dist/cli/handlers/components.js +3 -1
- package/dist/cli/handlers/generated-check.d.ts +8 -0
- package/dist/cli/handlers/generated-check.d.ts.map +1 -1
- package/dist/cli/handlers/generated-check.js +31 -1
- package/dist/cli/handlers/lock.d.ts.map +1 -1
- package/dist/cli/handlers/lock.js +121 -4
- package/dist/cli/handlers/pr-comment.d.ts +21 -0
- package/dist/cli/handlers/pr-comment.d.ts.map +1 -0
- package/dist/cli/handlers/pr-comment.js +112 -0
- package/dist/cli/handlers/pr-env.d.ts.map +1 -1
- package/dist/cli/handlers/pr-env.js +6 -3
- package/dist/cli/handlers/pr.d.ts +23 -1
- package/dist/cli/handlers/pr.d.ts.map +1 -1
- package/dist/cli/handlers/pr.js +55 -9
- package/dist/cli/handlers/promote.d.ts.map +1 -1
- package/dist/cli/handlers/promote.js +2 -1
- package/dist/cli/handlers/release.d.ts.map +1 -1
- package/dist/cli/handlers/release.js +11 -2
- package/dist/cli/handlers/run-wave.d.ts.map +1 -1
- package/dist/cli/handlers/run-wave.js +28 -2
- package/dist/cli/handlers/run.d.ts.map +1 -1
- package/dist/cli/handlers/run.js +2 -1
- package/dist/cli/main.d.ts.map +1 -1
- package/dist/cli/main.js +24 -2
- package/dist/cli/parse-args.d.ts.map +1 -1
- package/dist/cli/parse-args.js +16 -0
- package/dist/cli/registry.d.ts +11 -0
- package/dist/cli/registry.d.ts.map +1 -1
- package/dist/components/auto-release.d.ts.map +1 -1
- package/dist/components/auto-release.js +2 -1
- package/dist/components/pr-checks.d.ts +70 -6
- package/dist/components/pr-checks.d.ts.map +1 -1
- package/dist/components/pr-checks.js +74 -13
- package/dist/components/pr-pipeline.d.ts +16 -12
- package/dist/components/pr-pipeline.d.ts.map +1 -1
- package/dist/components/pr-pipeline.js +3 -11
- package/dist/components/product-pipeline.d.ts +42 -1
- package/dist/components/product-pipeline.d.ts.map +1 -1
- package/dist/components/product-pipeline.js +64 -12
- package/dist/components/product-plan.d.ts +190 -5
- package/dist/components/product-plan.d.ts.map +1 -1
- package/dist/components/product-plan.js +220 -39
- package/dist/drift-record.d.ts +7 -0
- package/dist/drift-record.d.ts.map +1 -1
- package/dist/drift-record.js +19 -0
- package/dist/floor-table.data.d.ts.map +1 -1
- package/dist/floor-table.data.js +54 -31
- package/dist/forge-check/contract.d.ts +11 -1
- package/dist/forge-check/contract.d.ts.map +1 -1
- package/dist/forge-check/contract.js +4 -1
- package/dist/forge-check/index.d.ts +2 -0
- package/dist/forge-check/index.d.ts.map +1 -1
- package/dist/forge-check/index.js +2 -0
- package/dist/gate-resume-run.d.ts +9 -1
- package/dist/gate-resume-run.d.ts.map +1 -1
- package/dist/gate-resume-run.js +26 -3
- package/dist/generated-check.d.ts +18 -4
- package/dist/generated-check.d.ts.map +1 -1
- package/dist/generated-check.js +37 -5
- package/dist/image-pins.d.ts +26 -0
- package/dist/image-pins.d.ts.map +1 -0
- package/dist/image-pins.js +19 -0
- package/dist/lexicon.d.ts +11 -0
- package/dist/lexicon.d.ts.map +1 -1
- package/dist/lifecycle/git.d.ts +11 -0
- package/dist/lifecycle/git.d.ts.map +1 -1
- package/dist/lifecycle/git.js +30 -3
- package/dist/lifecycle/publish-npm.d.ts +11 -0
- package/dist/lifecycle/publish-npm.d.ts.map +1 -1
- package/dist/lifecycle/publish-npm.js +27 -1
- package/dist/lifecycle/reach-locks.d.ts +131 -0
- package/dist/lifecycle/reach-locks.d.ts.map +1 -0
- package/dist/lifecycle/reach-locks.js +118 -0
- package/dist/lifecycle/release-cut.d.ts +3 -1
- package/dist/lifecycle/release-cut.d.ts.map +1 -1
- package/dist/lifecycle/release-cut.js +15 -0
- package/dist/lifecycle/release-images.d.ts.map +1 -1
- package/dist/lifecycle/release-images.js +1 -2
- package/dist/notify-product.d.ts +12 -3
- package/dist/notify-product.d.ts.map +1 -1
- package/dist/notify-product.js +10 -6
- package/dist/op/activities/source-release.d.ts.map +1 -1
- package/dist/op/activities/source-release.js +2 -1
- package/dist/op/activities/source-rollback.d.ts.map +1 -1
- package/dist/op/activities/source-rollback.js +2 -1
- package/dist/op/index.d.ts +2 -0
- package/dist/op/index.d.ts.map +1 -1
- package/dist/op/index.js +1 -0
- package/dist/op/op-waves-evidence-jobs.d.ts +6 -1
- package/dist/op/op-waves-evidence-jobs.d.ts.map +1 -1
- package/dist/op/op-waves-evidence-jobs.js +9 -3
- package/dist/op/op-waves-render-spec.d.ts +100 -0
- package/dist/op/op-waves-render-spec.d.ts.map +1 -0
- package/dist/op/op-waves-render-spec.js +162 -0
- package/dist/op/op-waves-run.d.ts +2 -0
- package/dist/op/op-waves-run.d.ts.map +1 -1
- package/dist/op/op-waves-run.js +2 -1
- package/dist/op/op-waves.d.ts +4 -0
- package/dist/op/op-waves.d.ts.map +1 -1
- package/dist/op/op-waves.js +4 -1
- package/dist/op/schedule-overdue.d.ts.map +1 -1
- package/dist/op/schedule-overdue.js +59 -3
- package/dist/op/wave-stop.d.ts +64 -0
- package/dist/op/wave-stop.d.ts.map +1 -0
- package/dist/op/wave-stop.js +127 -0
- package/dist/planned-files.d.ts +76 -0
- package/dist/planned-files.d.ts.map +1 -0
- package/dist/planned-files.js +108 -0
- package/dist/pr-forge-job.d.ts +22 -0
- package/dist/pr-forge-job.d.ts.map +1 -0
- package/dist/pr-forge-job.js +46 -0
- package/dist/pr-loop.d.ts +3 -6
- package/dist/pr-loop.d.ts.map +1 -1
- package/dist/pr-loop.js +4 -81
- package/dist/pr-plan-note.d.ts +97 -0
- package/dist/pr-plan-note.d.ts.map +1 -1
- package/dist/pr-plan-note.js +94 -1
- package/dist/pr-post.d.ts +28 -3
- package/dist/pr-post.d.ts.map +1 -1
- package/dist/pr-post.js +145 -13
- package/dist/pr-status.d.ts +16 -0
- package/dist/pr-status.d.ts.map +1 -0
- package/dist/pr-status.js +90 -0
- package/dist/ref-gate-init.d.ts +16 -2
- package/dist/ref-gate-init.d.ts.map +1 -1
- package/dist/ref-gate-init.js +24 -13
- package/dist/release-floors.d.ts +37 -1
- package/dist/release-floors.d.ts.map +1 -1
- package/dist/release-floors.js +61 -25
- package/dist/render-module.d.ts +15 -0
- package/dist/render-module.d.ts.map +1 -0
- package/dist/render-module.js +73 -0
- package/dist/state-migration.d.ts.map +1 -1
- package/dist/state-migration.js +1 -2
- package/dist/wave-runtime.mjs +304 -301
- package/dist/workspace/ci-green-cli.d.ts.map +1 -1
- package/dist/workspace/ci-green-cli.js +3 -2
- package/dist/workspace/release-train.d.ts.map +1 -1
- package/dist/workspace/release-train.js +2 -1
- package/dist/workspace/release-workflow.d.ts +4 -3
- package/dist/workspace/release-workflow.d.ts.map +1 -1
- package/dist/workspace/release-workflow.js +10 -7
- package/dist/workspace/trust/check-evidence-report.d.ts +7 -2
- package/dist/workspace/trust/check-evidence-report.d.ts.map +1 -1
- package/dist/workspace/trust/check-evidence-report.js +15 -8
- package/dist/workspace/trust/ref-gate-cli.d.ts +10 -1
- package/dist/workspace/trust/ref-gate-cli.d.ts.map +1 -1
- package/dist/workspace/trust/ref-gate-cli.js +30 -10
- package/dist/workspace/workspace-run.d.ts.map +1 -1
- package/dist/workspace/workspace-run.js +2 -1
- package/package.json +1 -1
- package/src/actor.test.ts +68 -2
- package/src/actor.ts +61 -1
- package/src/chant-install.test.ts +2 -3
- package/src/chant-install.ts +1 -2
- package/src/ci-base.test.ts +41 -0
- package/src/ci-base.ts +43 -0
- package/src/ci-comment-commands.test.ts +376 -0
- package/src/ci-comment-commands.ts +389 -0
- package/src/ci-comment-replies.ts +78 -0
- package/src/ci-commit.test.ts +2 -3
- package/src/ci-evidence-from-job.test.ts +18 -0
- package/src/ci-evidence-from-job.ts +58 -2
- package/src/ci-evidence-jobs.ts +50 -5
- package/src/ci-image.test.ts +130 -9
- package/src/ci-image.ts +85 -12
- package/src/ci-note-commands.ts +104 -41
- package/src/ci-product-words.ts +59 -0
- package/src/ci-product.ts +40 -4
- package/src/cli/commands/build.test.ts +41 -0
- package/src/cli/commands/build.ts +27 -2
- package/src/cli/handlers/approve.ts +2 -1
- package/src/cli/handlers/ci-check.ts +19 -7
- package/src/cli/handlers/ci-evidence.ts +29 -8
- package/src/cli/handlers/components.ts +3 -1
- package/src/cli/handlers/generated-check.ts +31 -1
- package/src/cli/handlers/lock-reach.test.ts +103 -0
- package/src/cli/handlers/lock.ts +100 -4
- package/src/cli/handlers/pr-comment.ts +104 -0
- package/src/cli/handlers/pr-env.ts +6 -3
- package/src/cli/handlers/pr-record.test.ts +1 -1
- package/src/cli/handlers/pr.ts +50 -10
- package/src/cli/handlers/promote.ts +2 -1
- package/src/cli/handlers/release.e2e.test.ts +35 -0
- package/src/cli/handlers/release.ts +14 -2
- package/src/cli/handlers/run-wave.ts +28 -2
- package/src/cli/handlers/run.ts +2 -1
- package/src/cli/main.ts +24 -2
- package/src/cli/parse-args.ts +12 -0
- package/src/cli/registry.ts +11 -0
- package/src/components/auto-release.ts +2 -1
- package/src/components/pr-checks.ts +112 -17
- package/src/components/pr-pipeline.ts +17 -15
- package/src/components/product-pipeline.ts +93 -11
- package/src/components/product-plan.test.ts +40 -2
- package/src/components/product-plan.ts +331 -45
- package/src/drift-record.test.ts +20 -0
- package/src/drift-record.ts +16 -0
- package/src/floor-table.data.ts +54 -31
- package/src/forge-check/contract.ts +12 -1
- package/src/forge-check/forge-check.test.ts +17 -0
- package/src/forge-check/index.ts +2 -0
- package/src/gate-resume-run.ts +27 -3
- package/src/generated-check.e2e.test.ts +21 -1
- package/src/generated-check.test.ts +66 -0
- package/src/generated-check.ts +51 -10
- package/src/image-pins.ts +31 -0
- package/src/lexicon.ts +11 -0
- package/src/lifecycle/git.test.ts +48 -0
- package/src/lifecycle/git.ts +27 -4
- package/src/lifecycle/publish-npm.ts +31 -1
- package/src/lifecycle/reach-locks.test.ts +87 -0
- package/src/lifecycle/reach-locks.ts +169 -0
- package/src/lifecycle/release-cut.ts +17 -1
- package/src/lifecycle/release-images.test.ts +56 -0
- package/src/lifecycle/release-images.ts +1 -2
- package/src/notify-product.ts +19 -8
- package/src/op/activities/source-release.ts +2 -1
- package/src/op/activities/source-rollback.ts +2 -1
- package/src/op/gate-resume.test.ts +27 -0
- package/src/op/index.ts +10 -0
- package/src/op/op-waves-evidence-jobs.ts +10 -4
- package/src/op/op-waves-notify-words.test.ts +18 -0
- package/src/op/op-waves-render-spec.test.ts +160 -0
- package/src/op/op-waves-render-spec.ts +171 -0
- package/src/op/op-waves-run.ts +2 -1
- package/src/op/op-waves.ts +5 -2
- package/src/op/schedule-overdue.test.ts +43 -0
- package/src/op/schedule-overdue.ts +57 -3
- package/src/op/wave-stop.test.ts +72 -0
- package/src/op/wave-stop.ts +137 -0
- package/src/planned-files.test.ts +80 -0
- package/src/planned-files.ts +134 -0
- package/src/pr-forge-job.test.ts +53 -0
- package/src/pr-forge-job.ts +46 -0
- package/src/pr-loop-narrowed.test.ts +2 -1
- package/src/pr-loop-words.test.ts +2 -1
- package/src/pr-loop.test.ts +1 -2
- package/src/pr-loop.ts +4 -80
- package/src/pr-plan-note.ts +155 -3
- package/src/pr-post-replan.test.ts +144 -0
- package/src/pr-post-subject.test.ts +230 -0
- package/src/pr-post.test.ts +2 -1
- package/src/pr-post.ts +150 -15
- package/src/pr-status.ts +91 -0
- package/src/ref-gate-init.ts +30 -11
- package/src/release-floors.ts +78 -25
- package/src/render-module.ts +73 -0
- package/src/state-migration-record.test.ts +2 -3
- package/src/state-migration.ts +1 -2
- package/src/workspace/ci-green-cli.ts +3 -2
- package/src/workspace/ci-green-workflow.test.ts +32 -1
- package/src/workspace/release-train.ts +2 -1
- package/src/workspace/release-workflow.test.ts +36 -5
- package/src/workspace/release-workflow.ts +10 -7
- package/src/workspace/trust/check-evidence-report.ts +15 -8
- package/src/workspace/trust/check-evidence.test.ts +5 -0
- package/src/workspace/trust/ref-gate-cli.ts +30 -8
- package/src/workspace/trust/ref-gate-pieces.test.ts +46 -1
- package/src/workspace/trust/ref-gate.test.ts +10 -0
- package/src/workspace/workspace-run.ts +2 -1
package/dist/actor.d.ts
CHANGED
|
@@ -3,10 +3,45 @@
|
|
|
3
3
|
* actor in a job (`GITHUB_ACTOR`, which Forgejo sets too, then
|
|
4
4
|
* `GITLAB_USER_LOGIN`), else the login (`USER`, `USERNAME` on Windows).
|
|
5
5
|
* The terraform and pulumi lexicons' gated requests and the products'
|
|
6
|
-
* requesters read it here rather than each writing the order
|
|
6
|
+
* requesters read it here rather than each writing the order, and so do
|
|
7
|
+
* chant's own CLI handlers and the records they write (#4952). A caller
|
|
8
|
+
* that refuses when nobody is named passes `""` as the fallback.
|
|
9
|
+
*
|
|
10
|
+
* {@link actorOf} is the same order with the two places a product's
|
|
11
|
+
* requester also looks (#4966): `GITHUB_TRIGGERING_ACTOR` ahead of the
|
|
12
|
+
* forge's actor, which names who re-ran a job rather than who started its
|
|
13
|
+
* run, and git's `user.name` in the checkout between the forge's actor and
|
|
14
|
+
* the login, which names the person at a laptop better than `$USER`.
|
|
7
15
|
*/
|
|
8
16
|
/** The actor fallback's variables, in the order {@link actorFromEnv} reads them. */
|
|
9
17
|
export declare const ACTOR_ENV_ORDER: readonly ["GITHUB_ACTOR", "GITLAB_USER_LOGIN", "USER", "USERNAME"];
|
|
10
18
|
/** The first of {@link ACTOR_ENV_ORDER} set to something other than blanks, else `fallback` (default `unknown`). */
|
|
11
19
|
export declare function actorFromEnv(env?: Record<string, string | undefined>, fallback?: string): string;
|
|
20
|
+
/** Which of the places {@link actorOf} reads, and the answer when none is set. */
|
|
21
|
+
export interface ActorOptions {
|
|
22
|
+
/** The variables. Default `process.env`. */
|
|
23
|
+
env?: Record<string, string | undefined>;
|
|
24
|
+
/** Read `GITHUB_TRIGGERING_ACTOR` first: who re-ran the job, ahead of who started the run. Default false. */
|
|
25
|
+
triggering?: boolean;
|
|
26
|
+
/** Read the forge's actor (`GITHUB_ACTOR`, `GITLAB_USER_LOGIN`). Default true. */
|
|
27
|
+
forge?: boolean;
|
|
28
|
+
/** A checkout whose git config is read after the forge's actor. Unset, git is not asked. */
|
|
29
|
+
repo?: string;
|
|
30
|
+
/** The git config keys read in `repo`, in order. Default `["user.name"]`. */
|
|
31
|
+
gitKeys?: readonly string[];
|
|
32
|
+
/** Read the login (`USER`, `USERNAME`) last. Default true. */
|
|
33
|
+
login?: boolean;
|
|
34
|
+
/** The answer when nothing is set. Default `unknown`; `""` for a caller that refuses. */
|
|
35
|
+
fallback?: string;
|
|
36
|
+
}
|
|
37
|
+
/** The places {@link actorOf} reads for `options`, in order: variable names, and `git:<key>` for a git config key. */
|
|
38
|
+
export declare function actorOrder(options?: Omit<ActorOptions, "env" | "fallback">): string[];
|
|
39
|
+
/**
|
|
40
|
+
* The first place of {@link actorOrder} set to something other than blanks,
|
|
41
|
+
* else `fallback` (#4966). With no options it answers as
|
|
42
|
+
* {@link actorFromEnv}. A git config key is read only when every place
|
|
43
|
+
* before it is empty, so a job with a forge actor runs no git.
|
|
44
|
+
*/
|
|
45
|
+
export declare function actorOf(options?: ActorOptions): string;
|
|
46
|
+
export { ACTOR_ORDER_FLOOR } from "./release-floors.js";
|
|
12
47
|
//# sourceMappingURL=actor.d.ts.map
|
package/dist/actor.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"actor.d.ts","sourceRoot":"","sources":["../src/actor.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"actor.d.ts","sourceRoot":"","sources":["../src/actor.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAIH,oFAAoF;AACpF,eAAO,MAAM,eAAe,YAAI,cAAc,EAAE,mBAAmB,EAAE,MAAM,EAAE,UAAU,CAAU,CAAC;AAElG,oHAAoH;AACpH,wBAAgB,YAAY,CAAC,GAAG,GAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAe,EAAE,QAAQ,SAAY,GAAG,MAAM,CAMhH;AAED,kFAAkF;AAClF,MAAM,WAAW,YAAY;IAC3B,4CAA4C;IAC5C,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC;IACzC,6GAA6G;IAC7G,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,kFAAkF;IAClF,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,4FAA4F;IAC5F,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,6EAA6E;IAC7E,OAAO,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAC5B,8DAA8D;IAC9D,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,yFAAyF;IACzF,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,sHAAsH;AACtH,wBAAgB,UAAU,CAAC,OAAO,GAAE,IAAI,CAAC,YAAY,EAAE,KAAK,GAAG,UAAU,CAAM,GAAG,MAAM,EAAE,CAOzF;AAOD;;;;;GAKG;AACH,wBAAgB,OAAO,CAAC,OAAO,GAAE,YAAiB,GAAG,MAAM,CAO1D;AAED,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC"}
|
package/dist/actor.js
CHANGED
|
@@ -3,8 +3,17 @@
|
|
|
3
3
|
* actor in a job (`GITHUB_ACTOR`, which Forgejo sets too, then
|
|
4
4
|
* `GITLAB_USER_LOGIN`), else the login (`USER`, `USERNAME` on Windows).
|
|
5
5
|
* The terraform and pulumi lexicons' gated requests and the products'
|
|
6
|
-
* requesters read it here rather than each writing the order
|
|
6
|
+
* requesters read it here rather than each writing the order, and so do
|
|
7
|
+
* chant's own CLI handlers and the records they write (#4952). A caller
|
|
8
|
+
* that refuses when nobody is named passes `""` as the fallback.
|
|
9
|
+
*
|
|
10
|
+
* {@link actorOf} is the same order with the two places a product's
|
|
11
|
+
* requester also looks (#4966): `GITHUB_TRIGGERING_ACTOR` ahead of the
|
|
12
|
+
* forge's actor, which names who re-ran a job rather than who started its
|
|
13
|
+
* run, and git's `user.name` in the checkout between the forge's actor and
|
|
14
|
+
* the login, which names the person at a laptop better than `$USER`.
|
|
7
15
|
*/
|
|
16
|
+
import { spawnSync } from "node:child_process";
|
|
8
17
|
/** The actor fallback's variables, in the order {@link actorFromEnv} reads them. */
|
|
9
18
|
export const ACTOR_ENV_ORDER = ["GITHUB_ACTOR", "GITLAB_USER_LOGIN", "USER", "USERNAME"];
|
|
10
19
|
/** The first of {@link ACTOR_ENV_ORDER} set to something other than blanks, else `fallback` (default `unknown`). */
|
|
@@ -16,3 +25,32 @@ export function actorFromEnv(env = process.env, fallback = "unknown") {
|
|
|
16
25
|
}
|
|
17
26
|
return fallback;
|
|
18
27
|
}
|
|
28
|
+
/** The places {@link actorOf} reads for `options`, in order: variable names, and `git:<key>` for a git config key. */
|
|
29
|
+
export function actorOrder(options = {}) {
|
|
30
|
+
return [
|
|
31
|
+
...(options.triggering ? ["GITHUB_TRIGGERING_ACTOR"] : []),
|
|
32
|
+
...(options.forge === false ? [] : ["GITHUB_ACTOR", "GITLAB_USER_LOGIN"]),
|
|
33
|
+
...(options.repo !== undefined ? (options.gitKeys ?? ["user.name"]).map((k) => `git:${k}`) : []),
|
|
34
|
+
...(options.login === false ? [] : ["USER", "USERNAME"]),
|
|
35
|
+
];
|
|
36
|
+
}
|
|
37
|
+
function gitConfig(repo, key) {
|
|
38
|
+
const r = spawnSync("git", ["-C", repo, "config", key], { encoding: "utf-8", stdio: ["ignore", "pipe", "ignore"] });
|
|
39
|
+
return r.status === 0 ? r.stdout.trim() : undefined;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* The first place of {@link actorOrder} set to something other than blanks,
|
|
43
|
+
* else `fallback` (#4966). With no options it answers as
|
|
44
|
+
* {@link actorFromEnv}. A git config key is read only when every place
|
|
45
|
+
* before it is empty, so a job with a forge actor runs no git.
|
|
46
|
+
*/
|
|
47
|
+
export function actorOf(options = {}) {
|
|
48
|
+
const env = options.env ?? process.env;
|
|
49
|
+
for (const place of actorOrder(options)) {
|
|
50
|
+
const v = (place.startsWith("git:") ? gitConfig(options.repo, place.slice(4)) : env[place])?.trim();
|
|
51
|
+
if (v)
|
|
52
|
+
return v;
|
|
53
|
+
}
|
|
54
|
+
return options.fallback ?? "unknown";
|
|
55
|
+
}
|
|
56
|
+
export { ACTOR_ORDER_FLOOR } from "./release-floors.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chant-install.d.ts","sourceRoot":"","sources":["../src/chant-install.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;
|
|
1
|
+
{"version":3,"file":"chant-install.d.ts","sourceRoot":"","sources":["../src/chant-install.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAQH,0TAA0T;AAC1T,eAAO,MAAM,eAAe,aAAa,CAAC;AAE1C,0CAA0C;AAC1C,MAAM,WAAW,YAAY;IAC3B,gDAAgD;IAChD,IAAI,EAAE,MAAM,CAAC;IACb,+DAA+D;IAC/D,GAAG,EAAE,MAAM,CAAC;IACZ,qEAAqE;IACrE,MAAM,EAAE,MAAM,CAAC;IACf,gDAAgD;IAChD,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAsBD;;;;;;GAMG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,GAAG,YAAY,GAAG,SAAS,CAWhF;AAID;;;;;;GAMG;AACH,wBAAgB,YAAY,IAAI,YAAY,GAAG,SAAS,CAMvD;AAED;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,OAAO,GAAE;IAAE,KAAK,CAAC,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,SAAS,MAAM,EAAE,CAAA;CAAO,GAAG,MAAM,CAE/F;AAED;;;;;GAKG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,EAAE,OAAO,GAAE;IAAE,OAAO,CAAC,EAAE,YAAY,CAAC;IAAC,QAAQ,CAAC,EAAE,SAAS,MAAM,EAAE,CAAA;C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FileSync } from "node:fs";
|
|
|
32
32
|
import * as nodeModule from "node:module";
|
|
33
33
|
import { delimiter, dirname, join, resolve, sep } from "node:path";
|
|
34
34
|
import { fileURLToPath, pathToFileURL } from "node:url";
|
|
35
|
-
import { NEXT_RELEASE } from "./release-floors.js";
|
|
36
35
|
/** The first chant with `runChant`, `lastJsonLine`, `installResolveFallback` and `fallbackImportArgs` in `@intentius/chant/chant-install` (#4889): a product runs chant and reads its `--json` document, and a file with no `node_modules` above it imports the product's packages, with no code of the product's own. */
|
|
37
|
-
export const CHANT_RUN_FLOOR =
|
|
36
|
+
export const CHANT_RUN_FLOOR = "0.124.88";
|
|
38
37
|
const PACKAGE = "@intentius/chant";
|
|
39
38
|
/** The install whose manifest is `<root>/package.json`, when it is chant's and names a bin that is there. */
|
|
40
39
|
function installAt(root) {
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `@intentius/chant/ci-base` (#4966): the base a CI job measures a change
|
|
3
|
+
* from, read off the job's own variables, so a product's check and policy
|
|
4
|
+
* steps need no rule of their own for it (terragucci's `policyBase`).
|
|
5
|
+
*
|
|
6
|
+
* - A pull request's job: its target branch, `origin/<target>`
|
|
7
|
+
* (`GITHUB_BASE_REF` on GitHub and Forgejo, GitLab's
|
|
8
|
+
* `CI_MERGE_REQUEST_TARGET_BRANCH_NAME`).
|
|
9
|
+
* - A push to a branch other than the default branch: `origin/<default>`,
|
|
10
|
+
* so a change that edits a check or a policy on a side branch is still
|
|
11
|
+
* judged by the default branch's.
|
|
12
|
+
* - A push to the default branch, or a job with no branch: no base, and
|
|
13
|
+
* the checkout's own files are the trusted ones.
|
|
14
|
+
*
|
|
15
|
+
* `chant ci check` takes it as its `--base` when none is given.
|
|
16
|
+
*
|
|
17
|
+
* This module imports nothing.
|
|
18
|
+
*/
|
|
19
|
+
export interface CiBaseOptions {
|
|
20
|
+
/** A base the caller already has (a flag, a product's own variable); it wins over everything. */
|
|
21
|
+
base?: string;
|
|
22
|
+
/** The default branch. Default GitLab's `CI_DEFAULT_BRANCH`; GitHub and Forgejo jobs carry none, so a product passes its own. */
|
|
23
|
+
defaultBranch?: string;
|
|
24
|
+
/** The remote the branches are fetched from. Default `origin`. */
|
|
25
|
+
remote?: string;
|
|
26
|
+
}
|
|
27
|
+
/** The base ref for the job `env` describes, as the module comment says; undefined when there is none. */
|
|
28
|
+
export declare function ciBaseRef(env?: Record<string, string | undefined>, options?: CiBaseOptions): string | undefined;
|
|
29
|
+
export { CI_BASE_REF_FLOOR } from "./release-floors.js";
|
|
30
|
+
//# sourceMappingURL=ci-base.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ci-base.d.ts","sourceRoot":"","sources":["../src/ci-base.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,MAAM,WAAW,aAAa;IAC5B,iGAAiG;IACjG,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,iIAAiI;IACjI,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,kEAAkE;IAClE,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAID,0GAA0G;AAC1G,wBAAgB,SAAS,CAAC,GAAG,GAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAe,EAAE,OAAO,GAAE,aAAkB,GAAG,MAAM,GAAG,SAAS,CAShI;AAED,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC"}
|
package/dist/ci-base.js
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `@intentius/chant/ci-base` (#4966): the base a CI job measures a change
|
|
3
|
+
* from, read off the job's own variables, so a product's check and policy
|
|
4
|
+
* steps need no rule of their own for it (terragucci's `policyBase`).
|
|
5
|
+
*
|
|
6
|
+
* - A pull request's job: its target branch, `origin/<target>`
|
|
7
|
+
* (`GITHUB_BASE_REF` on GitHub and Forgejo, GitLab's
|
|
8
|
+
* `CI_MERGE_REQUEST_TARGET_BRANCH_NAME`).
|
|
9
|
+
* - A push to a branch other than the default branch: `origin/<default>`,
|
|
10
|
+
* so a change that edits a check or a policy on a side branch is still
|
|
11
|
+
* judged by the default branch's.
|
|
12
|
+
* - A push to the default branch, or a job with no branch: no base, and
|
|
13
|
+
* the checkout's own files are the trusted ones.
|
|
14
|
+
*
|
|
15
|
+
* `chant ci check` takes it as its `--base` when none is given.
|
|
16
|
+
*
|
|
17
|
+
* This module imports nothing.
|
|
18
|
+
*/
|
|
19
|
+
const set = (v) => (v && v.trim() ? v.trim() : undefined);
|
|
20
|
+
/** The base ref for the job `env` describes, as the module comment says; undefined when there is none. */
|
|
21
|
+
export function ciBaseRef(env = process.env, options = {}) {
|
|
22
|
+
const given = set(options.base);
|
|
23
|
+
if (given)
|
|
24
|
+
return given;
|
|
25
|
+
const remote = options.remote ?? "origin";
|
|
26
|
+
const target = set(env.GITHUB_BASE_REF) ?? set(env.CI_MERGE_REQUEST_TARGET_BRANCH_NAME);
|
|
27
|
+
if (target)
|
|
28
|
+
return `${remote}/${target}`;
|
|
29
|
+
const branch = set(env.GITHUB_REF_NAME) ?? set(env.CI_COMMIT_BRANCH);
|
|
30
|
+
const main = set(options.defaultBranch) ?? set(env.CI_DEFAULT_BRANCH);
|
|
31
|
+
return branch && main && branch !== main ? `${remote}/${main}` : undefined;
|
|
32
|
+
}
|
|
33
|
+
export { CI_BASE_REF_FLOOR } from "./release-floors.js";
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The comment job on GitHub and Forgejo (#4946): one job that reads every
|
|
3
|
+
* `/<product>` comment and answers the ones no other job of the pipeline
|
|
4
|
+
* takes, the GitHub and Forgejo half of what the GitLab note poll does
|
|
5
|
+
* (./ci-note-commands.ts). Moved from terragucci's `decideComment` and
|
|
6
|
+
* `decideApplyComment` (comment.ts, comment-apply.ts).
|
|
7
|
+
*
|
|
8
|
+
* GitHub and Forgejo start a workflow on the comment itself, so each job
|
|
9
|
+
* that answers a command (the re-plan, the comment lock and unlock, the
|
|
10
|
+
* action job, the agent, the commit jobs, the apply before merge) starts on
|
|
11
|
+
* its own comment, and this job leaves those comments alone. It answers the
|
|
12
|
+
* rest:
|
|
13
|
+
*
|
|
14
|
+
* - a comment the grammar refuses (`parseProductComment` with
|
|
15
|
+
* `leaveCommit`, so a commit word stays the commit job's), with the
|
|
16
|
+
* grammar's reason, an alias's product reason among them
|
|
17
|
+
* (`CiProductAlias.refuse`);
|
|
18
|
+
* - a command no job runs (`plan`, `apply`, `lock`, `unlock`, `action`,
|
|
19
|
+
* `agent`), with the words' reply for it (`words.replies`) or chant's;
|
|
20
|
+
* - with `applyOnMerge`, `/<product> apply` on a merged pull request: the
|
|
21
|
+
* newest push run at its merge commit that has an apply job is started
|
|
22
|
+
* again, unless a later commit of the default branch already carries the
|
|
23
|
+
* product's apply status. On GitHub the run's failed jobs run again
|
|
24
|
+
* (`rerun-failed-jobs`), each wave behind its own gate. Forgejo has no
|
|
25
|
+
* call that runs a run again, so the waves workflow is dispatched on the
|
|
26
|
+
* default branch, and only while the merge commit is still the branch's
|
|
27
|
+
* newest push. A forge re-run cannot stop the waves after one, so with
|
|
28
|
+
* the waves' op (`jobs.waves`, #4979) a `wave-<n>` writes a stop for the
|
|
29
|
+
* merge commit on `chant/lifecycle` before the run starts, and the waves
|
|
30
|
+
* after n wait (./op/wave-stop.ts); without it a wave-n is refused. On a
|
|
31
|
+
* fork, a pull request merged elsewhere, or one closed without merging,
|
|
32
|
+
* the reply says so.
|
|
33
|
+
* - with `noPlanFlags` (#4979), a plan comment with flags the product
|
|
34
|
+
* plan's re-plan cannot take, with the reason.
|
|
35
|
+
*
|
|
36
|
+
* Who asked comes first. On GitHub the commenter's permission is read from
|
|
37
|
+
* the forge; Forgejo answers 403 when a job's token asks for another user's
|
|
38
|
+
* permission, so there the event's `repository.permissions`, computed for
|
|
39
|
+
* the comment's author when the comment was created, is read, and the
|
|
40
|
+
* event must be for this repository and from the comment's author. Someone
|
|
41
|
+
* without write access gets no reply and nothing runs, as on GitLab.
|
|
42
|
+
*
|
|
43
|
+
* The comment is untrusted input: it is read from the event file, never
|
|
44
|
+
* from an expression in a script, and nothing of it reaches a shell. The
|
|
45
|
+
* job runs at the target branch's commit, so none of the change's code
|
|
46
|
+
* runs here.
|
|
47
|
+
*/
|
|
48
|
+
import { type ApplyRerun, type ChantNoteJobs, type StartedRun } from "./ci-note-commands.js";
|
|
49
|
+
import { type CiProductWords, type ParsedProductComment } from "./ci-product-words.js";
|
|
50
|
+
import { type ForgeFetch, type PrForge } from "./pr-forge.js";
|
|
51
|
+
import type { ForgeReads } from "./pr-forge-reads.js";
|
|
52
|
+
/** The comment job's name in a generated workflow (#4946). */
|
|
53
|
+
export declare const PR_COMMENT_JOB = "comment";
|
|
54
|
+
/** The variable the comment job reads the pipeline's jobs from, as JSON ({@link CommentJobs}), written by the generator (#4946). */
|
|
55
|
+
export declare const COMMENT_JOBS_ENV = "CHANT_COMMENT_JOBS";
|
|
56
|
+
/**
|
|
57
|
+
* The jobs the pipeline has that answer a comment (#4946), so the comment
|
|
58
|
+
* job leaves their comments to them. `preview` is any job that plans on the
|
|
59
|
+
* plan comment (the product plan's re-plan, or the comment preview).
|
|
60
|
+
*/
|
|
61
|
+
export interface CommentJobs extends Omit<ChantNoteJobs, "members"> {
|
|
62
|
+
/** The action command is answered by a workflow: the product's own, or the pipeline's action job. */
|
|
63
|
+
actions?: boolean;
|
|
64
|
+
/**
|
|
65
|
+
* The product plan's targets, with its re-plan: a plan comment naming
|
|
66
|
+
* another is skipped by every re-plan job without a word, so the comment
|
|
67
|
+
* job replies with the words' `member` sentence.
|
|
68
|
+
*/
|
|
69
|
+
targets?: readonly string[];
|
|
70
|
+
/** The product plan's re-plan skips a fork's pull request (`forks: "skip"`) without a word, so the comment job replies with the words' `fork` sentence. */
|
|
71
|
+
skipForks?: boolean;
|
|
72
|
+
/**
|
|
73
|
+
* The plan comment's job is the product plan's re-plan (#4979), which
|
|
74
|
+
* takes at most one word after the command and no flags: a plan comment
|
|
75
|
+
* with `--target`, `--refresh` or `--target-dependents` gets a reply that
|
|
76
|
+
* says so, where the re-plan would skip it without a word.
|
|
77
|
+
*/
|
|
78
|
+
noPlanFlags?: boolean;
|
|
79
|
+
/**
|
|
80
|
+
* The waves on merge (#4979): the op they run as and how many there are.
|
|
81
|
+
* With them a merged pull request's `/<product> apply wave-<n>` runs the
|
|
82
|
+
* apply again and stops after wave n: the job writes the stop on
|
|
83
|
+
* `chant/lifecycle` for the merge commit (./op/wave-stop.ts) before it
|
|
84
|
+
* starts the run, and each later wave waits. An apply without a wave
|
|
85
|
+
* clears it.
|
|
86
|
+
*/
|
|
87
|
+
waves?: {
|
|
88
|
+
op: string;
|
|
89
|
+
count: number;
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
/** Writes a wave stop for op `op` at `sha` on `chant/lifecycle`, or clears it (#4979). */
|
|
93
|
+
export type CommentWaveStops = (op: string, sha: string, stop: {
|
|
94
|
+
through: number;
|
|
95
|
+
at: string;
|
|
96
|
+
by?: string;
|
|
97
|
+
pr?: number;
|
|
98
|
+
} | null) => Promise<void>;
|
|
99
|
+
/**
|
|
100
|
+
* The apply jobs a re-run looks for at a merge commit: chant's op waves
|
|
101
|
+
* (`wave-<k>-<name>`, its decide and share jobs) and chant's and
|
|
102
|
+
* terragucci's pull request loop jobs (`apply`, `apply-wave-<k>`).
|
|
103
|
+
*/
|
|
104
|
+
export declare const RERUN_APPLY_JOBS: RegExp;
|
|
105
|
+
/** The writes a re-run makes, with the job's token. */
|
|
106
|
+
export interface CommentRuns {
|
|
107
|
+
/** GitHub: `POST /repos/{repo}/actions/runs/{run}/rerun-failed-jobs`. */
|
|
108
|
+
rerunFailed(run: number): Promise<StartedRun>;
|
|
109
|
+
/** Forgejo: `POST /repos/{repo}/actions/workflows/{workflow}/dispatches` on `ref`. */
|
|
110
|
+
dispatch(workflow: string, ref: string): Promise<StartedRun>;
|
|
111
|
+
}
|
|
112
|
+
/** The writes for a GitHub or Forgejo API root, repository and token. */
|
|
113
|
+
export declare function commentRuns(opts: {
|
|
114
|
+
apiBase: string;
|
|
115
|
+
repo: string;
|
|
116
|
+
token: string;
|
|
117
|
+
fetch?: ForgeFetch;
|
|
118
|
+
}): CommentRuns;
|
|
119
|
+
/** What {@link answerProductComment} takes. */
|
|
120
|
+
export interface AnswerCommentOptions {
|
|
121
|
+
forge: "github" | "forgejo";
|
|
122
|
+
/** The `issue_comment` event, as the event file has it. */
|
|
123
|
+
event: unknown;
|
|
124
|
+
/** `owner/name`. */
|
|
125
|
+
repo: string;
|
|
126
|
+
reads: ForgeReads;
|
|
127
|
+
/** chant's client, holding the job's token: it posts the reply and reads the statuses. */
|
|
128
|
+
poster: Pick<PrForge, "addComment" | "commitStatuses">;
|
|
129
|
+
runs: CommentRuns;
|
|
130
|
+
words: CiProductWords;
|
|
131
|
+
/** The default branch. */
|
|
132
|
+
base: string;
|
|
133
|
+
jobs: CommentJobs;
|
|
134
|
+
/** The job's environment, for the words' aliases. */
|
|
135
|
+
env?: Record<string, string | undefined>;
|
|
136
|
+
/** The commit words that take an argument, as `parseProductComment` takes them. */
|
|
137
|
+
commitArgs?: Readonly<Record<string, RegExp>>;
|
|
138
|
+
/** With `jobs.waves` (#4979): writes the wave stop before a re-run starts. Absent: a `wave-<n>` is refused, as before. */
|
|
139
|
+
stops?: CommentWaveStops;
|
|
140
|
+
/** The time a stop is written at. Default now. */
|
|
141
|
+
now?: () => string;
|
|
142
|
+
}
|
|
143
|
+
/** What the comment job did. */
|
|
144
|
+
export interface CommentOutcome {
|
|
145
|
+
/** The command's kind, when the comment parsed as one. */
|
|
146
|
+
command?: string;
|
|
147
|
+
/** True when a run was started again. */
|
|
148
|
+
ran: boolean;
|
|
149
|
+
/** True when the job posted a reply. */
|
|
150
|
+
replied: boolean;
|
|
151
|
+
/** True when something broke (a forge answer), not because the comment asked for nothing. The command exits non-zero on it. */
|
|
152
|
+
fail?: boolean;
|
|
153
|
+
reason: string;
|
|
154
|
+
url?: string;
|
|
155
|
+
}
|
|
156
|
+
/** The command a comment asks for, for a job that only needs to know: the grammar's reading, leaving a commit word to the commit job. */
|
|
157
|
+
export declare function readProductComment(words: CiProductWords, body: unknown, env?: Record<string, string | undefined>, commitArgs?: Readonly<Record<string, RegExp>>): ParsedProductComment | undefined;
|
|
158
|
+
/**
|
|
159
|
+
* Whether another job of the pipeline answers `parsed` on an open or a
|
|
160
|
+
* merged pull request, so the comment job says nothing (#4946).
|
|
161
|
+
*/
|
|
162
|
+
export declare function answeredElsewhere(parsed: Exclude<ParsedProductComment, {
|
|
163
|
+
kind: "refused";
|
|
164
|
+
}>, jobs: CommentJobs, open: boolean | undefined): boolean;
|
|
165
|
+
/** Read the comment, and answer it when no other job does (#4946). */
|
|
166
|
+
export declare function answerProductComment(o: AnswerCommentOptions): Promise<CommentOutcome>;
|
|
167
|
+
/** The reply to a plan comment with flags the product plan's re-plan cannot take (#4979). */
|
|
168
|
+
export declare function planFlagsReply(words: CiProductWords): string;
|
|
169
|
+
/** GitHub's start: run the run's failed jobs again, and the jobs that need them. */
|
|
170
|
+
export declare function githubRerun(runs: Pick<CommentRuns, "rerunFailed">): ApplyRerun;
|
|
171
|
+
/**
|
|
172
|
+
* Forgejo's start: Forgejo has no call that runs a run again, so the run's
|
|
173
|
+
* workflow is dispatched on the default branch, which runs its head. That
|
|
174
|
+
* is the merge commit only while no push came after it.
|
|
175
|
+
*/
|
|
176
|
+
export declare function forgejoRerun(runs: Pick<CommentRuns, "dispatch">, reads: Pick<ForgeReads, "branchRuns">): ApplyRerun;
|
|
177
|
+
//# sourceMappingURL=ci-comment-commands.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ci-comment-commands.d.ts","sourceRoot":"","sources":["../src/ci-comment-commands.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CG;AAGH,OAAO,E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