@intentius/chant 0.124.55 → 0.124.56
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ci-agent.d.ts.map +1 -1
- package/dist/ci-agent.js +1 -2
- package/dist/ci-audit/attribution.d.ts +111 -0
- package/dist/ci-audit/attribution.d.ts.map +1 -0
- package/dist/ci-audit/attribution.js +194 -0
- package/dist/ci-audit/audit-log.d.ts +144 -0
- package/dist/ci-audit/audit-log.d.ts.map +1 -0
- package/dist/ci-audit/audit-log.js +149 -0
- package/dist/ci-audit/index.d.ts +12 -0
- package/dist/ci-audit/index.d.ts.map +1 -0
- package/dist/ci-audit/index.js +12 -0
- package/dist/ci-audit/unrecorded.d.ts +74 -0
- package/dist/ci-audit/unrecorded.d.ts.map +1 -0
- package/dist/ci-audit/unrecorded.js +95 -0
- package/dist/ci-audit.d.ts +3 -0
- package/dist/ci-audit.d.ts.map +1 -0
- package/dist/ci-audit.js +2 -0
- package/dist/ci-control.d.ts.map +1 -1
- package/dist/ci-control.js +3 -4
- package/dist/ci-estate.d.ts +24 -0
- package/dist/ci-estate.d.ts.map +1 -1
- package/dist/ci-estate.js +1 -2
- package/dist/ci-identity.d.ts.map +1 -1
- package/dist/ci-identity.js +2 -3
- package/dist/ci-job-guard.d.ts +139 -0
- package/dist/ci-job-guard.d.ts.map +1 -0
- package/dist/ci-job-guard.js +287 -0
- package/dist/ci-jobs.d.ts +7 -0
- package/dist/ci-jobs.d.ts.map +1 -1
- package/dist/ci-jobs.js +7 -0
- package/dist/ci-product-words.d.ts +7 -1
- package/dist/ci-product-words.d.ts.map +1 -1
- package/dist/ci-product-words.js +38 -4
- package/dist/ci-product.d.ts +35 -0
- package/dist/ci-product.d.ts.map +1 -1
- package/dist/ci-product.js +38 -3
- package/dist/ci-respond-run.d.ts +73 -0
- package/dist/ci-respond-run.d.ts.map +1 -0
- package/dist/ci-respond-run.js +247 -0
- package/dist/ci-respond.d.ts +189 -0
- package/dist/ci-respond.d.ts.map +1 -0
- package/dist/ci-respond.js +285 -0
- package/dist/cli/handlers/audit-log.d.ts +12 -0
- package/dist/cli/handlers/audit-log.d.ts.map +1 -0
- package/dist/cli/handlers/audit-log.js +81 -0
- package/dist/cli/handlers/build.d.ts +7 -0
- package/dist/cli/handlers/build.d.ts.map +1 -1
- package/dist/cli/handlers/build.js +81 -0
- package/dist/cli/handlers/ci-check-job.d.ts +11 -0
- package/dist/cli/handlers/ci-check-job.d.ts.map +1 -0
- package/dist/cli/handlers/ci-check-job.js +27 -0
- package/dist/cli/handlers/ci-check.d.ts.map +1 -1
- package/dist/cli/handlers/ci-check.js +38 -9
- package/dist/cli/handlers/e2e-safe-run.d.ts +12 -0
- package/dist/cli/handlers/e2e-safe-run.d.ts.map +1 -0
- package/dist/cli/handlers/e2e-safe-run.js +23 -0
- package/dist/cli/handlers/pr.d.ts +5 -0
- package/dist/cli/handlers/pr.d.ts.map +1 -1
- package/dist/cli/handlers/pr.js +259 -4
- package/dist/cli/handlers/run-wave.js +89 -1
- package/dist/cli/main.d.ts.map +1 -1
- package/dist/cli/main.js +56 -2
- package/dist/cli/parse-args.d.ts.map +1 -1
- package/dist/cli/parse-args.js +107 -0
- package/dist/cli/registry.d.ts +38 -0
- package/dist/cli/registry.d.ts.map +1 -1
- package/dist/components/adoption.d.ts.map +1 -1
- package/dist/components/adoption.js +1 -2
- package/dist/components/capability.d.ts +37 -0
- package/dist/components/capability.d.ts.map +1 -1
- package/dist/components/capability.js +25 -0
- package/dist/components/check-hooks.d.ts +4 -1
- package/dist/components/check-hooks.d.ts.map +1 -1
- package/dist/components/check-steps.d.ts +74 -0
- package/dist/components/check-steps.d.ts.map +1 -0
- package/dist/components/check-steps.js +102 -0
- package/dist/components/ci-services.d.ts.map +1 -1
- package/dist/components/ci-services.js +1 -2
- package/dist/components/driver.d.ts +12 -0
- package/dist/components/driver.d.ts.map +1 -1
- package/dist/components/driver.js +35 -1
- package/dist/components/groups.d.ts.map +1 -1
- package/dist/components/groups.js +4 -3
- package/dist/components/pr-env-ledger.d.ts.map +1 -1
- package/dist/components/pr-env-ledger.js +1 -2
- package/dist/components/pr-environment.d.ts +1 -1
- package/dist/components/pr-environment.d.ts.map +1 -1
- package/dist/components/pr-environment.js +1 -1
- package/dist/components/pr-pipeline.d.ts +129 -3
- package/dist/components/pr-pipeline.d.ts.map +1 -1
- package/dist/components/pr-pipeline.js +153 -17
- package/dist/components/pr-run.d.ts +8 -0
- package/dist/components/pr-run.d.ts.map +1 -1
- package/dist/components/pr-run.js +9 -4
- package/dist/components/product-pipeline.d.ts +35 -2
- package/dist/components/product-pipeline.d.ts.map +1 -1
- package/dist/components/product-pipeline.js +24 -5
- package/dist/components/wave-plan.d.ts +8 -0
- package/dist/components/wave-plan.d.ts.map +1 -1
- package/dist/components/wave-plan.js +18 -2
- package/dist/e2e-harness/bucket.d.ts +21 -0
- package/dist/e2e-harness/bucket.d.ts.map +1 -0
- package/dist/e2e-harness/bucket.js +61 -0
- package/dist/e2e-harness/claim.d.ts +70 -0
- package/dist/e2e-harness/claim.d.ts.map +1 -0
- package/dist/e2e-harness/claim.js +98 -0
- package/dist/e2e-harness/driver.d.ts +64 -0
- package/dist/e2e-harness/driver.d.ts.map +1 -0
- package/dist/e2e-harness/driver.js +243 -0
- package/dist/e2e-harness/forgejo.d.ts +77 -0
- package/dist/e2e-harness/forgejo.d.ts.map +1 -0
- package/dist/e2e-harness/forgejo.js +205 -0
- package/dist/e2e-harness/git.d.ts +32 -0
- package/dist/e2e-harness/git.d.ts.map +1 -0
- package/dist/e2e-harness/git.js +67 -0
- package/dist/e2e-harness/index.d.ts +22 -0
- package/dist/e2e-harness/index.d.ts.map +1 -0
- package/dist/e2e-harness/index.js +48 -0
- package/dist/e2e-harness/jobs.d.ts +8 -0
- package/dist/e2e-harness/jobs.d.ts.map +1 -0
- package/dist/e2e-harness/jobs.js +34 -0
- package/dist/e2e-harness/pins.d.ts +45 -0
- package/dist/e2e-harness/pins.d.ts.map +1 -0
- package/dist/e2e-harness/pins.js +44 -0
- package/dist/e2e-harness/ports.d.ts +113 -0
- package/dist/e2e-harness/ports.d.ts.map +1 -0
- package/dist/e2e-harness/ports.js +4 -0
- package/dist/e2e-harness/reports.d.ts +45 -0
- package/dist/e2e-harness/reports.d.ts.map +1 -0
- package/dist/e2e-harness/reports.js +57 -0
- package/dist/e2e-harness/safe-run-cli.d.ts +17 -0
- package/dist/e2e-harness/safe-run-cli.d.ts.map +1 -0
- package/dist/e2e-harness/safe-run-cli.js +43 -0
- package/dist/e2e-harness/safe-run.d.ts +61 -0
- package/dist/e2e-harness/safe-run.d.ts.map +1 -0
- package/dist/e2e-harness/safe-run.js +172 -0
- package/dist/e2e-harness/scenario.d.ts +11 -0
- package/dist/e2e-harness/scenario.d.ts.map +1 -0
- package/dist/e2e-harness/scenario.js +89 -0
- package/dist/e2e-harness/schemas/demo-cycle.schema.json +282 -0
- package/dist/e2e-harness/schemas/demo-step.schema.json +245 -0
- package/dist/e2e-harness/schemas/e2e-claim-row.schema.json +33 -0
- package/dist/e2e-harness/schemas/e2e-claims.schema.json +18 -0
- package/dist/e2e-harness/schemas/e2e-scenario.schema.json +150 -0
- package/dist/e2e-harness/schemas/index.d.ts +191 -0
- package/dist/e2e-harness/schemas/index.d.ts.map +1 -0
- package/dist/e2e-harness/schemas/index.js +62 -0
- package/dist/e2e-harness/stack.d.ts +124 -0
- package/dist/e2e-harness/stack.d.ts.map +1 -0
- package/dist/e2e-harness/stack.js +207 -0
- package/dist/e2e-harness/steps.d.ts +11 -0
- package/dist/e2e-harness/steps.d.ts.map +1 -0
- package/dist/e2e-harness/steps.js +22 -0
- package/dist/e2e-harness.d.ts +3 -0
- package/dist/e2e-harness.d.ts.map +1 -0
- package/dist/e2e-harness.js +2 -0
- package/dist/exit-codes.d.ts +7 -1
- package/dist/exit-codes.d.ts.map +1 -1
- package/dist/exit-codes.js +7 -1
- package/dist/lexicon.d.ts +46 -0
- package/dist/lexicon.d.ts.map +1 -1
- package/dist/lifecycle/gate-ledger.d.ts.map +1 -1
- package/dist/lifecycle/gate-ledger.js +2 -3
- package/dist/lifecycle/gated-request.d.ts.map +1 -1
- package/dist/lifecycle/gated-request.js +1 -2
- package/dist/lifecycle/query.d.ts.map +1 -1
- package/dist/lifecycle/query.js +4 -5
- package/dist/lifecycle/release-catalog.d.ts.map +1 -1
- package/dist/lifecycle/release-catalog.js +1 -1
- package/dist/lifecycle/release-ledger.d.ts.map +1 -1
- package/dist/lifecycle/release-ledger.js +1 -2
- package/dist/lifecycle/release-status.d.ts +20 -0
- package/dist/lifecycle/release-status.d.ts.map +1 -1
- package/dist/lifecycle/release-status.js +1 -22
- package/dist/lifecycle/wave-plans.d.ts +23 -7
- package/dist/lifecycle/wave-plans.d.ts.map +1 -1
- package/dist/lifecycle/wave-plans.js +9 -2
- package/dist/op/approval-status.d.ts +103 -0
- package/dist/op/approval-status.d.ts.map +1 -0
- package/dist/op/approval-status.js +197 -0
- package/dist/op/index.d.ts +1 -1
- package/dist/op/index.d.ts.map +1 -1
- package/dist/op/index.js +1 -1
- package/dist/op/op-waves-capability-spec.d.ts +8 -0
- package/dist/op/op-waves-capability-spec.d.ts.map +1 -1
- package/dist/op/op-waves-capability-spec.js +21 -0
- package/dist/op/op-waves-release.d.ts.map +1 -1
- package/dist/op/op-waves-release.js +1 -2
- package/dist/op/op-waves-run.d.ts +7 -2
- package/dist/op/op-waves-run.d.ts.map +1 -1
- package/dist/op/op-waves-run.js +96 -4
- package/dist/op/op-waves-stand-down.d.ts.map +1 -1
- package/dist/op/op-waves-stand-down.js +1 -2
- package/dist/op/op-waves.d.ts +35 -0
- package/dist/op/op-waves.d.ts.map +1 -1
- package/dist/op/op-waves.js +46 -6
- package/dist/op/runtime.d.ts +4 -0
- package/dist/op/runtime.d.ts.map +1 -1
- package/dist/op/runtime.js +2 -3
- package/dist/otlp.d.ts.map +1 -1
- package/dist/otlp.js +1 -2
- package/dist/parallelism.d.ts +17 -0
- package/dist/parallelism.d.ts.map +1 -0
- package/dist/parallelism.js +33 -0
- package/dist/policy-source.d.ts.map +1 -1
- package/dist/policy-source.js +1 -2
- package/dist/pr-forge.d.ts.map +1 -1
- package/dist/pr-forge.js +56 -39
- package/dist/pr-loop.d.ts +9 -0
- package/dist/pr-loop.d.ts.map +1 -1
- package/dist/pr-loop.js +22 -3
- package/dist/pr-merge.d.ts +64 -0
- package/dist/pr-merge.d.ts.map +1 -0
- package/dist/pr-merge.js +78 -0
- package/dist/pr-post.d.ts +70 -1
- package/dist/pr-post.d.ts.map +1 -1
- package/dist/pr-post.js +116 -5
- package/dist/pr-report-url.d.ts.map +1 -1
- package/dist/pr-report-url.js +1 -2
- package/dist/release-floors.d.ts +1 -1
- package/dist/release-floors.js +1 -1
- package/dist/run-event.d.ts.map +1 -1
- package/dist/run-event.js +1 -2
- package/dist/scheduled-op-cloud.d.ts +32 -0
- package/dist/scheduled-op-cloud.d.ts.map +1 -0
- package/dist/scheduled-op-cloud.js +69 -0
- package/dist/wave-runtime.mjs +340 -327
- package/dist/workspace/ci-lock-grain.d.ts +5 -0
- package/dist/workspace/ci-lock-grain.d.ts.map +1 -1
- package/dist/workspace/ci-lock-grain.js +1 -7
- package/dist/workspace/ci-run.d.ts.map +1 -1
- package/dist/workspace/ci-run.js +5 -1
- package/dist/workspace/pr-report.schema.json +5 -0
- package/package.json +1 -1
- package/src/ci-agent.ts +1 -2
- package/src/ci-audit/__fixtures__/cloudtrail-lookup-bucket.json +37 -0
- package/src/ci-audit/__fixtures__/cloudtrail-writes-window.json +59 -0
- package/src/ci-audit/attribution.ts +260 -0
- package/src/ci-audit/audit-log.ts +220 -0
- package/src/ci-audit/ci-audit.test.ts +175 -0
- package/src/ci-audit/index.ts +15 -0
- package/src/ci-audit/unrecorded.ts +140 -0
- package/src/ci-audit.ts +2 -0
- package/src/ci-control.ts +3 -4
- package/src/ci-estate.ts +1 -2
- package/src/ci-identity-database.test.ts +2 -3
- package/src/ci-identity-targets.test.ts +1 -3
- package/src/ci-identity.ts +2 -3
- package/src/ci-job-guard.test.ts +154 -0
- package/src/ci-job-guard.ts +319 -0
- package/src/ci-jobs.ts +8 -0
- package/src/ci-product-comment-targets.test.ts +45 -0
- package/src/ci-product-words.ts +35 -6
- package/src/ci-product.ts +55 -3
- package/src/ci-respond-run.ts +291 -0
- package/src/ci-respond.test.ts +264 -0
- package/src/ci-respond.ts +412 -0
- package/src/cli/handlers/audit-log.ts +74 -0
- package/src/cli/handlers/build-pr-loop-flags.test.ts +98 -0
- package/src/cli/handlers/build.ts +69 -0
- package/src/cli/handlers/ci-check-job.test.ts +114 -0
- package/src/cli/handlers/ci-check-job.ts +33 -0
- package/src/cli/handlers/ci-check.ts +38 -8
- package/src/cli/handlers/e2e-safe-run.ts +27 -0
- package/src/cli/handlers/pr-plan-comment-targets.test.ts +166 -0
- package/src/cli/handlers/pr-plan-flags.test.ts +161 -0
- package/src/cli/handlers/pr.ts +228 -4
- package/src/cli/handlers/run-wave.ts +79 -1
- package/src/cli/main.test.ts +1 -1
- package/src/cli/main.ts +56 -2
- package/src/cli/parse-args.ts +77 -0
- package/src/cli/registry.ts +38 -0
- package/src/components/adoption.ts +1 -2
- package/src/components/capability.ts +50 -0
- package/src/components/check-hooks.ts +4 -1
- package/src/components/check-steps.test.ts +70 -0
- package/src/components/check-steps.ts +158 -0
- package/src/components/ci-services.ts +1 -2
- package/src/components/driver.ts +35 -1
- package/src/components/groups.ts +4 -2
- package/src/components/plan-flags.test.ts +46 -0
- package/src/components/pr-comment-preview-targets.test.ts +34 -0
- package/src/components/pr-env-ledger.ts +1 -2
- package/src/components/pr-env-run-bundle.test.ts +0 -20
- package/src/components/pr-environment.ts +1 -1
- package/src/components/pr-pipeline-runners.test.ts +80 -0
- package/src/components/pr-pipeline.ts +232 -17
- package/src/components/pr-run.ts +17 -6
- package/src/components/pr-stale-job.test.ts +34 -0
- package/src/components/product-pipeline.ts +50 -8
- package/src/components/wave-plan.ts +18 -2
- package/src/e2e-harness/__project__/chant.config.ts +4 -0
- package/src/e2e-harness/__project__/src/compose.ts +33 -0
- package/src/e2e-harness/bucket.ts +69 -0
- package/src/e2e-harness/claim.test.ts +150 -0
- package/src/e2e-harness/claim.ts +140 -0
- package/src/e2e-harness/driver.test.ts +304 -0
- package/src/e2e-harness/driver.ts +294 -0
- package/src/e2e-harness/forgejo.ts +267 -0
- package/src/e2e-harness/git.ts +96 -0
- package/src/e2e-harness/index.ts +50 -0
- package/src/e2e-harness/jobs.ts +35 -0
- package/src/e2e-harness/pins.ts +52 -0
- package/src/e2e-harness/ports.ts +130 -0
- package/src/e2e-harness/reports.ts +79 -0
- package/src/e2e-harness/safe-run-cli.test.ts +102 -0
- package/src/e2e-harness/safe-run-cli.ts +54 -0
- package/src/e2e-harness/safe-run.ts +198 -0
- package/src/e2e-harness/scenario.ts +89 -0
- package/src/e2e-harness/schemas/README.md +62 -0
- package/src/e2e-harness/schemas/demo-cycle.schema.json +282 -0
- package/src/e2e-harness/schemas/demo-step.schema.json +245 -0
- package/src/e2e-harness/schemas/e2e-claim-row.schema.json +33 -0
- package/src/e2e-harness/schemas/e2e-claims.schema.json +18 -0
- package/src/e2e-harness/schemas/e2e-scenario.schema.json +150 -0
- package/src/e2e-harness/schemas/index.ts +220 -0
- package/src/e2e-harness/schemas.test.ts +145 -0
- package/src/e2e-harness/stack.test.ts +124 -0
- package/src/e2e-harness/stack.ts +306 -0
- package/src/e2e-harness/steps.ts +30 -0
- package/src/e2e-harness.ts +2 -0
- package/src/exit-codes.test.ts +3 -2
- package/src/exit-codes.ts +7 -1
- package/src/gate-decision-bundle.test.ts +0 -2
- package/src/lexicon.ts +48 -0
- package/src/lifecycle/control-entries-ledger.test.ts +2 -3
- package/src/lifecycle/gate-ledger.ts +2 -3
- package/src/lifecycle/gated-request.ts +1 -2
- package/src/lifecycle/query.ts +4 -5
- package/src/lifecycle/release-catalog.test.ts +3 -4
- package/src/lifecycle/release-catalog.ts +1 -1
- package/src/lifecycle/release-ledger.ts +1 -2
- package/src/lifecycle/release-status.test.ts +3 -4
- package/src/lifecycle/release-status.ts +1 -2
- package/src/lifecycle/wave-plans.ts +33 -5
- package/src/op/approval-status.test.ts +134 -0
- package/src/op/approval-status.ts +235 -0
- package/src/op/gate-review.test.ts +2 -1
- package/src/op/index.ts +2 -0
- package/src/op/op-waves-after-plan.test.ts +12 -0
- package/src/op/op-waves-capability-spec.ts +20 -0
- package/src/op/op-waves-parallelism.test.ts +89 -0
- package/src/op/op-waves-pull-request.test.ts +78 -1
- package/src/op/op-waves-release.ts +1 -2
- package/src/op/op-waves-run.ts +94 -4
- package/src/op/op-waves-stand-down.ts +1 -2
- package/src/op/op-waves.ts +63 -6
- package/src/op/runtime.ts +6 -3
- package/src/otlp.ts +1 -2
- package/src/parallelism.test.ts +38 -0
- package/src/parallelism.ts +33 -0
- package/src/policy-source.ts +1 -2
- package/src/pr-forge-bundle.test.ts +1 -1
- package/src/pr-forge.ts +54 -35
- package/src/pr-loop-bundle.test.ts +1 -1
- package/src/pr-loop-narrowed.test.ts +63 -0
- package/src/pr-loop.ts +30 -3
- package/src/pr-merge.test.ts +100 -0
- package/src/pr-merge.ts +105 -0
- package/src/pr-post-stale.test.ts +163 -0
- package/src/pr-post.ts +159 -5
- package/src/pr-report-url.ts +1 -2
- package/src/product-subpaths-plain-node.e2e.test.ts +1 -0
- package/src/release-floors.ts +1 -1
- package/src/run-event.ts +1 -2
- package/src/scheduled-op-cloud.ts +68 -0
- package/src/stage-hooks-bundle.test.ts +0 -2
- package/src/workspace/ci-lock-grain.ts +1 -2
- package/src/workspace/ci-run.ts +5 -1
- package/src/workspace/pr-report.schema.json +5 -0
package/dist/pr-post.js
CHANGED
|
@@ -20,14 +20,21 @@
|
|
|
20
20
|
* job there that holds `CHANT_FORGE_TOKEN` runs whatever the change wrote.
|
|
21
21
|
* `pr-post --open` ({@link postOpenPlanReports}) asks GitLab for each open
|
|
22
22
|
* merge request's plan job and reads the report from its artifacts.
|
|
23
|
+
*
|
|
24
|
+
* #4628: the note carries the target branch's commit it was posted against
|
|
25
|
+
* (`baseTip`) in a hidden line, and on GitHub and Forgejo the note job adds
|
|
26
|
+
* the note to the job summary (`GITHUB_STEP_SUMMARY`). When the target
|
|
27
|
+
* branch moves, {@link markStaleNotes}, from a job of the push, marks each
|
|
28
|
+
* open pull request's note stale with a line naming the comment that
|
|
29
|
+
* previews again, and sets its plan status back to pending.
|
|
23
30
|
*/
|
|
24
|
-
import { existsSync, mkdtempSync, readFileSync, rmSync, writeFileSync } from "node:fs";
|
|
31
|
+
import { appendFileSync, existsSync, mkdtempSync, readFileSync, rmSync, writeFileSync } from "node:fs";
|
|
25
32
|
import { tmpdir } from "node:os";
|
|
26
33
|
import { join } from "node:path";
|
|
27
34
|
import { prNoteMarker, prStatusContext, prStatusDescription, prStatusState, renderPrNote } from "./pr-loop.js";
|
|
28
35
|
import { forgePrincipalOf } from "./pr-forge.js";
|
|
29
36
|
import { GITHUB_COMMENT_LIMIT, GITLAB_NOTE_LIMIT } from "./plan-summary.js";
|
|
30
|
-
import { activeProductWords } from "./ci-product-words.js";
|
|
37
|
+
import { activeProductWords, commentLine } from "./ci-product-words.js";
|
|
31
38
|
import { controlEdgeFactsFromEnv, remarkCrossStackEdges } from "./control/edges.js";
|
|
32
39
|
/** The plan report's file under the report directory. */
|
|
33
40
|
export const PR_PLAN_REPORT_FILE = "pr-plan.json";
|
|
@@ -70,14 +77,35 @@ export function readPlanReport(input) {
|
|
|
70
77
|
* The note for `report`, rendered here, with every `<!--` after the marker
|
|
71
78
|
* line written as `<!--`, so the note carries no hidden marker but its own.
|
|
72
79
|
*/
|
|
73
|
-
export function planNoteFor(report, forge, marker) {
|
|
80
|
+
export function planNoteFor(report, forge, marker, baseTip) {
|
|
74
81
|
const note = renderPrNote(report, {
|
|
75
82
|
limit: forge.kind === "gitlab" ? GITLAB_NOTE_LIMIT : GITHUB_COMMENT_LIMIT,
|
|
76
83
|
approver: forgePrincipalOf(forge.kind, forge.host, "<your-login>"),
|
|
77
84
|
});
|
|
78
85
|
const at = note.indexOf("\n");
|
|
79
86
|
const rest = (at < 0 ? "" : note.slice(at + 1)).split("<!--").join("<!--");
|
|
80
|
-
|
|
87
|
+
// #4628: the tip line is written after the defusing, from the caller's sha, never the report's.
|
|
88
|
+
const tip = baseTip && SHA.test(baseTip) ? `${rest.endsWith("\n") ? "" : "\n"}${prNoteTipMarker(baseTip)}\n` : "";
|
|
89
|
+
return `${marker}\n${rest}${tip}`;
|
|
90
|
+
}
|
|
91
|
+
/** The hidden line a note carries with the target branch's commit it was posted against (#4628). */
|
|
92
|
+
export function prNoteTipMarker(sha) {
|
|
93
|
+
return `<!-- chant-pr-tip:${sha} -->`;
|
|
94
|
+
}
|
|
95
|
+
/** The hidden line a note marked stale carries, with the commit it was marked at (#4628). */
|
|
96
|
+
export function prNoteStaleMarker(sha) {
|
|
97
|
+
return `<!-- chant-pr-stale:${sha} -->`;
|
|
98
|
+
}
|
|
99
|
+
const TIP_LINE = /<!-- chant-pr-tip:([0-9a-f]{40}) -->/;
|
|
100
|
+
const STALE_LINE = /<!-- chant-pr-stale:([0-9a-f]{40}) -->/;
|
|
101
|
+
const STALE_PREFIX = "> Stale: ";
|
|
102
|
+
/** The note as the job summary shows it (#4628): the hidden lines dropped. */
|
|
103
|
+
export function planNoteSummary(note) {
|
|
104
|
+
return note
|
|
105
|
+
.split("\n")
|
|
106
|
+
.filter((l) => !/^<!-- chant-pr[-:]/.test(l.trim()))
|
|
107
|
+
.join("\n")
|
|
108
|
+
.replace(/^\n+/, "");
|
|
81
109
|
}
|
|
82
110
|
const cut = (text, max = 140) => (text.length > max ? `${text.slice(0, max - 3)}...` : text);
|
|
83
111
|
/**
|
|
@@ -116,7 +144,7 @@ export async function postPlanReport(input) {
|
|
|
116
144
|
description = prStatusDescription(report);
|
|
117
145
|
// A member the change does not reach has nothing to say on the pull request (as pr-plan's own publish).
|
|
118
146
|
if (!(input.member && report.status === "nothing" && !report.overdue?.length && !report.migrations?.length))
|
|
119
|
-
note = planNoteFor(report, input.forge, prNoteMarker(input.env, input.member));
|
|
147
|
+
note = planNoteFor(report, input.forge, prNoteMarker(input.env, input.member), input.baseTip);
|
|
120
148
|
}
|
|
121
149
|
catch (err) {
|
|
122
150
|
refused = `the plan report does not render: ${err instanceof Error ? err.message : String(err)}`;
|
|
@@ -144,6 +172,23 @@ export async function postPlanReport(input) {
|
|
|
144
172
|
note = undefined;
|
|
145
173
|
}
|
|
146
174
|
}
|
|
175
|
+
// #4628: the note in the job summary, on a forge that keeps one.
|
|
176
|
+
if (input.summaryFile && (note !== undefined || refused !== undefined)) {
|
|
177
|
+
try {
|
|
178
|
+
appendFileSync(input.summaryFile, `${note !== undefined ? planNoteSummary(note) : `${context}: ${description}\n`}\n`);
|
|
179
|
+
}
|
|
180
|
+
catch (err) {
|
|
181
|
+
warnings.push(`could not write the job summary: ${err instanceof Error ? err.message : String(err)}`);
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
if (input.description && "report" in read && !failedJob) {
|
|
185
|
+
try {
|
|
186
|
+
await input.description(read.report);
|
|
187
|
+
}
|
|
188
|
+
catch (err) {
|
|
189
|
+
warnings.push(`the description check did not run: ${err instanceof Error ? err.message : String(err)}`);
|
|
190
|
+
}
|
|
191
|
+
}
|
|
147
192
|
return { state, description: cut(description), noted: note !== undefined, ...(refused ? { refused } : {}), warnings };
|
|
148
193
|
}
|
|
149
194
|
/**
|
|
@@ -210,6 +255,8 @@ export async function postOpenPlanReports(input) {
|
|
|
210
255
|
...(input.member ? { member: input.member } : {}),
|
|
211
256
|
result: settled,
|
|
212
257
|
...(overdueOnce ? { overdue: overdueOnce } : {}),
|
|
258
|
+
...(input.description ? { description: input.description } : {}),
|
|
259
|
+
...(input.baseTip ? { baseTip: input.baseTip } : {}),
|
|
213
260
|
});
|
|
214
261
|
posts.push({ pr: job.pr, head: job.head, posted });
|
|
215
262
|
}
|
|
@@ -223,3 +270,67 @@ export async function postOpenPlanReports(input) {
|
|
|
223
270
|
}
|
|
224
271
|
return { posts, warnings };
|
|
225
272
|
}
|
|
273
|
+
/**
|
|
274
|
+
* Mark stale each open pull request's note into `branch` that was posted
|
|
275
|
+
* against another commit than `tip` (#4628): a line after the marker says
|
|
276
|
+
* the branch moved and names the comment that previews again (or a push,
|
|
277
|
+
* when the pipeline answers no plan comment), and the plan status on the
|
|
278
|
+
* pull request's head goes back to pending. A note with no tip line (posted
|
|
279
|
+
* before #4628), one at `tip`, or one already marked at `tip` is left alone.
|
|
280
|
+
* A forge that refuses one pull request is a warning, and the others go on.
|
|
281
|
+
*/
|
|
282
|
+
export async function markStaleNotes(input) {
|
|
283
|
+
const { forge } = input;
|
|
284
|
+
if (!SHA.test(input.tip))
|
|
285
|
+
throw new Error(`the target branch's commit is a full sha, not ${JSON.stringify(input.tip)}`);
|
|
286
|
+
if (!forge.openPullRequests)
|
|
287
|
+
throw new Error(`marking notes stale lists the open pull requests into ${input.branch}, which this ${forge.kind} client cannot`);
|
|
288
|
+
const words = input.words ?? activeProductWords();
|
|
289
|
+
const marker = prNoteMarker(input.env, input.member);
|
|
290
|
+
const context = prStatusContext("plan", input.member, words);
|
|
291
|
+
const comment = input.previewComment ? commentLine(words, "plan") : undefined;
|
|
292
|
+
const verb = words.verbs.plan[0];
|
|
293
|
+
const again = comment ? `comment \`${comment}\` to ${verb} again` : `push a commit to ${verb} again`;
|
|
294
|
+
const marks = [];
|
|
295
|
+
const warnings = [];
|
|
296
|
+
for (const pr of await forge.openPullRequests(input.branch)) {
|
|
297
|
+
try {
|
|
298
|
+
const found = await forge.findComment(pr.number, marker);
|
|
299
|
+
if (!found) {
|
|
300
|
+
marks.push({ pr: pr.number, skipped: "no note" });
|
|
301
|
+
continue;
|
|
302
|
+
}
|
|
303
|
+
const planned = TIP_LINE.exec(found.body)?.[1];
|
|
304
|
+
if (!planned) {
|
|
305
|
+
marks.push({ pr: pr.number, skipped: "the note names no target branch commit" });
|
|
306
|
+
continue;
|
|
307
|
+
}
|
|
308
|
+
if (planned === input.tip) {
|
|
309
|
+
marks.push({ pr: pr.number, skipped: "the note is current" });
|
|
310
|
+
continue;
|
|
311
|
+
}
|
|
312
|
+
if (STALE_LINE.exec(found.body)?.[1] === input.tip) {
|
|
313
|
+
marks.push({ pr: pr.number, skipped: "already marked" });
|
|
314
|
+
continue;
|
|
315
|
+
}
|
|
316
|
+
const lines = found.body.split("\n");
|
|
317
|
+
const head = lines[0] === marker ? 1 : 0;
|
|
318
|
+
const kept = lines.slice(head).filter((l) => !l.startsWith(STALE_PREFIX) && !STALE_LINE.test(l));
|
|
319
|
+
while (kept[0] === "")
|
|
320
|
+
kept.shift();
|
|
321
|
+
const line = `${STALE_PREFIX}${input.branch} moved to \`${input.tip.slice(0, 12)}\` since this ${verb} was posted against \`${planned.slice(0, 12)}\`, so it may no longer show what the merge does; ${again}.`;
|
|
322
|
+
await forge.upsertNote(pr.number, marker, [marker, line, prNoteStaleMarker(input.tip), "", ...kept].join("\n"));
|
|
323
|
+
try {
|
|
324
|
+
await forge.setStatus(pr.headSha, { context, state: "pending", description: cut(`stale: ${input.branch} moved; ${again.replace(/`/g, "")}`) });
|
|
325
|
+
}
|
|
326
|
+
catch (err) {
|
|
327
|
+
warnings.push(`#${pr.number}: could not set the ${context} status back to pending: ${err instanceof Error ? err.message : String(err)}`);
|
|
328
|
+
}
|
|
329
|
+
marks.push({ pr: pr.number, marked: true });
|
|
330
|
+
}
|
|
331
|
+
catch (err) {
|
|
332
|
+
warnings.push(`#${pr.number}: ${err instanceof Error ? err.message : String(err)}`);
|
|
333
|
+
}
|
|
334
|
+
}
|
|
335
|
+
return { marks, warnings };
|
|
336
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pr-report-url.d.ts","sourceRoot":"","sources":["../src/pr-report-url.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2CG;
|
|
1
|
+
{"version":3,"file":"pr-report-url.d.ts","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OAAO,CAAC,IAAI,CAAC,CAAC;CACxB;AAQD,mFAAmF;AACnF,wBAAgB,kBAAkB,CAAC,KAAK,EAAE;IACxC,MAAM,EAAE,YAAY,CAAC;IACrB,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,GAAG,OAAO,GAAG,QAAQ,CAAC;IACnC,IAAI,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IAChC,GAAG,CAAC,EAAE,SAAS,CAAC;CACjB,GAAG,cAAc,CA6DjB"}
|
package/dist/pr-report-url.js
CHANGED
|
@@ -46,9 +46,8 @@ import { spawn } from "node:child_process";
|
|
|
46
46
|
import { mkdirSync, readFileSync, renameSync, writeFileSync } from "node:fs";
|
|
47
47
|
import { dirname, isAbsolute, join } from "node:path";
|
|
48
48
|
import { fileURLToPath } from "node:url";
|
|
49
|
-
import { NEXT_RELEASE } from "./release-floors.js";
|
|
50
49
|
/** The first chant that reads a `gs://` or `az://` report URL (#4554). */
|
|
51
|
-
export const REPORT_URL_CLOUDS_FLOOR =
|
|
50
|
+
export const REPORT_URL_CLOUDS_FLOOR = "0.124.55";
|
|
52
51
|
/** `--report-url` read, or why it can't be. `name` is what the error calls the value: the flag, or `ci.reportUrl` (#4160). */
|
|
53
52
|
export function parseReportUrl(raw, name = "--report-url") {
|
|
54
53
|
const url = raw.trim();
|
package/dist/release-floors.d.ts
CHANGED
|
@@ -19,5 +19,5 @@
|
|
|
19
19
|
* this constant to the next patch (#4501). The check fails while a floor
|
|
20
20
|
* still names this constant after its version shipped.
|
|
21
21
|
*/
|
|
22
|
-
export declare const NEXT_RELEASE = "0.124.
|
|
22
|
+
export declare const NEXT_RELEASE = "0.124.56";
|
|
23
23
|
//# sourceMappingURL=release-floors.d.ts.map
|
package/dist/release-floors.js
CHANGED
package/dist/run-event.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"run-event.d.ts","sourceRoot":"","sources":["../src/run-event.ts"],"names":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EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,IAAI,CAAC,EAAE,kBAAkB,CAAC;IAC1B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,0EAA0E;IAC1E,IAAI,CAAC,EAAE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC;CACrC,GACA,YAAY,EAAE,CAqDhB"}
|
package/dist/run-event.js
CHANGED
|
@@ -25,7 +25,6 @@
|
|
|
25
25
|
* loads no workspace module (#2526).
|
|
26
26
|
*/
|
|
27
27
|
import { CHANT_VERSION } from "./chant-version.js";
|
|
28
|
-
import { NEXT_RELEASE } from "./release-floors.js";
|
|
29
28
|
/** The schema's `$id`, which every event carries as `$schema`. */
|
|
30
29
|
export const RUN_EVENT_SCHEMA_ID = "https://intentius.io/chant/schemas/workspace/run-event/v1/run-event.schema.json";
|
|
31
30
|
/** The contract version every event carries as `contract`. */
|
|
@@ -37,7 +36,7 @@ export const RUN_EVENT_FAILURE_FLOOR = "0.124.30";
|
|
|
37
36
|
/** The first chant that writes `blocked`, `already-applied` and `blockedBy` on `component-settle` (#4007). */
|
|
38
37
|
export const RUN_EVENT_COMPONENT_SKIP_FLOOR = "0.124.29";
|
|
39
38
|
/** The first chant that writes `resources` on `step-settle` (#4615). */
|
|
40
|
-
export const RUN_EVENT_RESOURCES_FLOOR =
|
|
39
|
+
export const RUN_EVENT_RESOURCES_FLOOR = "0.124.55";
|
|
41
40
|
/** Every event type, in the order a reader meets them. Closed: part of the contract. */
|
|
42
41
|
export const RUN_EVENT_TYPES = [
|
|
43
42
|
"run-start",
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Cloud identities on scheduled Op jobs (#4631), as op waves have them
|
|
3
|
+
* (#4332, #4549): what the github, forgejo and gitlab Op generators share.
|
|
4
|
+
*
|
|
5
|
+
* A scheduled Op with `cloud` trades its job's OIDC token for those
|
|
6
|
+
* identities before the checkout, and every later step drops the variables
|
|
7
|
+
* a token is requested with. A drift Op with `update` gets a second job
|
|
8
|
+
* after its own, started only when the run exits with chant's drift code,
|
|
9
|
+
* which trades for the update's identity and runs the update. The drift
|
|
10
|
+
* check never holds the update's identity.
|
|
11
|
+
*
|
|
12
|
+
* The update job holds `contents: read`, and `update.permissions` adds
|
|
13
|
+
* scopes to it. It may raise `contents` to `write` (2026-10-28 ruling), so
|
|
14
|
+
* an update such as `plywood up` can push its records to `chant/lifecycle`
|
|
15
|
+
* with the job token. The drift check's job keeps the finding-mode's
|
|
16
|
+
* scopes whatever the update asks for.
|
|
17
|
+
*/
|
|
18
|
+
import type { ScheduledOpSpec } from "./lexicon.js";
|
|
19
|
+
/** The update job's name beside the Op's job `jobName`. */
|
|
20
|
+
export declare function scheduledOpUpdateJobName(jobName: string): string;
|
|
21
|
+
/** The shell line that drops the token request variables, which a step after the trade starts with. */
|
|
22
|
+
export declare function dropTokenRequestLine(): string;
|
|
23
|
+
/** `line` with the token request variables dropped first. */
|
|
24
|
+
export declare function withoutTokenRequestLine(line: string): string;
|
|
25
|
+
/**
|
|
26
|
+
* Refuse a `cloud` or `update` a generator could not render: a malformed
|
|
27
|
+
* trade spec, an update with no command, an update on a push trigger or a
|
|
28
|
+
* review split, or one beside a comment agent, and an `update.permissions`
|
|
29
|
+
* that restates `contents` at anything but `write`.
|
|
30
|
+
*/
|
|
31
|
+
export declare function assertScheduledOpCloud(spec: ScheduledOpSpec): void;
|
|
32
|
+
//# sourceMappingURL=scheduled-op-cloud.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scheduled-op-cloud.d.ts","sourceRoot":"","sources":["../src/scheduled-op-cloud.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAGH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAIjD,2DAA2D;AAC3D,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAEhE;AAED,uGAAuG;AACvG,wBAAgB,oBAAoB,IAAI,MAAM,CAE7C;AAED,6DAA6D;AAC7D,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAE5D;AAED;;;;;GAKG;AACH,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,eAAe,GAAG,IAAI,CAuBlE"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Cloud identities on scheduled Op jobs (#4631), as op waves have them
|
|
3
|
+
* (#4332, #4549): what the github, forgejo and gitlab Op generators share.
|
|
4
|
+
*
|
|
5
|
+
* A scheduled Op with `cloud` trades its job's OIDC token for those
|
|
6
|
+
* identities before the checkout, and every later step drops the variables
|
|
7
|
+
* a token is requested with. A drift Op with `update` gets a second job
|
|
8
|
+
* after its own, started only when the run exits with chant's drift code,
|
|
9
|
+
* which trades for the update's identity and runs the update. The drift
|
|
10
|
+
* check never holds the update's identity.
|
|
11
|
+
*
|
|
12
|
+
* The update job holds `contents: read`, and `update.permissions` adds
|
|
13
|
+
* scopes to it. It may raise `contents` to `write` (2026-10-28 ruling), so
|
|
14
|
+
* an update such as `plywood up` can push its records to `chant/lifecycle`
|
|
15
|
+
* with the job token. The drift check's job keeps the finding-mode's
|
|
16
|
+
* scopes whatever the update asks for.
|
|
17
|
+
*/
|
|
18
|
+
import { OIDC_REQUEST_VARS } from "./ci-identity.js";
|
|
19
|
+
import { resolveOpTrigger } from "./lexicon.js";
|
|
20
|
+
import { assertOpWaveCloud } from "./op/op-waves.js";
|
|
21
|
+
/** The update job's name beside the Op's job `jobName`. */
|
|
22
|
+
export function scheduledOpUpdateJobName(jobName) {
|
|
23
|
+
return `${jobName}-update`;
|
|
24
|
+
}
|
|
25
|
+
/** The shell line that drops the token request variables, which a step after the trade starts with. */
|
|
26
|
+
export function dropTokenRequestLine() {
|
|
27
|
+
return `unset ${OIDC_REQUEST_VARS.join(" ")}`;
|
|
28
|
+
}
|
|
29
|
+
/** `line` with the token request variables dropped first. */
|
|
30
|
+
export function withoutTokenRequestLine(line) {
|
|
31
|
+
return `${dropTokenRequestLine()}\n${line}`;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Refuse a `cloud` or `update` a generator could not render: a malformed
|
|
35
|
+
* trade spec, an update with no command, an update on a push trigger or a
|
|
36
|
+
* review split, or one beside a comment agent, and an `update.permissions`
|
|
37
|
+
* that restates `contents` at anything but `write`.
|
|
38
|
+
*/
|
|
39
|
+
export function assertScheduledOpCloud(spec) {
|
|
40
|
+
const where = `Scheduled Op "${spec.name}"`;
|
|
41
|
+
if (spec.cloud !== undefined) {
|
|
42
|
+
assertOpWaveCloud(where, "cloud", spec.cloud);
|
|
43
|
+
if (spec.reviewAgent === true)
|
|
44
|
+
throw new Error(`${where}: a reviewAgent Op's review job runs the change's code beside a model, so it takes no cloud identity.`);
|
|
45
|
+
if (spec.agent?.on === "comment")
|
|
46
|
+
throw new Error(`${where}: a comment agent's jobs take no cloud identity.`);
|
|
47
|
+
}
|
|
48
|
+
const update = spec.update;
|
|
49
|
+
if (update === undefined)
|
|
50
|
+
return;
|
|
51
|
+
if (update === null || typeof update !== "object" || typeof update.command !== "string" || update.command.trim() === "") {
|
|
52
|
+
throw new Error(`${where}: update must give the command its job runs: { "command": "<line>", "cloud"?: {...} }.`);
|
|
53
|
+
}
|
|
54
|
+
if (update.cloud !== undefined)
|
|
55
|
+
assertOpWaveCloud(where, "update.cloud", update.cloud);
|
|
56
|
+
if (spec.reviewAgent === true)
|
|
57
|
+
throw new Error(`${where}: update follows a drift check's run, and a reviewAgent Op runs a review; give it to a drift Op.`);
|
|
58
|
+
if (spec.agent?.on === "comment")
|
|
59
|
+
throw new Error(`${where}: update follows a drift check's run, and a comment agent's workflow has none.`);
|
|
60
|
+
const trigger = resolveOpTrigger(spec);
|
|
61
|
+
if (trigger.kind === "push")
|
|
62
|
+
throw new Error(`${where}: update follows a drift check's run; give it a cron or pull_request trigger.`);
|
|
63
|
+
for (const [scope, value] of Object.entries(update.permissions ?? {})) {
|
|
64
|
+
// 2026-10-28 ruling: contents may be raised to write, so the update can record on chant/lifecycle.
|
|
65
|
+
if (scope === "contents" && value !== "write") {
|
|
66
|
+
throw new Error(`${where}: update.permissions names contents: ${String(value)}, which the update job holds already; contents may only be raised to write, for an update that records on chant/lifecycle.`);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}
|