@intentius/chant 0.124.86 → 0.124.88
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/action-pins.d.ts +1 -0
- package/dist/action-pins.d.ts.map +1 -1
- package/dist/action-pins.js +2 -0
- package/dist/actor.d.ts +12 -0
- package/dist/actor.d.ts.map +1 -0
- package/dist/actor.js +18 -0
- package/dist/bundle-check.d.ts +20 -5
- package/dist/bundle-check.d.ts.map +1 -1
- package/dist/bundle-check.js +20 -5
- package/dist/chant-install.d.ts +98 -0
- package/dist/chant-install.d.ts.map +1 -1
- package/dist/chant-install.js +204 -2
- package/dist/ci-commit.d.ts.map +1 -1
- package/dist/ci-commit.js +1 -2
- package/dist/ci-control.d.ts +1 -1
- package/dist/ci-control.d.ts.map +1 -1
- package/dist/ci-control.js +1 -1
- package/dist/ci-evidence-claims.d.ts +59 -0
- package/dist/ci-evidence-claims.d.ts.map +1 -0
- package/dist/ci-evidence-claims.js +87 -0
- package/dist/ci-evidence-from-job.d.ts +103 -0
- package/dist/ci-evidence-from-job.d.ts.map +1 -0
- package/dist/ci-evidence-from-job.js +162 -0
- package/dist/ci-evidence-jobs.d.ts +69 -10
- package/dist/ci-evidence-jobs.d.ts.map +1 -1
- package/dist/ci-evidence-jobs.js +72 -8
- package/dist/ci-handover.d.ts +12 -0
- package/dist/ci-handover.d.ts.map +1 -1
- package/dist/ci-handover.js +15 -3
- package/dist/ci-identity.d.ts +32 -6
- package/dist/ci-identity.d.ts.map +1 -1
- package/dist/ci-identity.js +40 -8
- package/dist/ci-image.d.ts +47 -9
- package/dist/ci-image.d.ts.map +1 -1
- package/dist/ci-image.js +45 -18
- package/dist/ci-jobs.d.ts +1 -1
- package/dist/ci-jobs.d.ts.map +1 -1
- package/dist/ci-jobs.js +7 -2
- package/dist/ci-login.d.ts +75 -13
- package/dist/ci-login.d.ts.map +1 -1
- package/dist/ci-login.js +89 -37
- package/dist/ci-product-words.d.ts +20 -1
- package/dist/ci-product-words.d.ts.map +1 -1
- package/dist/ci-product-words.js +27 -1
- package/dist/ci-product.d.ts +20 -1
- package/dist/ci-product.d.ts.map +1 -1
- package/dist/ci-product.js +21 -2
- package/dist/cli/handlers/approve-confirm.d.ts +14 -0
- package/dist/cli/handlers/approve-confirm.d.ts.map +1 -1
- package/dist/cli/handlers/approve-confirm.js +46 -0
- package/dist/cli/handlers/build.d.ts +1 -1
- package/dist/cli/handlers/build.d.ts.map +1 -1
- package/dist/cli/handlers/build.js +22 -1
- package/dist/cli/handlers/ci-check.d.ts.map +1 -1
- package/dist/cli/handlers/ci-check.js +38 -14
- package/dist/cli/handlers/ci-evidence.d.ts.map +1 -1
- package/dist/cli/handlers/ci-evidence.js +238 -26
- package/dist/cli/handlers/ci-forge-check.d.ts.map +1 -1
- package/dist/cli/handlers/ci-forge-check.js +34 -17
- package/dist/cli/handlers/generated-check.d.ts +3 -0
- package/dist/cli/handlers/generated-check.d.ts.map +1 -0
- package/dist/cli/handlers/generated-check.js +41 -0
- package/dist/cli/handlers/lifecycle.d.ts.map +1 -1
- package/dist/cli/handlers/lifecycle.js +3 -0
- package/dist/cli/handlers/local-chant.d.ts +13 -0
- package/dist/cli/handlers/local-chant.d.ts.map +1 -1
- package/dist/cli/handlers/local-chant.js +42 -1
- package/dist/cli/handlers/pr.d.ts.map +1 -1
- package/dist/cli/handlers/pr.js +42 -5
- package/dist/cli/handlers/run-wave.js +8 -0
- package/dist/cli/main.d.ts.map +1 -1
- package/dist/cli/main.js +38 -4
- package/dist/cli/parse-args.d.ts.map +1 -1
- package/dist/cli/parse-args.js +66 -0
- package/dist/cli/registry.d.ts +24 -0
- package/dist/cli/registry.d.ts.map +1 -1
- package/dist/components/check-hooks.d.ts +10 -0
- package/dist/components/check-hooks.d.ts.map +1 -1
- package/dist/components/check-hooks.js +21 -3
- package/dist/components/check-steps.js +1 -1
- package/dist/components/pr-checks.d.ts +105 -0
- package/dist/components/pr-checks.d.ts.map +1 -0
- package/dist/components/pr-checks.js +119 -0
- package/dist/components/pr-pipeline.d.ts +34 -0
- package/dist/components/pr-pipeline.d.ts.map +1 -1
- package/dist/components/pr-pipeline.js +14 -1
- package/dist/components/product-pipeline.d.ts +16 -1
- package/dist/components/product-pipeline.d.ts.map +1 -1
- package/dist/components/product-pipeline.js +17 -2
- package/dist/components/product-plan.d.ts +262 -3
- package/dist/components/product-plan.d.ts.map +1 -1
- package/dist/components/product-plan.js +243 -11
- package/dist/config.d.ts +10 -6
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +11 -6
- package/dist/control/consumers.d.ts +6 -0
- package/dist/control/consumers.d.ts.map +1 -1
- package/dist/control/consumers.js +6 -0
- package/dist/dead-guards.d.ts.map +1 -1
- package/dist/dead-guards.js +9 -6
- package/dist/discovery/files.d.ts +1 -1
- package/dist/discovery/files.js +1 -1
- package/dist/drift-issue.d.ts +20 -3
- package/dist/drift-issue.d.ts.map +1 -1
- package/dist/drift-issue.js +16 -0
- package/dist/drift-record.d.ts +45 -5
- package/dist/drift-record.d.ts.map +1 -1
- package/dist/drift-record.js +27 -6
- package/dist/floor-table.d.ts +6 -6
- package/dist/floor-table.d.ts.map +1 -1
- package/dist/floor-table.data.d.ts.map +1 -1
- package/dist/floor-table.data.js +58 -20
- package/dist/floor-table.js +10 -7
- package/dist/forge-check/contract.d.ts +8 -0
- 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/forge-flags.d.ts +10 -0
- package/dist/forge-flags.d.ts.map +1 -1
- package/dist/forge-flags.js +31 -0
- package/dist/forge-remote.d.ts +47 -0
- package/dist/forge-remote.d.ts.map +1 -0
- package/dist/forge-remote.js +69 -0
- package/dist/generated-check.d.ts +74 -0
- package/dist/generated-check.d.ts.map +1 -0
- package/dist/generated-check.js +216 -0
- package/dist/lexicon.d.ts +16 -0
- package/dist/lexicon.d.ts.map +1 -1
- package/dist/lifecycle/publish-npm.d.ts +15 -0
- package/dist/lifecycle/publish-npm.d.ts.map +1 -1
- package/dist/lifecycle/publish-npm.js +49 -3
- package/dist/lifecycle/release-images.d.ts +22 -1
- package/dist/lifecycle/release-images.d.ts.map +1 -1
- package/dist/lifecycle/release-images.js +27 -3
- package/dist/lifecycle/release-ledger.d.ts +4 -3
- package/dist/lifecycle/release-ledger.d.ts.map +1 -1
- package/dist/lifecycle/release-ledger.js +3 -2
- package/dist/local-chant.d.ts +57 -3
- package/dist/local-chant.d.ts.map +1 -1
- package/dist/local-chant.js +122 -13
- package/dist/op/op-waves-evidence-jobs.d.ts +92 -0
- package/dist/op/op-waves-evidence-jobs.d.ts.map +1 -0
- package/dist/op/op-waves-evidence-jobs.js +112 -0
- package/dist/op/op-waves-evidence.d.ts +17 -4
- package/dist/op/op-waves-evidence.d.ts.map +1 -1
- package/dist/op/op-waves-evidence.js +32 -10
- package/dist/op/op-waves-run.d.ts +12 -1
- package/dist/op/op-waves-run.d.ts.map +1 -1
- package/dist/op/op-waves-run.js +54 -3
- package/dist/op/op-waves.d.ts +8 -0
- package/dist/op/op-waves.d.ts.map +1 -1
- package/dist/op/op-waves.js +10 -0
- package/dist/op/schedule-overdue.d.ts +39 -2
- package/dist/op/schedule-overdue.d.ts.map +1 -1
- package/dist/op/schedule-overdue.js +89 -7
- package/dist/pr-forge-reads.d.ts +21 -1
- package/dist/pr-forge-reads.d.ts.map +1 -1
- package/dist/pr-forge-reads.js +19 -1
- package/dist/pr-forge.d.ts +7 -1
- package/dist/pr-forge.d.ts.map +1 -1
- package/dist/pr-forge.js +7 -2
- package/dist/pr-plan-note.d.ts +24 -0
- package/dist/pr-plan-note.d.ts.map +1 -1
- package/dist/pr-plan-note.js +11 -1
- package/dist/pr-plan-record.d.ts +47 -0
- package/dist/pr-plan-record.d.ts.map +1 -0
- package/dist/pr-plan-record.js +89 -0
- package/dist/pr-post.d.ts +40 -0
- package/dist/pr-post.d.ts.map +1 -1
- package/dist/pr-post.js +79 -6
- package/dist/pr-requires.d.ts +8 -0
- package/dist/pr-requires.d.ts.map +1 -1
- package/dist/pr-requires.js +3 -1
- package/dist/ref-gate-init.d.ts +76 -0
- package/dist/ref-gate-init.d.ts.map +1 -0
- package/dist/ref-gate-init.js +144 -0
- package/dist/ref-gate-rules.d.ts +19 -0
- package/dist/ref-gate-rules.d.ts.map +1 -0
- package/dist/ref-gate-rules.js +17 -0
- package/dist/release-floors.d.ts +51 -1
- package/dist/release-floors.d.ts.map +1 -1
- package/dist/release-floors.js +66 -16
- package/dist/state-migration.d.ts +23 -0
- package/dist/state-migration.d.ts.map +1 -1
- package/dist/state-migration.js +39 -3
- package/dist/state-unlock.d.ts +32 -1
- package/dist/state-unlock.d.ts.map +1 -1
- package/dist/state-unlock.js +31 -0
- package/dist/wave-runtime.mjs +310 -303
- package/dist/workspace/ci-green-cli.d.ts.map +1 -1
- package/dist/workspace/ci-green-cli.js +13 -7
- package/dist/workspace/ci-green.d.ts.map +1 -1
- package/dist/workspace/ci-green.js +4 -3
- package/dist/workspace/drift-cli.d.ts +1 -1
- package/dist/workspace/drift-cli.d.ts.map +1 -1
- package/dist/workspace/drift-cli.js +5 -12
- package/dist/workspace/forge-work.d.ts +3 -2
- package/dist/workspace/forge-work.d.ts.map +1 -1
- package/dist/workspace/forge-work.js +7 -17
- package/dist/workspace/lexicon-outputs.js +2 -2
- package/dist/workspace/release-workflow.d.ts +26 -3
- package/dist/workspace/release-workflow.d.ts.map +1 -1
- package/dist/workspace/release-workflow.js +48 -6
- package/dist/workspace/trust/check-evidence-report.d.ts +25 -0
- package/dist/workspace/trust/check-evidence-report.d.ts.map +1 -1
- package/dist/workspace/trust/check-evidence-report.js +20 -0
- package/dist/workspace/trust/check-evidence.d.ts +59 -13
- package/dist/workspace/trust/check-evidence.d.ts.map +1 -1
- package/dist/workspace/trust/check-evidence.js +101 -24
- package/dist/workspace/trust/ci-tag-statement.d.ts +2 -2
- package/dist/workspace/trust/ci-tag-statement.d.ts.map +1 -1
- package/dist/workspace/trust/dsse.d.ts +40 -2
- package/dist/workspace/trust/dsse.d.ts.map +1 -1
- package/dist/workspace/trust/dsse.js +34 -2
- package/dist/workspace/trust/evidence.d.ts +7 -2
- package/dist/workspace/trust/evidence.d.ts.map +1 -1
- package/dist/workspace/trust/evidence.js +5 -0
- package/dist/workspace/trust/keyless-fixture.d.ts +41 -0
- package/dist/workspace/trust/keyless-fixture.d.ts.map +1 -0
- package/dist/workspace/trust/keyless-fixture.js +161 -0
- package/dist/workspace/trust/keyless.d.ts +202 -0
- package/dist/workspace/trust/keyless.d.ts.map +1 -0
- package/dist/workspace/trust/keyless.js +488 -0
- package/dist/workspace/trust/local-evidence.d.ts +3 -0
- package/dist/workspace/trust/local-evidence.d.ts.map +1 -1
- package/dist/workspace/trust/op-run-statement.d.ts +2 -2
- package/dist/workspace/trust/op-run-statement.d.ts.map +1 -1
- package/dist/workspace/trust/open-evidence.d.ts +67 -0
- package/dist/workspace/trust/open-evidence.d.ts.map +1 -0
- package/dist/workspace/trust/open-evidence.js +92 -0
- package/dist/workspace/trust/policy.d.ts +56 -1
- package/dist/workspace/trust/policy.d.ts.map +1 -1
- package/dist/workspace/trust/policy.js +103 -2
- package/dist/workspace/trust/ref-gate-cli.d.ts.map +1 -1
- package/dist/workspace/trust/ref-gate-cli.js +65 -3
- package/dist/workspace/trust/ref-gate.d.ts +62 -3
- package/dist/workspace/trust/ref-gate.d.ts.map +1 -1
- package/dist/workspace/trust/ref-gate.js +75 -8
- package/dist/workspace/trust/run-statement.d.ts +3 -3
- package/dist/workspace/trust/run-statement.d.ts.map +1 -1
- package/dist/workspace/trust/runner-identity.d.ts +56 -0
- package/dist/workspace/trust/runner-identity.d.ts.map +1 -0
- package/dist/workspace/trust/runner-identity.js +65 -0
- package/dist/workspace/trust/trust-files.d.ts.map +1 -1
- package/dist/workspace/trust/trust-files.js +8 -1
- package/package.json +1 -1
- package/src/action-pins.ts +2 -0
- package/src/actor.test.ts +12 -0
- package/src/actor.ts +19 -0
- package/src/bundle-check.test.ts +22 -0
- package/src/bundle-check.ts +33 -5
- package/src/chant-install.test.ts +109 -1
- package/src/chant-install.ts +243 -2
- package/src/ci-commit.test.ts +51 -5
- package/src/ci-commit.ts +1 -2
- package/src/ci-control.ts +1 -0
- package/src/ci-evidence-claims.ts +102 -0
- package/src/ci-evidence-from-job.test.ts +147 -0
- package/src/ci-evidence-from-job.ts +195 -0
- package/src/ci-evidence-jobs.ts +85 -10
- package/src/ci-handover.ts +16 -3
- package/src/ci-identity.test.ts +3 -3
- package/src/ci-identity.ts +51 -11
- package/src/ci-image.test.ts +60 -10
- package/src/ci-image.ts +78 -19
- package/src/ci-jobs.ts +7 -2
- package/src/ci-login.test.ts +131 -3
- package/src/ci-login.token-drop.test.ts +204 -0
- package/src/ci-login.ts +137 -39
- package/src/ci-product-words.ts +30 -0
- package/src/ci-product.ts +26 -1
- package/src/cli/commands/__fixtures__/source-dir-root/migrations/0001-init/backfill.ts +3 -0
- package/src/cli/handlers/approve-confirm.test.ts +35 -0
- package/src/cli/handlers/approve-confirm.ts +44 -0
- package/src/cli/handlers/build-source-dir.test.ts +4 -0
- package/src/cli/handlers/build.ts +20 -2
- package/src/cli/handlers/ci-check.ts +35 -13
- package/src/cli/handlers/ci-evidence-open.test.ts +164 -0
- package/src/cli/handlers/ci-evidence.ts +223 -24
- package/src/cli/handlers/ci-forge-check.ts +22 -9
- package/src/cli/handlers/generated-check.ts +39 -0
- package/src/cli/handlers/lifecycle.test.ts +20 -0
- package/src/cli/handlers/lifecycle.ts +4 -0
- package/src/cli/handlers/local-chant.ts +39 -1
- package/src/cli/handlers/pr.ts +43 -5
- package/src/cli/handlers/run-wave.ts +7 -0
- package/src/cli/main.ts +38 -4
- package/src/cli/parse-args.ts +46 -0
- package/src/cli/registry.ts +24 -0
- package/src/components/check-hooks.ts +25 -3
- package/src/components/check-report-summary.test.ts +78 -0
- package/src/components/check-steps.ts +1 -1
- package/src/components/pr-checks.ts +159 -0
- package/src/components/pr-pipeline.ts +41 -1
- package/src/components/product-pipeline.ts +25 -3
- package/src/components/product-plan.test.ts +102 -1
- package/src/components/product-plan.ts +419 -14
- package/src/config.ts +13 -8
- package/src/control/consumers.ts +7 -0
- package/src/dead-guards.test.ts +27 -5
- package/src/dead-guards.ts +9 -6
- package/src/discovery/files.ts +1 -1
- package/src/drift-issue.test.ts +29 -1
- package/src/drift-issue.ts +28 -3
- package/src/drift-record.test.ts +25 -0
- package/src/drift-record.ts +55 -6
- package/src/floor-table.data.ts +58 -20
- package/src/floor-table.ts +12 -9
- package/src/forge-check/contract.ts +11 -1
- package/src/forge-check/forge-check.test.ts +8 -0
- package/src/forge-check/index.ts +2 -0
- package/src/forge-flags.test.ts +25 -1
- package/src/forge-flags.ts +34 -0
- package/src/forge-remote.test.ts +37 -0
- package/src/forge-remote.ts +79 -0
- package/src/generated-check.e2e.test.ts +98 -0
- package/src/generated-check.test.ts +104 -0
- package/src/generated-check.ts +269 -0
- package/src/lexicon.ts +17 -0
- package/src/lifecycle/publish-npm.ts +56 -3
- package/src/lifecycle/release-catalog.test.ts +2 -2
- package/src/lifecycle/release-images-dockerfile.test.ts +20 -0
- package/src/lifecycle/release-images.test.ts +44 -0
- package/src/lifecycle/release-images.ts +39 -3
- package/src/lifecycle/release-ledger.ts +4 -3
- package/src/local-chant.e2e.test.ts +81 -6
- package/src/local-chant.test.ts +22 -3
- package/src/local-chant.ts +130 -13
- package/src/op/op-waves-evidence-jobs.ts +134 -0
- package/src/op/op-waves-evidence.test.ts +37 -4
- package/src/op/op-waves-evidence.ts +32 -11
- package/src/op/op-waves-run.ts +57 -2
- package/src/op/op-waves.ts +11 -0
- package/src/op/schedule-overdue.test.ts +83 -1
- package/src/op/schedule-overdue.ts +107 -9
- package/src/pr-forge-reads-compare.test.ts +2 -1
- package/src/pr-forge-reads.ts +37 -1
- package/src/pr-forge.ts +14 -3
- package/src/pr-plan-note.ts +32 -3
- package/src/pr-plan-record.test.ts +75 -0
- package/src/pr-plan-record.ts +101 -0
- package/src/pr-post-plan-note.test.ts +60 -0
- package/src/pr-post.test.ts +30 -0
- package/src/pr-post.ts +110 -6
- package/src/pr-requires.test.ts +20 -0
- package/src/pr-requires.ts +10 -1
- package/src/ref-gate-init.ts +189 -0
- package/src/ref-gate-rules.ts +26 -0
- package/src/release-floors.ts +88 -16
- package/src/state-migration-record.test.ts +90 -0
- package/src/state-migration.test.ts +1 -1
- package/src/state-migration.ts +52 -3
- package/src/state-unlock.test.ts +33 -1
- package/src/state-unlock.ts +49 -1
- package/src/workspace/ci-green-cli.ts +12 -6
- package/src/workspace/ci-green.ts +4 -3
- package/src/workspace/drift-cli.ts +6 -18
- package/src/workspace/forge-work.ts +7 -14
- package/src/workspace/lexicon-outputs.ts +2 -2
- package/src/workspace/release-workflow.test.ts +70 -0
- package/src/workspace/release-workflow.ts +56 -8
- package/src/workspace/trust/check-evidence-report.ts +33 -0
- package/src/workspace/trust/check-evidence.test.ts +3 -3
- package/src/workspace/trust/check-evidence.ts +110 -28
- package/src/workspace/trust/ci-tag-statement.ts +2 -2
- package/src/workspace/trust/dsse.ts +48 -4
- package/src/workspace/trust/evidence.ts +7 -2
- package/src/workspace/trust/keyless-fixture.ts +214 -0
- package/src/workspace/trust/keyless.test.ts +220 -0
- package/src/workspace/trust/keyless.ts +557 -0
- package/src/workspace/trust/local-evidence.ts +3 -1
- package/src/workspace/trust/op-run-statement.ts +2 -2
- package/src/workspace/trust/open-evidence.ts +129 -0
- package/src/workspace/trust/policy.ts +129 -2
- package/src/workspace/trust/ref-gate-cli.ts +59 -3
- package/src/workspace/trust/ref-gate-pieces.test.ts +175 -0
- package/src/workspace/trust/ref-gate.e2e.test.ts +17 -0
- package/src/workspace/trust/ref-gate.ts +90 -8
- package/src/workspace/trust/run-statement.ts +3 -3
- package/src/workspace/trust/runner-identity.ts +92 -0
- package/src/workspace/trust/trust-files.test.ts +6 -0
- package/src/workspace/trust/trust-files.ts +14 -1
package/dist/ci-login.d.ts
CHANGED
|
@@ -23,8 +23,11 @@
|
|
|
23
23
|
* `/tmp`), mode 0600. Then it sets:
|
|
24
24
|
*
|
|
25
25
|
* AWS AWS_ROLE_ARN, AWS_WEB_IDENTITY_TOKEN_FILE, AWS_ROLE_SESSION_NAME,
|
|
26
|
-
* AWS_REGION
|
|
27
|
-
*
|
|
26
|
+
* with `region` AWS_REGION and AWS_DEFAULT_REGION (else the job
|
|
27
|
+
* keeps its own, #4930), and AWS_ENDPOINT_URL_STS with
|
|
28
|
+
* `endpoint`. With no role the job gets the token file and the
|
|
29
|
+
* session name alone, for a tool that assumes its own roles,
|
|
30
|
+
* such as Terragrunt's `credentials` (#4930)
|
|
28
31
|
* GCP GOOGLE_APPLICATION_CREDENTIALS and
|
|
29
32
|
* CLOUDSDK_AUTH_CREDENTIAL_FILE_OVERRIDE, an `external_account`
|
|
30
33
|
* file per service account that trades the token at Google's STS
|
|
@@ -37,9 +40,11 @@
|
|
|
37
40
|
*
|
|
38
41
|
* gcloud reads CLOUDSDK_AUTH_CREDENTIAL_FILE_OVERRIDE, so it needs no
|
|
39
42
|
* `gcloud auth login`. On GitHub and Forgejo the variables go to
|
|
40
|
-
* `$GITHUB_ENV
|
|
41
|
-
* login prints, which name files and hold no token, then
|
|
42
|
-
* variables and the spec. No file of variables is left to
|
|
43
|
+
* `$GITHUB_ENV`, which later steps read; on GitLab the script evaluates the
|
|
44
|
+
* `export` lines the login prints, which name files and hold no token, then
|
|
45
|
+
* unsets the token variables and the spec. No file of variables is left to
|
|
46
|
+
* delete. With {@link CloudLoginOptions.sameStep} every forge takes the
|
|
47
|
+
* GitLab form, so the step that logs in can run the tool too (#4930).
|
|
43
48
|
*
|
|
44
49
|
* Per target and per stage: the spec is a {@link CloudTradeSpec} without
|
|
45
50
|
* Pulumi, the plan or apply side of what `resolveCloudIdentity` gives, so a
|
|
@@ -47,7 +52,9 @@
|
|
|
47
52
|
* other targets take (#4332). The step then writes the
|
|
48
53
|
* {@link CLOUD_TARGETS_ENV} file the trade writes, each identity's
|
|
49
54
|
* variables in it, and a product hands each target's tool its own with
|
|
50
|
-
* `targetCloudEnv`, as after the trade.
|
|
55
|
+
* `targetCloudEnv`, as after the trade. The login sets no
|
|
56
|
+
* `CLOUD_TRADED_ENV`, which the trade does, so a product tells the login's
|
|
57
|
+
* targets file from a trade's (#4930).
|
|
51
58
|
*
|
|
52
59
|
* The functions return {@link OpWaveRunStep}s and the job's `idTokens`, the
|
|
53
60
|
* shape `OpWavesPipelineOptions.waveJobs[].before` and `recordPlans` take
|
|
@@ -73,7 +80,7 @@ interface TokenFileOption {
|
|
|
73
80
|
/** One job's login, per cloud: a {@link CloudTradeSpec}'s AWS, GCP and Azure parts, with defaults, and the login's own options. */
|
|
74
81
|
export interface CloudLoginSpec {
|
|
75
82
|
aws?: Omit<NonNullable<CloudTradeSpec["aws"]>, "region" | "audience"> & TokenFileOption & {
|
|
76
|
-
/**
|
|
83
|
+
/** AWS_REGION and AWS_DEFAULT_REGION. Unset: the job keeps its own region (#4930). */
|
|
77
84
|
region?: string;
|
|
78
85
|
/** The token's audience. Default `sts.amazonaws.com`. */
|
|
79
86
|
audience?: string;
|
|
@@ -91,11 +98,66 @@ export interface CloudLoginSpec {
|
|
|
91
98
|
cli?: boolean;
|
|
92
99
|
};
|
|
93
100
|
}
|
|
101
|
+
/**
|
|
102
|
+
* The variable the login sets (#4912): the token files it wrote itself,
|
|
103
|
+
* joined by `:`. A runner's `tokenFile` is not among them.
|
|
104
|
+
* {@link LOGIN_CLEAR_TOKENS} empties them.
|
|
105
|
+
*/
|
|
106
|
+
export declare const LOGIN_TOKEN_FILES_ENV = "CHANT_CLOUD_TOKEN_FILES";
|
|
107
|
+
/**
|
|
108
|
+
* A shell line that empties each file {@link LOGIN_TOKEN_FILES_ENV} names
|
|
109
|
+
* (#4912), so a step that runs after the cloud's tool finds no token in
|
|
110
|
+
* them. It truncates and deletes nothing. The login's `restart` runs it
|
|
111
|
+
* when the step exits. A job whose login is a step of its own runs it in
|
|
112
|
+
* the step after the tool's last use.
|
|
113
|
+
*/
|
|
114
|
+
export declare const LOGIN_CLEAR_TOKENS = "(set -f; IFS=:; for f in ${CHANT_CLOUD_TOKEN_FILES:-}; do [ ! -f \"$f\" ] || : > \"$f\"; done)";
|
|
115
|
+
/** The marker of a step the login's `restart` started again (#4912): its login is done. */
|
|
116
|
+
export declare const LOGIN_RESTART_MARKER = "CHANT_CLOUD_LOGGED_IN";
|
|
117
|
+
/** What the login's `restart` takes (#4912). */
|
|
118
|
+
export interface CloudLoginRestart {
|
|
119
|
+
/** The shell the step restarts in, with `-e` (bash also `-o pipefail`). Default `bash`. */
|
|
120
|
+
shell?: "bash" | "sh";
|
|
121
|
+
/** More variables the restarted step starts without, such as the forge tokens (`FORGE_TOKEN_VARS`). */
|
|
122
|
+
also?: readonly string[];
|
|
123
|
+
}
|
|
124
|
+
/** How a login is rendered. */
|
|
125
|
+
export interface CloudLoginOptions {
|
|
126
|
+
/**
|
|
127
|
+
* The login's variables in the step that runs it (#4930). GitHub and
|
|
128
|
+
* Forgejo then evaluate the `export` lines the login prints, as GitLab
|
|
129
|
+
* does, and nothing goes to `$GITHUB_ENV`: a product that logs in and
|
|
130
|
+
* runs its tool in one step (terragucci's, after it fetched its tokens
|
|
131
|
+
* and restarted the step without the token request variables) puts
|
|
132
|
+
* `steps[0].run` in that step. The lines stop the step on a failed login
|
|
133
|
+
* with `|| exit 1`, for a script that runs with `-e` off. Default false.
|
|
134
|
+
*/
|
|
135
|
+
sameStep?: boolean;
|
|
136
|
+
/**
|
|
137
|
+
* Log in, then start the step's script again without the token request
|
|
138
|
+
* variables (#4912): the login's lines with `sameStep`, run once, then
|
|
139
|
+
* the restart (ci-handover's `restartWithout`) without
|
|
140
|
+
* `ACTIONS_ID_TOKEN_REQUEST_URL`, `ACTIONS_ID_TOKEN_REQUEST_TOKEN` and
|
|
141
|
+
* `also`, so the change's code and the tool cannot request another token,
|
|
142
|
+
* and on Forgejo cannot reach the run's runtime token through them. The
|
|
143
|
+
* restarted step keeps the login's variables and empties the login's
|
|
144
|
+
* token files when it exits ({@link LOGIN_CLEAR_TOKENS}, an `EXIT` trap;
|
|
145
|
+
* a step that sets its own `EXIT` trap runs that line in it). The lines
|
|
146
|
+
* go at the top of the step, since the restart runs the script again from
|
|
147
|
+
* its first line. A script that is no file (`bash -c`) is not restarted:
|
|
148
|
+
* the variables are unset and it runs on. On GitLab the login already
|
|
149
|
+
* unsets the `id_tokens` variables, and the script is no file, so
|
|
150
|
+
* `restart` adds the unset of `also` and the trap. Implies `sameStep`.
|
|
151
|
+
* terragucci's `stageTokens` and `restartWithout`.
|
|
152
|
+
*/
|
|
153
|
+
restart?: boolean | CloudLoginRestart;
|
|
154
|
+
}
|
|
94
155
|
/** A job's login: its steps, and the OIDC tokens the job requests. */
|
|
95
156
|
export interface CloudLoginSteps {
|
|
96
157
|
/**
|
|
97
158
|
* The steps, in order. GitHub and Forgejo: each one `run:` step, its lines
|
|
98
|
-
* joined by newlines. GitLab
|
|
159
|
+
* joined by newlines. GitLab, and any forge with `sameStep`: their lines
|
|
160
|
+
* in the job's script or step.
|
|
99
161
|
*/
|
|
100
162
|
steps: OpWaveRunStep[];
|
|
101
163
|
/**
|
|
@@ -125,7 +187,7 @@ export declare function loginLine(out: string, format: "github-env" | "sh", forg
|
|
|
125
187
|
* variables to `$GITHUB_ENV`, so every later step has them. The job needs
|
|
126
188
|
* `id-token: write`, which `idTokens` asks chant's generators for.
|
|
127
189
|
*/
|
|
128
|
-
export declare function githubCloudLogin(spec: CloudLoginSpec): CloudLoginSteps;
|
|
190
|
+
export declare function githubCloudLogin(spec: CloudLoginSpec, options?: CloudLoginOptions): CloudLoginSteps;
|
|
129
191
|
/**
|
|
130
192
|
* A Forgejo Actions job's cloud login (#4788), as on GitHub. Forgejo 15 with
|
|
131
193
|
* Forgejo Runner 12.5 serves the token to a job with
|
|
@@ -133,8 +195,8 @@ export declare function githubCloudLogin(spec: CloudLoginSpec): CloudLoginSteps;
|
|
|
133
195
|
* that asks for `id-token: write`. On an older Forgejo, give each cloud a
|
|
134
196
|
* `tokenFile` the runner provides; the job then requests none.
|
|
135
197
|
*/
|
|
136
|
-
export declare function forgejoCloudLogin(spec: CloudLoginSpec): CloudLoginSteps;
|
|
137
|
-
/** The
|
|
198
|
+
export declare function forgejoCloudLogin(spec: CloudLoginSpec, options?: CloudLoginOptions): CloudLoginSteps;
|
|
199
|
+
/** The variable the login's `export` lines are kept in until the script evaluates them: GitLab's, and with `sameStep` any forge's (#4930). */
|
|
138
200
|
export declare const GITLAB_LOGIN_VARS = "CHANT_CLOUD_LOGIN_VARS";
|
|
139
201
|
/**
|
|
140
202
|
* A GitLab CI job's cloud login (#4788): script lines that write each
|
|
@@ -143,8 +205,8 @@ export declare const GITLAB_LOGIN_VARS = "CHANT_CLOUD_LOGIN_VARS";
|
|
|
143
205
|
* only in its file. The job's `id_tokens:` are `idTokens`, each
|
|
144
206
|
* `{ aud: <audience> }`.
|
|
145
207
|
*/
|
|
146
|
-
export declare function gitlabCloudLogin(given: CloudLoginSpec): CloudLoginSteps;
|
|
208
|
+
export declare function gitlabCloudLogin(given: CloudLoginSpec, options?: CloudLoginOptions): CloudLoginSteps;
|
|
147
209
|
/** A job's cloud login on `forge` (#4788): {@link githubCloudLogin}, {@link gitlabCloudLogin} or {@link forgejoCloudLogin}. */
|
|
148
|
-
export declare function cloudLogin(forge: LoginForge, spec: CloudLoginSpec): CloudLoginSteps;
|
|
210
|
+
export declare function cloudLogin(forge: LoginForge, spec: CloudLoginSpec, options?: CloudLoginOptions): CloudLoginSteps;
|
|
149
211
|
export {};
|
|
150
212
|
//# sourceMappingURL=ci-login.d.ts.map
|
package/dist/ci-login.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ci-login.d.ts","sourceRoot":"","sources":["../src/ci-login.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"ci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AO,MAAM,iBAAiB,2BAA2B,CAAC;AAE1D;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,cAAc,EAAE,OAAO,GAAE,iBAAsB,GAAG,eAAe,CAUxG;AAED,+HAA+H;AAC/H,wBAAgB,UAAU,CAAC,KAAK,EAAE,UAAU,EAAE,IAAI,EAAE,cAAc,EAAE,OAAO,CAAC,EAAE,iBAAiB,GAAG,eAAe,CAEhH"}
|
package/dist/ci-login.js
CHANGED
|
@@ -23,8 +23,11 @@
|
|
|
23
23
|
* `/tmp`), mode 0600. Then it sets:
|
|
24
24
|
*
|
|
25
25
|
* AWS AWS_ROLE_ARN, AWS_WEB_IDENTITY_TOKEN_FILE, AWS_ROLE_SESSION_NAME,
|
|
26
|
-
* AWS_REGION
|
|
27
|
-
*
|
|
26
|
+
* with `region` AWS_REGION and AWS_DEFAULT_REGION (else the job
|
|
27
|
+
* keeps its own, #4930), and AWS_ENDPOINT_URL_STS with
|
|
28
|
+
* `endpoint`. With no role the job gets the token file and the
|
|
29
|
+
* session name alone, for a tool that assumes its own roles,
|
|
30
|
+
* such as Terragrunt's `credentials` (#4930)
|
|
28
31
|
* GCP GOOGLE_APPLICATION_CREDENTIALS and
|
|
29
32
|
* CLOUDSDK_AUTH_CREDENTIAL_FILE_OVERRIDE, an `external_account`
|
|
30
33
|
* file per service account that trades the token at Google's STS
|
|
@@ -37,9 +40,11 @@
|
|
|
37
40
|
*
|
|
38
41
|
* gcloud reads CLOUDSDK_AUTH_CREDENTIAL_FILE_OVERRIDE, so it needs no
|
|
39
42
|
* `gcloud auth login`. On GitHub and Forgejo the variables go to
|
|
40
|
-
* `$GITHUB_ENV
|
|
41
|
-
* login prints, which name files and hold no token, then
|
|
42
|
-
* variables and the spec. No file of variables is left to
|
|
43
|
+
* `$GITHUB_ENV`, which later steps read; on GitLab the script evaluates the
|
|
44
|
+
* `export` lines the login prints, which name files and hold no token, then
|
|
45
|
+
* unsets the token variables and the spec. No file of variables is left to
|
|
46
|
+
* delete. With {@link CloudLoginOptions.sameStep} every forge takes the
|
|
47
|
+
* GitLab form, so the step that logs in can run the tool too (#4930).
|
|
43
48
|
*
|
|
44
49
|
* Per target and per stage: the spec is a {@link CloudTradeSpec} without
|
|
45
50
|
* Pulumi, the plan or apply side of what `resolveCloudIdentity` gives, so a
|
|
@@ -47,7 +52,9 @@
|
|
|
47
52
|
* other targets take (#4332). The step then writes the
|
|
48
53
|
* {@link CLOUD_TARGETS_ENV} file the trade writes, each identity's
|
|
49
54
|
* variables in it, and a product hands each target's tool its own with
|
|
50
|
-
* `targetCloudEnv`, as after the trade.
|
|
55
|
+
* `targetCloudEnv`, as after the trade. The login sets no
|
|
56
|
+
* `CLOUD_TRADED_ENV`, which the trade does, so a product tells the login's
|
|
57
|
+
* targets file from a trade's (#4930).
|
|
51
58
|
*
|
|
52
59
|
* The functions return {@link OpWaveRunStep}s and the job's `idTokens`, the
|
|
53
60
|
* shape `OpWavesPipelineOptions.waveJobs[].before` and `recordPlans` take
|
|
@@ -55,8 +62,27 @@
|
|
|
55
62
|
* writing it into their files.
|
|
56
63
|
*/
|
|
57
64
|
import { CLOUD_TARGETS_ENV, IDENTITY_KEY, idTokenVar, } from "./ci-identity.js";
|
|
65
|
+
import { restartWithout } from "./ci-handover.js";
|
|
58
66
|
/** The variable the login step reads its {@link CloudLoginSpec} from, as JSON. */
|
|
59
67
|
export const LOGIN_SPEC_ENV = "CHANT_CLOUD_LOGIN";
|
|
68
|
+
/**
|
|
69
|
+
* The variable the login sets (#4912): the token files it wrote itself,
|
|
70
|
+
* joined by `:`. A runner's `tokenFile` is not among them.
|
|
71
|
+
* {@link LOGIN_CLEAR_TOKENS} empties them.
|
|
72
|
+
*/
|
|
73
|
+
export const LOGIN_TOKEN_FILES_ENV = "CHANT_CLOUD_TOKEN_FILES";
|
|
74
|
+
/**
|
|
75
|
+
* A shell line that empties each file {@link LOGIN_TOKEN_FILES_ENV} names
|
|
76
|
+
* (#4912), so a step that runs after the cloud's tool finds no token in
|
|
77
|
+
* them. It truncates and deletes nothing. The login's `restart` runs it
|
|
78
|
+
* when the step exits. A job whose login is a step of its own runs it in
|
|
79
|
+
* the step after the tool's last use.
|
|
80
|
+
*/
|
|
81
|
+
export const LOGIN_CLEAR_TOKENS = `(set -f; IFS=:; for f in \${${LOGIN_TOKEN_FILES_ENV}:-}; do [ ! -f "$f" ] || : > "$f"; done)`;
|
|
82
|
+
/** The marker of a step the login's `restart` started again (#4912): its login is done. */
|
|
83
|
+
export const LOGIN_RESTART_MARKER = "CHANT_CLOUD_LOGGED_IN";
|
|
84
|
+
/** The variables a GitHub or Forgejo step requests an OIDC token with. */
|
|
85
|
+
const ACTIONS_REQUEST_VARS = ["ACTIONS_ID_TOKEN_REQUEST_URL", "ACTIONS_ID_TOKEN_REQUEST_TOKEN"];
|
|
60
86
|
const LOGIN_CLOUDS = ["aws", "gcp", "azure"];
|
|
61
87
|
/** The provider's resource name without the `//iam.googleapis.com/` prefix, as ci-identity reads it. */
|
|
62
88
|
const providerPath = (p) => p.replace(/^(https:)?\/\/iam\.googleapis\.com\//, "");
|
|
@@ -72,8 +98,9 @@ export function cloudLoginSpec(spec) {
|
|
|
72
98
|
if (spec.azure?.database)
|
|
73
99
|
throw new Error("a cloud login gives Azure no database token: trade the token with ci-identity's trade step for azure.database");
|
|
74
100
|
const out = {};
|
|
101
|
+
// #4930: no default region, so the job's own stays. A named one stays where the spec put it, so the step renders as before.
|
|
75
102
|
if (spec.aws)
|
|
76
|
-
out.aws = { ...spec.aws,
|
|
103
|
+
out.aws = { ...spec.aws, audience: spec.aws.audience ?? "sts.amazonaws.com" };
|
|
77
104
|
if (spec.gcp) {
|
|
78
105
|
const provider = providerPath(spec.gcp.provider);
|
|
79
106
|
out.gcp = { ...spec.gcp, provider, audience: spec.gcp.audience ?? `https://iam.googleapis.com/${provider}` };
|
|
@@ -86,7 +113,8 @@ export function cloudLoginSpec(spec) {
|
|
|
86
113
|
continue;
|
|
87
114
|
const key = IDENTITY_KEY[cloud];
|
|
88
115
|
const ids = [c[key], ...(c.targets ?? []).map((t) => t[key])].filter((v) => v !== undefined);
|
|
89
|
-
|
|
116
|
+
// #4930: AWS with no role is the token file alone. GCP's credential file and Azure's variables name an identity.
|
|
117
|
+
if (ids.length === 0 && cloud !== "aws")
|
|
90
118
|
throw new Error(`the ${cloud} login names no identity: give it ${key}, or targets`);
|
|
91
119
|
for (const [k, v] of Object.entries(c)) {
|
|
92
120
|
if (typeof v === "string" && !SAFE.test(v))
|
|
@@ -123,6 +151,7 @@ export const LOGIN_JS = [
|
|
|
123
151
|
'const rand=()=>crypto.randomBytes(8).toString("hex");',
|
|
124
152
|
'const NO={github:"it needs permissions: id-token: write, and a pull request from a fork gets none",forgejo:"Forgejo serves one from version 15, with Forgejo Runner 12.5 or later, to a job with enable-openid-connect: true; on an older Forgejo give the cloud a tokenFile the runner provides"};',
|
|
125
153
|
// A cloud's token: the runner's file, else GitLab's id_tokens variable, else the forge's request URL, into a file of its own.
|
|
154
|
+
"const mine=[];",
|
|
126
155
|
"const tokenFile=async(cloud,s)=>{",
|
|
127
156
|
'if(s.tokenFile){const f=s.tokenFile.replace(/^\\$\\{?([A-Za-z_][A-Za-z0-9_]*)\\}?/,(m,v)=>process.env[v]||"");let t;try{t=fs.readFileSync(f,"utf8").trim()}catch{throw new Error(cloud+"\\u0027s tokenFile "+f+" cannot be read")}if(!t)throw new Error(cloud+"\\u0027s tokenFile "+f+" is empty");return f}',
|
|
128
157
|
'const name="CHANT_ID_TOKEN_"+cloud.toUpperCase();let v=process.env[name];',
|
|
@@ -133,18 +162,22 @@ export const LOGIN_JS = [
|
|
|
133
162
|
'if(!r.ok)throw new Error("the OIDC token request answered "+r.status);',
|
|
134
163
|
'try{v=JSON.parse(await r.text()).value}catch{throw new Error("the OIDC token request answered with no JSON")}}',
|
|
135
164
|
'if(!clean(v))throw new Error("the job\\u0027s OIDC token for "+cloud+" is not a token");',
|
|
136
|
-
'const f=tmp+"/chant-oidc-"+cloud+"-"+rand();fs.writeFileSync(f,v,{mode:0o600,flag:"wx"});return f};',
|
|
165
|
+
'const f=tmp+"/chant-oidc-"+cloud+"-"+rand();fs.writeFileSync(f,v,{mode:0o600,flag:"wx"});mine.push(f);return f};',
|
|
137
166
|
`const KEY=${JSON.stringify(IDENTITY_KEY)};`,
|
|
138
167
|
'const ids=(c)=>{const s=spec[c],l=[];if(s[KEY[c]])l.push(s[KEY[c]]);for(const t of s.targets||[])if(!l.includes(t[KEY[c]]))l.push(t[KEY[c]]);return l};',
|
|
139
168
|
"const vars={},said=[],by={};",
|
|
140
169
|
"const run=async()=>{",
|
|
141
170
|
'if(spec.aws){const a=spec.aws;const f=await tokenFile("aws",a);by.aws={};',
|
|
142
|
-
|
|
143
|
-
"
|
|
171
|
+
// #4930: the region only when the spec names one; with no role of the job's own, the token file and session name alone.
|
|
172
|
+
'const base={AWS_WEB_IDENTITY_TOKEN_FILE:f,AWS_ROLE_SESSION_NAME:a.sessionName||"chant",...(a.region?{AWS_REGION:a.region,AWS_DEFAULT_REGION:a.region}:{}),...(a.endpoint?{AWS_ENDPOINT_URL_STS:trim(a.endpoint)}:{})};',
|
|
173
|
+
'for(const role of ids("aws")){by.aws[role]={AWS_ROLE_ARN:role,...base};said.push(role)}',
|
|
174
|
+
'if(a.role)Object.assign(vars,by.aws[a.role]);else{Object.assign(vars,base);console.error("chant: wrote the aws OIDC token file, with no role of the job\\u0027s own")}}',
|
|
144
175
|
'if(spec.gcp){const c=spec.gcp;const f=await tokenFile("gcp",c);by.gcp={};',
|
|
145
176
|
'const sts=trim(c.stsEndpoint||"https://sts.googleapis.com"),iam=trim(c.iamEndpoint||"https://iamcredentials.googleapis.com");',
|
|
177
|
+
// #4912: stsEndpoint is Google's STS, or its full token URL (terragucci's `token_url`).
|
|
178
|
+
'const tu=/\\/token$/.test(sts)?sts:sts+"/v1/token";',
|
|
146
179
|
'for(const sa of ids("gcp")){const cf=tmp+"/chant-gcp-"+rand()+".json";',
|
|
147
|
-
'fs.writeFileSync(cf,JSON.stringify({type:"external_account",audience:"//iam.googleapis.com/"+c.provider,subject_token_type:"urn:ietf:params:oauth:token-type:jwt",token_url:
|
|
180
|
+
'fs.writeFileSync(cf,JSON.stringify({type:"external_account",audience:"//iam.googleapis.com/"+c.provider,subject_token_type:"urn:ietf:params:oauth:token-type:jwt",token_url:tu,service_account_impersonation_url:iam+"/v1/projects/-/serviceAccounts/"+sa+":generateAccessToken",credential_source:{file:f}})+"\\n",{mode:0o600,flag:"wx"});',
|
|
148
181
|
"by.gcp[sa]={GOOGLE_APPLICATION_CREDENTIALS:cf,CLOUDSDK_AUTH_CREDENTIAL_FILE_OVERRIDE:cf};said.push(sa)}",
|
|
149
182
|
"if(c.serviceAccount)Object.assign(vars,by.gcp[c.serviceAccount])}",
|
|
150
183
|
'if(spec.azure){const z=spec.azure;const f=await tokenFile("azure",z);by.azure={};',
|
|
@@ -158,6 +191,8 @@ export const LOGIN_JS = [
|
|
|
158
191
|
'const clouds=Object.keys(by);if(clouds.some((c)=>(spec[c].targets||[]).length>0)){',
|
|
159
192
|
'const doc={version:1,clouds:{}};for(const c of clouds){const s=spec[c];doc.clouds[c]={...(s[KEY[c]]?{default:s[KEY[c]]}:{}),targets:(s.targets||[]).map((t)=>({targets:t.targets,identity:t[KEY[c]]})),vars:by[c]}}',
|
|
160
193
|
`const tf=tmp+"/chant-cloud-targets-"+rand()+".json";fs.writeFileSync(tf,JSON.stringify(doc),{mode:0o600,flag:"wx"});vars.${CLOUD_TARGETS_ENV}=tf}`,
|
|
194
|
+
// #4912: the token files the login wrote, which LOGIN_CLEAR_TOKENS empties; a runner's own stays out.
|
|
195
|
+
`if(mine.length)vars.${LOGIN_TOKEN_FILES_ENV}=mine.join(":");`,
|
|
161
196
|
'for(const [k,v] of Object.entries(vars))if(!clean(v))throw new Error(k+" is not a value the job can hold");',
|
|
162
197
|
'if(format==="github-env")fs.appendFileSync(out,Object.entries(vars).map(([k,v])=>k+"="+v+"\\n").join(""));',
|
|
163
198
|
'else process.stdout.write(Object.entries(vars).map(([k,v])=>"export "+k+"="+Q+v.split(Q).join(Q+"\\\\"+Q+Q)+Q+"\\n").join(""));',
|
|
@@ -175,11 +210,36 @@ const stepName = (spec) => `Cloud login (chant ci-login: ${LOGIN_CLOUDS.filter((
|
|
|
175
210
|
export function loginLine(out, format, forge) {
|
|
176
211
|
return `(cd / && node -e '${LOGIN_JS}' "${out}" ${format} ${forge})`;
|
|
177
212
|
}
|
|
178
|
-
/**
|
|
179
|
-
|
|
213
|
+
/**
|
|
214
|
+
* The lines that log in and evaluate the variables in the shell that runs
|
|
215
|
+
* them, then unset what held them and `unset`: GitLab's script, and with
|
|
216
|
+
* `sameStep` (#4930) any forge's step. `exit` stops a script with `-e` off.
|
|
217
|
+
*/
|
|
218
|
+
function shellLines(spec, forge, unset, exit) {
|
|
219
|
+
return [
|
|
220
|
+
`export ${LOGIN_SPEC_ENV}=${sh(JSON.stringify(spec))}`,
|
|
221
|
+
// An assignment's status is its command substitution's, so a failed login stops the script.
|
|
222
|
+
`${GITLAB_LOGIN_VARS}="$${loginLine("-", "sh", forge)}"${exit ? " || exit 1" : ""}`,
|
|
223
|
+
`eval "$${GITLAB_LOGIN_VARS}"`,
|
|
224
|
+
`unset ${[GITLAB_LOGIN_VARS, LOGIN_SPEC_ENV, ...unset].join(" ")}`,
|
|
225
|
+
];
|
|
226
|
+
}
|
|
227
|
+
/** The `restart` option, filled: undefined without it. */
|
|
228
|
+
const restartOf = (options) => (options.restart ? (options.restart === true ? {} : options.restart) : undefined);
|
|
229
|
+
/** The trap a restarted login sets: the login's token files emptied when the step exits (#4912). */
|
|
230
|
+
const clearOnExit = `trap ${sh(LOGIN_CLEAR_TOKENS)} EXIT`;
|
|
231
|
+
/** A GitHub Actions or Forgejo Actions login: one step that appends the variables to `$GITHUB_ENV`, or with `sameStep` exports them in its own shell. */
|
|
232
|
+
function actionsLogin(forge, given, options = {}) {
|
|
180
233
|
const spec = cloudLoginSpec(given);
|
|
181
234
|
if (Object.keys(spec).length === 0)
|
|
182
235
|
return { steps: [], idTokens: {} };
|
|
236
|
+
const restart = restartOf(options);
|
|
237
|
+
if (restart) {
|
|
238
|
+
const lines = [`if [ -z "\${${LOGIN_RESTART_MARKER}:-}" ]; then`, ...shellLines(spec, forge, [], true), "fi", restartWithout(restart.shell ?? "bash", [...ACTIONS_REQUEST_VARS, ...(restart.also ?? [])], LOGIN_RESTART_MARKER), clearOnExit];
|
|
239
|
+
return { steps: [{ name: stepName(spec), run: lines }], idTokens: loginIdTokens(spec) };
|
|
240
|
+
}
|
|
241
|
+
if (options.sameStep)
|
|
242
|
+
return { steps: [{ name: stepName(spec), run: shellLines(spec, forge, [], true) }], idTokens: loginIdTokens(spec) };
|
|
183
243
|
return {
|
|
184
244
|
steps: [{ name: stepName(spec), run: [`export ${LOGIN_SPEC_ENV}=${sh(JSON.stringify(spec))}`, loginLine("$GITHUB_ENV", "github-env", forge)] }],
|
|
185
245
|
idTokens: loginIdTokens(spec),
|
|
@@ -191,8 +251,8 @@ function actionsLogin(forge, given) {
|
|
|
191
251
|
* variables to `$GITHUB_ENV`, so every later step has them. The job needs
|
|
192
252
|
* `id-token: write`, which `idTokens` asks chant's generators for.
|
|
193
253
|
*/
|
|
194
|
-
export function githubCloudLogin(spec) {
|
|
195
|
-
return actionsLogin("github", spec);
|
|
254
|
+
export function githubCloudLogin(spec, options) {
|
|
255
|
+
return actionsLogin("github", spec, options);
|
|
196
256
|
}
|
|
197
257
|
/**
|
|
198
258
|
* A Forgejo Actions job's cloud login (#4788), as on GitHub. Forgejo 15 with
|
|
@@ -201,10 +261,10 @@ export function githubCloudLogin(spec) {
|
|
|
201
261
|
* that asks for `id-token: write`. On an older Forgejo, give each cloud a
|
|
202
262
|
* `tokenFile` the runner provides; the job then requests none.
|
|
203
263
|
*/
|
|
204
|
-
export function forgejoCloudLogin(spec) {
|
|
205
|
-
return actionsLogin("forgejo", spec);
|
|
264
|
+
export function forgejoCloudLogin(spec, options) {
|
|
265
|
+
return actionsLogin("forgejo", spec, options);
|
|
206
266
|
}
|
|
207
|
-
/** The
|
|
267
|
+
/** The variable the login's `export` lines are kept in until the script evaluates them: GitLab's, and with `sameStep` any forge's (#4930). */
|
|
208
268
|
export const GITLAB_LOGIN_VARS = "CHANT_CLOUD_LOGIN_VARS";
|
|
209
269
|
/**
|
|
210
270
|
* A GitLab CI job's cloud login (#4788): script lines that write each
|
|
@@ -213,28 +273,20 @@ export const GITLAB_LOGIN_VARS = "CHANT_CLOUD_LOGIN_VARS";
|
|
|
213
273
|
* only in its file. The job's `id_tokens:` are `idTokens`, each
|
|
214
274
|
* `{ aud: <audience> }`.
|
|
215
275
|
*/
|
|
216
|
-
export function gitlabCloudLogin(given) {
|
|
276
|
+
export function gitlabCloudLogin(given, options = {}) {
|
|
217
277
|
const spec = cloudLoginSpec(given);
|
|
218
278
|
if (Object.keys(spec).length === 0)
|
|
219
279
|
return { steps: [], idTokens: {} };
|
|
220
280
|
const idTokens = loginIdTokens(spec);
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
`${GITLAB_LOGIN_VARS}="$${loginLine("-", "sh", "gitlab")}"`,
|
|
229
|
-
`eval "$${GITLAB_LOGIN_VARS}"`,
|
|
230
|
-
`unset ${[GITLAB_LOGIN_VARS, LOGIN_SPEC_ENV, ...Object.keys(idTokens)].join(" ")}`,
|
|
231
|
-
],
|
|
232
|
-
},
|
|
233
|
-
],
|
|
234
|
-
idTokens,
|
|
235
|
-
};
|
|
281
|
+
const restart = restartOf(options);
|
|
282
|
+
// A GitLab script is one shell already; sameStep adds `|| exit 1`, for a script with -e off.
|
|
283
|
+
const lines = shellLines(spec, "gitlab", Object.keys(idTokens), options.sameStep === true || restart !== undefined);
|
|
284
|
+
// #4912: GitLab's script is no file to restart; the id_tokens variables are unset above, `also` here.
|
|
285
|
+
if (restart)
|
|
286
|
+
lines.push(...(restart.also?.length ? [`unset ${restart.also.join(" ")}`] : []), clearOnExit);
|
|
287
|
+
return { steps: [{ name: stepName(spec), run: lines }], idTokens };
|
|
236
288
|
}
|
|
237
289
|
/** A job's cloud login on `forge` (#4788): {@link githubCloudLogin}, {@link gitlabCloudLogin} or {@link forgejoCloudLogin}. */
|
|
238
|
-
export function cloudLogin(forge, spec) {
|
|
239
|
-
return forge === "gitlab" ? gitlabCloudLogin(spec) : actionsLogin(forge, spec);
|
|
290
|
+
export function cloudLogin(forge, spec, options) {
|
|
291
|
+
return forge === "gitlab" ? gitlabCloudLogin(spec, options) : actionsLogin(forge, spec, options);
|
|
240
292
|
}
|
|
@@ -312,6 +312,19 @@ export type ParsedProductComment =
|
|
|
312
312
|
export declare const COMMIT_COMMENT_ARG: RegExp;
|
|
313
313
|
/** The longest ask an agent comment may carry. */
|
|
314
314
|
export declare const PRODUCT_COMMENT_ASK_MAX = 2000;
|
|
315
|
+
/** {@link parseProductComment}'s options. */
|
|
316
|
+
export interface ProductCommentOptions {
|
|
317
|
+
/** Leave every comment for a commit word to the commit job (#4890): it is undefined here, a refused one included. */
|
|
318
|
+
leaveCommit?: boolean;
|
|
319
|
+
}
|
|
320
|
+
/**
|
|
321
|
+
* The commit word a comment names (#4890): its first two words, split on
|
|
322
|
+
* any space, are `/<product> <word>` and the words map `<word>` onto
|
|
323
|
+
* `commit`. The commit job replies to a refused comment by this rule
|
|
324
|
+
* (#4838), so a comment job that skips these never answers a comment the
|
|
325
|
+
* commit job answers. Undefined for any other comment.
|
|
326
|
+
*/
|
|
327
|
+
export declare function commitWordOf(words: CiProductWords, body: unknown): string | undefined;
|
|
315
328
|
/**
|
|
316
329
|
* Read a comment against the product's grammar (moved from terragucci's
|
|
317
330
|
* comment.ts). Undefined when it is not addressed to the product. A comment
|
|
@@ -324,8 +337,14 @@ export declare const PRODUCT_COMMENT_ASK_MAX = 2000;
|
|
|
324
337
|
* names the commit words that take one argument after them (#4820), each
|
|
325
338
|
* with the pattern it must match; it must also match
|
|
326
339
|
* {@link COMMIT_COMMENT_ARG}. Any other commit word takes nothing.
|
|
340
|
+
*
|
|
341
|
+
* `leaveCommit` (#4890) is for a comment job that is not the commit job: a
|
|
342
|
+
* comment for a commit word is undefined, a malformed one included
|
|
343
|
+
* ({@link commitWordOf}), because the commit job answers it, refusals and
|
|
344
|
+
* all (#4838). Without it, a malformed `/<product> <commit word> x` would
|
|
345
|
+
* get a reply from both jobs.
|
|
327
346
|
*/
|
|
328
|
-
export declare function parseProductComment(words: CiProductWords, body: unknown, env?: Record<string, string | undefined>, commitArgs?: Readonly<Record<string, RegExp
|
|
347
|
+
export declare function parseProductComment(words: CiProductWords, body: unknown, env?: Record<string, string | undefined>, commitArgs?: Readonly<Record<string, RegExp>>, options?: ProductCommentOptions): ParsedProductComment | undefined;
|
|
329
348
|
/**
|
|
330
349
|
* The variables the generated action job (#4654) hands the product's action
|
|
331
350
|
* verb: the comment that started it, on a comment, and the dispatch's two
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ci-product-words.d.ts","sourceRoot":"","sources":["../src/ci-product-words.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAEnD,iGAAiG;AACjG,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,OAAO,GAAG,QAAQ,GAAG,OAAO,GAAG,OAAO,GAAG,MAAM,GAAG,UAAU,GAAG,SAAS,CAAC;AAE/G,8EAA8E;AAC9E,eAAO,MAAM,iBAAiB,EAAE,SAAS,cAAc,EAAiF,CAAC;AAEzI;;;;GAIG;AACH,MAAM,MAAM,gBAAgB,GAAG,MAAM,GAAG,OAAO,GAAG,MAAM,GAAG,QAAQ,GAAG,OAAO,GAAG,QAAQ,GAAG,QAAQ,CAAC;AAEpG,eAAO,MAAM,mBAAmB,EAAE,SAAS,gBAAgB,EAAqE,CAAC;AAEjI;;;;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Ac,EAAE,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,GAAG,oBAAoB,CAiBzH"}
|
package/dist/ci-product-words.js
CHANGED
|
@@ -297,6 +297,21 @@ export const COMMIT_COMMENT_ARG = /^[A-Za-z0-9][A-Za-z0-9_.-]{0,99}$/;
|
|
|
297
297
|
export const PRODUCT_COMMENT_ASK_MAX = 2000;
|
|
298
298
|
/** Commands a comment never runs, named in the reply so nobody waits on them. */
|
|
299
299
|
const NEVER = new Set(["approve", "override", "force-unlock", "unlock-state", "import", "state", "destroy", "merge"]);
|
|
300
|
+
/**
|
|
301
|
+
* The commit word a comment names (#4890): its first two words, split on
|
|
302
|
+
* any space, are `/<product> <word>` and the words map `<word>` onto
|
|
303
|
+
* `commit`. The commit job replies to a refused comment by this rule
|
|
304
|
+
* (#4838), so a comment job that skips these never answers a comment the
|
|
305
|
+
* commit job answers. Undefined for any other comment.
|
|
306
|
+
*/
|
|
307
|
+
export function commitWordOf(words, body) {
|
|
308
|
+
if (typeof body !== "string")
|
|
309
|
+
return undefined;
|
|
310
|
+
const said = body.trim().split(/[ \t\r\n]+/);
|
|
311
|
+
if (said[0] !== `/${words.product}` || said[1] === undefined)
|
|
312
|
+
return undefined;
|
|
313
|
+
return words.commands[said[1]] === "commit" ? said[1] : undefined;
|
|
314
|
+
}
|
|
300
315
|
/**
|
|
301
316
|
* Read a comment against the product's grammar (moved from terragucci's
|
|
302
317
|
* comment.ts). Undefined when it is not addressed to the product. A comment
|
|
@@ -309,10 +324,18 @@ const NEVER = new Set(["approve", "override", "force-unlock", "unlock-state", "i
|
|
|
309
324
|
* names the commit words that take one argument after them (#4820), each
|
|
310
325
|
* with the pattern it must match; it must also match
|
|
311
326
|
* {@link COMMIT_COMMENT_ARG}. Any other commit word takes nothing.
|
|
327
|
+
*
|
|
328
|
+
* `leaveCommit` (#4890) is for a comment job that is not the commit job: a
|
|
329
|
+
* comment for a commit word is undefined, a malformed one included
|
|
330
|
+
* ({@link commitWordOf}), because the commit job answers it, refusals and
|
|
331
|
+
* all (#4838). Without it, a malformed `/<product> <commit word> x` would
|
|
332
|
+
* get a reply from both jobs.
|
|
312
333
|
*/
|
|
313
|
-
export function parseProductComment(words, body, env = {}, commitArgs = {}) {
|
|
334
|
+
export function parseProductComment(words, body, env = {}, commitArgs = {}, options = {}) {
|
|
314
335
|
if (typeof body !== "string")
|
|
315
336
|
return undefined;
|
|
337
|
+
if (options.leaveCommit && commitWordOf(words, body) !== undefined)
|
|
338
|
+
return undefined;
|
|
316
339
|
let text = body.trim();
|
|
317
340
|
const prefix = `/${words.product}`;
|
|
318
341
|
for (const a of words.aliases) {
|
|
@@ -367,6 +390,9 @@ export function parseProductComment(words, body, env = {}, commitArgs = {}) {
|
|
|
367
390
|
case "unlock":
|
|
368
391
|
return parts.length === 2 ? { kind: command } : { kind: "refused", reason: `${line} takes nothing after it` };
|
|
369
392
|
case "commit": {
|
|
393
|
+
// An alias for a commit word, which commitWordOf does not read, is the commit job's too.
|
|
394
|
+
if (options.leaveCommit)
|
|
395
|
+
return undefined;
|
|
370
396
|
if (parts.length === 2)
|
|
371
397
|
return { kind: "commit", word: typed };
|
|
372
398
|
const pattern = Object.prototype.hasOwnProperty.call(commitArgs, typed) ? commitArgs[typed] : undefined;
|
package/dist/ci-product.d.ts
CHANGED
|
@@ -18,7 +18,7 @@ import type { ProductWaveHook } from "./op/op-waves-after-plan.js";
|
|
|
18
18
|
* note (#4573).
|
|
19
19
|
*/
|
|
20
20
|
export declare const CI_PRODUCT_FLOOR = "0.124.55";
|
|
21
|
-
export { activeProductWords, approveLine, assertProductWords, CHANT_APPROVE_TEMPLATE, CHANT_NOTIFY_WAVE_TEMPLATE, CHANT_OVERRIDE_TEMPLATE, CHANT_WORDS, CI_PRODUCT_APPLY_MODES, CI_PRODUCT_COMMANDS, CI_PRODUCT_STAGES, CiProductWordsError, commandWord, commentLine, isChantWords, notifyWaveLabel, overrideLine, parseProductComment, productActionFromEnv, PRODUCT_ACTION_ENV, PRODUCT_ACTION_EVENT_FLAG, productContext, productStatusContext, productWaveGate, productWordsProblems, resolveProductWords, setActiveProductWords, withProductWords, type ApproveLineInput, type CiProductAlias, type CiProductApplyMode, type CiProductApproval, type CiProductCommand, type CiProductNotifyWords, type CiProductNotifyWordsInput, type CiProductStage, type CiProductWords, type CiProductWordsInput, type OverrideLineInput, type ParsedProductComment, type ProductActionRequest, } from "./ci-product-words.js";
|
|
21
|
+
export { activeProductWords, approveLine, assertProductWords, CHANT_APPROVE_TEMPLATE, CHANT_NOTIFY_WAVE_TEMPLATE, CHANT_OVERRIDE_TEMPLATE, CHANT_WORDS, CI_PRODUCT_APPLY_MODES, CI_PRODUCT_COMMANDS, CI_PRODUCT_STAGES, CiProductWordsError, commandWord, commentLine, commitWordOf, isChantWords, notifyWaveLabel, overrideLine, parseProductComment, productActionFromEnv, PRODUCT_ACTION_ENV, PRODUCT_ACTION_EVENT_FLAG, productContext, productStatusContext, productWaveGate, productWordsProblems, resolveProductWords, setActiveProductWords, withProductWords, type ApproveLineInput, type CiProductAlias, type CiProductApplyMode, type CiProductApproval, type CiProductCommand, type CiProductNotifyWords, type CiProductNotifyWordsInput, type CiProductStage, type CiProductWords, type CiProductWordsInput, type OverrideLineInput, type ParsedProductComment, type ProductCommentOptions, type ProductActionRequest, } from "./ci-product-words.js";
|
|
22
22
|
export { driftNotifyFields, NOTIFY_MESSAGE_WORDS_FLOOR, productNotifySource, productNotifyWords, productSendOptions, type DriftNotifyInput } from "./notify-product.js";
|
|
23
23
|
/** The first chant with `chant notify relay` and the notify relay buttons (#4611). */
|
|
24
24
|
export declare const NOTIFY_RELAY_FLOOR = "0.124.55";
|
|
@@ -48,6 +48,25 @@ export { prActionJob, PR_ACTION_JOB, prApplyComment, prCommentLockJobs, prCommen
|
|
|
48
48
|
export declare const PRODUCT_PLAN_FLOOR = "0.124.86";
|
|
49
49
|
export { productPlanJobs, PR_PLAN_NOTE_WORDS_ENV, type ProductPlanJob, type ProductPlanOptions, type ProductPlanTarget } from "./components/product-plan.js";
|
|
50
50
|
export { planNoteHandoff, PR_PLAN_NOTE_FILE, type PrPlanNoteHandoff } from "./pr-plan-note.js";
|
|
51
|
+
/**
|
|
52
|
+
* The first chant whose product plan carries the plan-job steps beside the plan verb and the note job's own lines (#4899, #4931): `productPlan.login` and a target's `login` (ci-login) with the job's OIDC token, `idTokens`, `pending`, `controlRead`, `setup` steps, job-level `env`, `report`, `concurrency`, the comment re-plan `replan`, and `noteSteps`; a hand-off's `marker` kept under the note words' `productMarker`; and the note job's notices and overdue Ops under a hand-off's counts.
|
|
53
|
+
*/
|
|
54
|
+
export declare const PRODUCT_PLAN_STEPS_FLOOR = "0.124.88";
|
|
55
|
+
export { PLAN_ARGUMENT_ENV, PLAN_NOTE_NOTICES_ENV, type ProductPlanReplanJob, type ProductPlanSetupStep } from "./components/product-plan.js";
|
|
56
|
+
/**
|
|
57
|
+
* The first chant whose `parseProductComment` takes `leaveCommit` and that has `commitWordOf` (#4890): a comment job that is not the commit job leaves every comment for a commit word to it, a malformed one included, so the comment gets one reply.
|
|
58
|
+
*/
|
|
59
|
+
export declare const COMMENT_LEAVES_COMMIT_FLOOR = "0.124.88";
|
|
60
|
+
/**
|
|
61
|
+
* The first chant whose product plan takes `watches`, the product's own scheduled jobs the note job's `pr-post` checks for having stopped with the job's token (#4888), and whose `checkOverdueOps` and `overdueOpsAt` take a product's `logPrefix` and `label`.
|
|
62
|
+
*/
|
|
63
|
+
export declare const PRODUCT_PLAN_WATCHES_FLOOR = "0.124.88";
|
|
64
|
+
export { PLAN_WATCHES_ENV } from "./op/schedule-overdue.js";
|
|
65
|
+
/**
|
|
66
|
+
* The first chant whose product plan takes `record` (#4899): the plan step writes the plan job's run record into the hand-off, and the note job keeps it as Op `pr-plan` on `chant/lifecycle` with `pr-post --record-run <plan job>` (`--open` on GitLab), as `chant ci run plan --in-place` records `pr-plan`'s.
|
|
67
|
+
*/
|
|
68
|
+
export declare const PRODUCT_PLAN_RECORD_FLOOR = "0.124.88";
|
|
69
|
+
export { PLAN_RUN_OP, PLAN_RUN_RECORD_FILE, readPlanRunRecord } from "./pr-plan-record.js";
|
|
51
70
|
/**
|
|
52
71
|
* Day-2 actions in the product pipeline (#4654): the `action` comment
|
|
53
72
|
* command counted as answered by the product's own workflow
|
package/dist/ci-product.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ci-product.d.ts","sourceRoot":"","sources":["../src/ci-product.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAC9E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAIhE;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB,aAAa,CAAC;AAE3C,OAAO,EACL,kBAAkB,EAClB,WAAW,EACX,kBAAkB,EAClB,sBAAsB,EACtB,0BAA0B,EAC1B,uBAAuB,EACvB,WAAW,EACX,sBAAsB,EACtB,mBAAmB,EACnB,iBAAiB,EACjB,mBAAmB,EACnB,WAAW,EACX,WAAW,EACX,YAAY,EACZ,eAAe,EACf,YAAY,EACZ,mBAAmB,EACnB,oBAAoB,EACpB,kBAAkB,EAClB,yBAAyB,EACzB,cAAc,EACd,oBAAoB,EACpB,eAAe,EACf,oBAAoB,EACpB,mBAAmB,EACnB,qBAAqB,EACrB,gBAAgB,EAChB,KAAK,gBAAgB,EACrB,KAAK,cAAc,EACnB,KAAK,kBAAkB,EACvB,KAAK,iBAAiB,EACtB,KAAK,gBAAgB,EACrB,KAAK,oBAAoB,EACzB,KAAK,yBAAyB,EAC9B,KAAK,cAAc,EACnB,KAAK,cAAc,EACnB,KAAK,mBAAmB,EACxB,KAAK,iBAAiB,EACtB,KAAK,oBAAoB,EACzB,KAAK,oBAAoB,GAC1B,M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