@intentius/chant 0.124.100 → 0.124.102
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 +2 -0
- package/dist/action-pins.js +3 -0
- package/dist/ci-detect.d.ts +13 -0
- package/dist/ci-detect.js +12 -0
- package/dist/ci-evidence-claims.d.ts +12 -0
- package/dist/ci-evidence-claims.js +12 -0
- package/dist/ci-system.d.ts +66 -0
- package/dist/ci-system.js +61 -0
- package/dist/cli/handlers/build.js +27 -0
- package/dist/cli/handlers/release-doctor.d.ts +12 -0
- package/dist/cli/handlers/release-doctor.js +118 -0
- package/dist/cli/handlers/release-init.d.ts +10 -0
- package/dist/cli/handlers/release-init.js +374 -0
- package/dist/cli/handlers/release.d.ts +43 -2
- package/dist/cli/handlers/release.js +667 -39
- package/dist/cli/handlers/run-generate.js +11 -0
- package/dist/cli/main.d.ts +2 -0
- package/dist/cli/main.js +44 -101
- package/dist/cli/parse-args.js +48 -0
- package/dist/cli/registry.d.ts +16 -0
- package/dist/cli/release-commands/artifacts.d.ts +3 -0
- package/dist/cli/release-commands/artifacts.js +14 -0
- package/dist/cli/release-commands/candidates.d.ts +3 -0
- package/dist/cli/release-commands/candidates.js +16 -0
- package/dist/cli/release-commands/changed.d.ts +3 -0
- package/dist/cli/release-commands/changed.js +14 -0
- package/dist/cli/release-commands/compose.d.ts +3 -0
- package/dist/cli/release-commands/compose.js +16 -0
- package/dist/cli/release-commands/cut.d.ts +3 -0
- package/dist/cli/release-commands/cut.js +50 -0
- package/dist/cli/release-commands/doctor.d.ts +3 -0
- package/dist/cli/release-commands/doctor.js +14 -0
- package/dist/cli/release-commands/export.d.ts +3 -0
- package/dist/cli/release-commands/export.js +12 -0
- package/dist/cli/release-commands/images.d.ts +3 -0
- package/dist/cli/release-commands/images.js +13 -0
- package/dist/cli/release-commands/index.d.ts +8 -0
- package/dist/cli/release-commands/index.js +52 -0
- package/dist/cli/release-commands/init.d.ts +3 -0
- package/dist/cli/release-commands/init.js +19 -0
- package/dist/cli/release-commands/list.d.ts +3 -0
- package/dist/cli/release-commands/list.js +10 -0
- package/dist/cli/release-commands/next.d.ts +3 -0
- package/dist/cli/release-commands/next.js +13 -0
- package/dist/cli/release-commands/publish.d.ts +3 -0
- package/dist/cli/release-commands/publish.js +22 -0
- package/dist/cli/release-commands/stamp.d.ts +3 -0
- package/dist/cli/release-commands/stamp.js +15 -0
- package/dist/cli/release-commands/status.d.ts +3 -0
- package/dist/cli/release-commands/status.js +17 -0
- package/dist/cli/release-commands/tag.d.ts +3 -0
- package/dist/cli/release-commands/tag.js +12 -0
- package/dist/cli/release-commands/types.d.ts +20 -0
- package/dist/cli/release-commands/types.js +1 -0
- package/dist/cli/release-commands/verify.d.ts +3 -0
- package/dist/cli/release-commands/verify.js +15 -0
- package/dist/cli/release-commands/workflow.d.ts +3 -0
- package/dist/cli/release-commands/workflow.js +15 -0
- package/dist/cloud-lister/index.d.ts +4 -1
- package/dist/cloud-lister/index.js +2 -1
- package/dist/cloud-lister/kubernetes-components.d.ts +56 -0
- package/dist/cloud-lister/kubernetes-components.js +642 -0
- package/dist/cloud-lister/kubernetes.d.ts +18 -0
- package/dist/cloud-lister/kubernetes.js +26 -1
- package/dist/cloud-lister/mask.d.ts +5 -1
- package/dist/cloud-lister/mask.js +14 -5
- package/dist/components/cli-support.d.ts +1 -1
- package/dist/components/cli-support.js +1 -1
- package/dist/config-environments.d.ts +8 -1
- package/dist/config-environments.js +2 -0
- package/dist/config-import.d.ts +1 -1
- package/dist/config-import.js +6 -2
- package/dist/config-sandbox.d.ts +1 -1
- package/dist/config-sandbox.js +3 -3
- package/dist/config.d.ts +369 -10
- package/dist/config.js +127 -7
- package/dist/deep-observation.js +9 -3
- package/dist/floor-table.data.js +21 -1
- package/dist/forge-remote.d.ts +13 -0
- package/dist/forge-remote.js +15 -0
- package/dist/lexicon.d.ts +45 -4
- package/dist/lifecycle/__fixtures__/package-files.d.ts +32 -0
- package/dist/lifecycle/__fixtures__/package-files.js +72 -0
- package/dist/lifecycle/__fixtures__/publish-fakes.d.ts +62 -0
- package/dist/lifecycle/__fixtures__/publish-fakes.js +275 -3
- package/dist/lifecycle/publish-attachments.d.ts +2 -1
- package/dist/lifecycle/publish-attachments.js +19 -2
- package/dist/lifecycle/publish-cargo.d.ts +99 -0
- package/dist/lifecycle/publish-cargo.js +412 -0
- package/dist/lifecycle/publish-credentials.d.ts +1 -1
- package/dist/lifecycle/publish-credentials.js +13 -0
- package/dist/lifecycle/publish-declaration.d.ts +322 -4
- package/dist/lifecycle/publish-declaration.js +340 -9
- package/dist/lifecycle/publish-forge.d.ts +45 -2
- package/dist/lifecycle/publish-forge.js +434 -34
- package/dist/lifecycle/publish-git-ssh.d.ts +15 -0
- package/dist/lifecycle/publish-git-ssh.js +30 -4
- package/dist/lifecycle/publish-github.d.ts +40 -2
- package/dist/lifecycle/publish-github.js +100 -3
- package/dist/lifecycle/publish-helm.d.ts +83 -0
- package/dist/lifecycle/publish-helm.js +452 -0
- package/dist/lifecycle/publish-homebrew.d.ts +7 -9
- package/dist/lifecycle/publish-homebrew.js +34 -197
- package/dist/lifecycle/publish-index.d.ts +141 -0
- package/dist/lifecycle/publish-index.js +719 -0
- package/dist/lifecycle/publish-marketplace.js +77 -0
- package/dist/lifecycle/publish-maven.d.ts +79 -0
- package/dist/lifecycle/publish-maven.js +364 -0
- package/dist/lifecycle/publish-mcp-registry.d.ts +66 -0
- package/dist/lifecycle/publish-mcp-registry.js +305 -0
- package/dist/lifecycle/publish-npm.d.ts +27 -1
- package/dist/lifecycle/publish-npm.js +216 -3
- package/dist/lifecycle/publish-nuget.d.ts +93 -0
- package/dist/lifecycle/publish-nuget.js +377 -0
- package/dist/lifecycle/publish-oci.d.ts +91 -2
- package/dist/lifecycle/publish-oci.js +247 -8
- package/dist/lifecycle/publish-package-files.d.ts +16 -0
- package/dist/lifecycle/publish-package-files.js +39 -0
- package/dist/lifecycle/publish-pypi.d.ts +138 -0
- package/dist/lifecycle/publish-pypi.js +657 -0
- package/dist/lifecycle/publish-record.d.ts +6 -3
- package/dist/lifecycle/publish-record.js +6 -3
- package/dist/lifecycle/publish-rubygems.d.ts +84 -0
- package/dist/lifecycle/publish-rubygems.js +366 -0
- package/dist/lifecycle/publish-signing.d.ts +147 -0
- package/dist/lifecycle/publish-signing.js +257 -0
- package/dist/lifecycle/publish-targets.d.ts +37 -1
- package/dist/lifecycle/publish-targets.js +102 -0
- package/dist/lifecycle/publish-tauri.js +43 -0
- package/dist/lifecycle/publish-train-names.d.ts +57 -0
- package/dist/lifecycle/publish-train-names.js +123 -0
- package/dist/lifecycle/publish-verify.d.ts +121 -0
- package/dist/lifecycle/publish-verify.js +130 -0
- package/dist/lifecycle/query.js +8 -0
- package/dist/lifecycle/release-artifacts.d.ts +290 -0
- package/dist/lifecycle/release-artifacts.js +808 -0
- package/dist/lifecycle/release-changelog.d.ts +13 -1
- package/dist/lifecycle/release-changelog.js +35 -2
- package/dist/lifecycle/release-cut.d.ts +64 -4
- package/dist/lifecycle/release-cut.js +147 -34
- package/dist/lifecycle/release-doctor.d.ts +113 -0
- package/dist/lifecycle/release-doctor.js +1198 -0
- package/dist/lifecycle/release-green.d.ts +86 -0
- package/dist/lifecycle/release-green.js +286 -0
- package/dist/lifecycle/release-init-registries.d.ts +48 -0
- package/dist/lifecycle/release-init-registries.js +97 -0
- package/dist/lifecycle/release-init.d.ts +275 -0
- package/dist/lifecycle/release-init.js +984 -0
- package/dist/lifecycle/release-intents.d.ts +73 -0
- package/dist/lifecycle/release-intents.js +128 -0
- package/dist/lifecycle/release-next.d.ts +111 -0
- package/dist/lifecycle/release-next.js +251 -0
- package/dist/lifecycle/release-prerelease.d.ts +19 -0
- package/dist/lifecycle/release-prerelease.js +30 -0
- package/dist/lifecycle/release-publish.d.ts +256 -10
- package/dist/lifecycle/release-publish.js +247 -35
- package/dist/lifecycle/release-status-change.d.ts +226 -0
- package/dist/lifecycle/release-status-change.js +478 -0
- package/dist/lifecycle/release-status.d.ts +11 -0
- package/dist/lifecycle/release-status.js +1 -1
- package/dist/lifecycle/release-store.d.ts +73 -2
- package/dist/lifecycle/release-store.js +32 -1
- package/dist/lifecycle/release-tag.d.ts +142 -0
- package/dist/lifecycle/release-tag.js +322 -0
- package/dist/lifecycle/release-verify.d.ts +73 -1
- package/dist/lifecycle/release-verify.js +117 -2
- package/dist/lifecycle/release-version-formats.d.ts +73 -0
- package/dist/lifecycle/release-version-formats.js +570 -0
- package/dist/lifecycle/release-version.d.ts +58 -10
- package/dist/lifecycle/release-version.js +164 -36
- package/dist/lifecycle/release-workstation.d.ts +3 -2
- package/dist/lifecycle/release-workstation.js +3 -2
- package/dist/op/generate-pipeline.js +1 -1
- package/dist/op/local-executor.d.ts +1 -1
- package/dist/op/local-executor.js +2 -2
- package/dist/op/op-waves-evidence.js +9 -2
- package/dist/pr-forge-base.js +4 -2
- package/dist/pr-forge.d.ts +20 -2
- package/dist/pr-forge.js +46 -10
- package/dist/release-floors.d.ts +8 -1
- package/dist/release-floors.js +9 -2
- package/dist/sensitive-key.d.ts +12 -0
- package/dist/sensitive-key.js +52 -0
- package/dist/tool-pins.d.ts +40 -0
- package/dist/tool-pins.js +66 -0
- package/dist/ts-loader.d.ts +8 -0
- package/dist/ts-loader.js +19 -0
- package/dist/wave-runtime.mjs +345 -342
- package/dist/workspace/ci-forge.d.ts +17 -0
- package/dist/workspace/ci-forge.js +17 -0
- package/dist/workspace/ci-init.js +1 -1
- package/dist/workspace/composites.schema.json +1 -0
- package/dist/workspace/declaration.d.ts +8 -0
- package/dist/workspace/declaration.js +12 -0
- package/dist/workspace/declaration.schema.json +8 -0
- package/dist/workspace/environments.d.ts +2 -0
- package/dist/workspace/environments.js +1 -1
- package/dist/workspace/identity-gate-rule.d.ts +61 -5
- package/dist/workspace/identity-gate-rule.js +81 -12
- package/dist/workspace/lexicon-outputs.d.ts +1 -1
- package/dist/workspace/lexicon-outputs.js +1 -1
- package/dist/workspace/member-pipeline.d.ts +2 -1
- package/dist/workspace/member-pipeline.js +5 -2
- package/dist/workspace/reason-codes.d.ts +2 -0
- package/dist/workspace/reason-codes.js +3 -1
- package/dist/workspace/release-changed.d.ts +75 -4
- package/dist/workspace/release-changed.js +205 -34
- package/dist/workspace/release-changed.schema.json +20 -2
- package/dist/workspace/release-steps/artifacts.d.ts +7 -0
- package/dist/workspace/release-steps/artifacts.js +45 -0
- package/dist/workspace/release-steps/builds.d.ts +12 -0
- package/dist/workspace/release-steps/builds.js +38 -0
- package/dist/workspace/release-steps/doctor.d.ts +8 -0
- package/dist/workspace/release-steps/doctor.js +14 -0
- package/dist/workspace/release-steps/goreleaser.d.ts +16 -0
- package/dist/workspace/release-steps/goreleaser.js +36 -0
- package/dist/workspace/release-steps/green.d.ts +3 -0
- package/dist/workspace/release-steps/green.js +6 -0
- package/dist/workspace/release-steps/images.d.ts +22 -0
- package/dist/workspace/release-steps/images.js +59 -0
- package/dist/workspace/release-steps/index.d.ts +9 -0
- package/dist/workspace/release-steps/index.js +50 -0
- package/dist/workspace/release-steps/nfpm.d.ts +13 -0
- package/dist/workspace/release-steps/nfpm.js +29 -0
- package/dist/workspace/release-steps/nuget.d.ts +14 -0
- package/dist/workspace/release-steps/nuget.js +16 -0
- package/dist/workspace/release-steps/pypi.d.ts +15 -0
- package/dist/workspace/release-steps/pypi.js +21 -0
- package/dist/workspace/release-steps/qemu.d.ts +21 -0
- package/dist/workspace/release-steps/qemu.js +35 -0
- package/dist/workspace/release-steps/signing.d.ts +18 -0
- package/dist/workspace/release-steps/signing.js +30 -0
- package/dist/workspace/release-steps/stamp.d.ts +3 -0
- package/dist/workspace/release-steps/stamp.js +4 -0
- package/dist/workspace/release-steps/targets.d.ts +31 -0
- package/dist/workspace/release-steps/targets.js +40 -0
- package/dist/workspace/release-steps/types.d.ts +104 -0
- package/dist/workspace/release-steps/types.js +2 -0
- package/dist/workspace/release-steps/verify.d.ts +3 -0
- package/dist/workspace/release-steps/verify.js +4 -0
- package/dist/workspace/release-toolchains.d.ts +59 -0
- package/dist/workspace/release-toolchains.js +133 -0
- package/dist/workspace/release-train-workflow.d.ts +36 -0
- package/dist/workspace/release-train-workflow.js +121 -0
- package/dist/workspace/release-train.d.ts +3 -1
- package/dist/workspace/release-train.js +20 -3
- package/dist/workspace/release-workflow.d.ts +183 -59
- package/dist/workspace/release-workflow.js +570 -201
- package/dist/workspace/releases.schema.json +70 -1
- package/dist/workspace/search-contract.d.ts +1 -1
- package/dist/workspace/security.js +9 -2
- package/dist/workspace/train-cut.d.ts +182 -0
- package/dist/workspace/train-cut.js +504 -0
- package/dist/workspace/train-prepare.d.ts +64 -0
- package/dist/workspace/train-prepare.js +313 -0
- package/dist/workspace/train-publish.d.ts +177 -0
- package/dist/workspace/train-publish.js +574 -0
- package/dist/workspace/train-range-labels.d.ts +33 -0
- package/dist/workspace/train-range-labels.js +109 -0
- package/dist/workspace/train-shell.d.ts +5 -0
- package/dist/workspace/train-shell.js +17 -0
- package/dist/workspace/trust/check-evidence-report.d.ts +3 -7
- package/dist/workspace/trust/check-evidence-report.js +3 -7
- package/dist/workspace/trust/seal.d.ts +13 -3
- package/dist/workspace/trust/seal.js +14 -4
- package/dist/workspace/work-cli.d.ts +3 -2
- package/dist/workspace/work-cli.js +3 -2
- package/dist/workspace/workspace-ledger.d.ts +14 -1
- package/dist/workspace/workspace-ledger.js +33 -7
- package/package.json +1 -1
package/dist/action-pins.d.ts
CHANGED
|
@@ -41,6 +41,8 @@ export declare const ACTION_PINS: {
|
|
|
41
41
|
readonly downloadArtifact8: ActionPin;
|
|
42
42
|
readonly setupGo7: ActionPin;
|
|
43
43
|
readonly setupPython7: ActionPin;
|
|
44
|
+
readonly setupJava6: ActionPin;
|
|
45
|
+
readonly setupRustToolchain2: ActionPin;
|
|
44
46
|
readonly setupBun2: ActionPin;
|
|
45
47
|
readonly golangciLint9: ActionPin;
|
|
46
48
|
readonly dockerLogin4: ActionPin;
|
package/dist/action-pins.js
CHANGED
|
@@ -33,6 +33,9 @@ export const ACTION_PINS = {
|
|
|
33
33
|
downloadArtifact8: pin("actions/download-artifact", "v8", "9000827ccba6bdab643e8b6fd33ac0654aef8333", "v8.0.2"),
|
|
34
34
|
setupGo7: pin("actions/setup-go", "v7", "b7ad1dad31e06c5925ef5d2fc7ad053ef454303e", "v7.0.0"),
|
|
35
35
|
setupPython7: pin("actions/setup-python", "v7", "6d4fd22b20465ccc0f7354476588e8df7c9ca0e0", "v7.1.0"),
|
|
36
|
+
// #5152: the release workflow's Java and Rust toolchains.
|
|
37
|
+
setupJava6: pin("actions/setup-java", "v6", "d1374f8ac74474200d16ef8ecee22c7ae7a51880", "v6.3.0"),
|
|
38
|
+
setupRustToolchain2: pin("actions-rust-lang/setup-rust-toolchain", "v2", "a188e68d0fd2bd36ad51dccb2b07ba6e75105f30", "v2.0.1"),
|
|
36
39
|
setupBun2: pin("oven-sh/setup-bun", "v2", "0c5077e51419868618aeaa5fe8019c62421857d6", "v2.2.0"),
|
|
37
40
|
golangciLint9: pin("golangci/golangci-lint-action", "v9", "ba0d7d2ec06a0ea1cb5fa41b2e4a3ab91d21278a", "v9.3.0"),
|
|
38
41
|
dockerLogin4: pin("docker/login-action", "v4", "81c6f93d4bc991e510b342a00b419b3bb4efc5c6", "v4.7.0"),
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The CI system a job runs on, read from its environment (#5170). Kept out
|
|
3
|
+
* of ./pr-forge.ts, whose bundle a product posts with, and out of
|
|
4
|
+
* ./ci-system.ts, which chant.config.ts's loader reads.
|
|
5
|
+
*/
|
|
6
|
+
import type { CiSystem } from "./ci-system.js";
|
|
7
|
+
/**
|
|
8
|
+
* The CI system a job runs on, or undefined outside a job chant knows. A
|
|
9
|
+
* Prow job is told by `PROW_JOB_ID`, which Prow's pod utilities set in every
|
|
10
|
+
* job's pod. Every other job runs on its forge's own CI, as `detectForge`
|
|
11
|
+
* reads it.
|
|
12
|
+
*/
|
|
13
|
+
export declare function detectCi(env?: Record<string, string | undefined>): CiSystem | undefined;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { detectForge } from "./pr-forge.js";
|
|
2
|
+
/**
|
|
3
|
+
* The CI system a job runs on, or undefined outside a job chant knows. A
|
|
4
|
+
* Prow job is told by `PROW_JOB_ID`, which Prow's pod utilities set in every
|
|
5
|
+
* job's pod. Every other job runs on its forge's own CI, as `detectForge`
|
|
6
|
+
* reads it.
|
|
7
|
+
*/
|
|
8
|
+
export function detectCi(env = process.env) {
|
|
9
|
+
if (env.PROW_JOB_ID?.trim())
|
|
10
|
+
return "prow";
|
|
11
|
+
return detectForge(env);
|
|
12
|
+
}
|
|
@@ -28,6 +28,18 @@ export declare const EVIDENCE_SOURCES_ENV = "CHANT_EVIDENCE_SOURCES";
|
|
|
28
28
|
* did (#4870). See ./op/op-waves-evidence.ts.
|
|
29
29
|
*/
|
|
30
30
|
export declare const WAVE_EVIDENCE_ENV = "CHANT_WAVE_EVIDENCE";
|
|
31
|
+
/**
|
|
32
|
+
* The variable a generated job hands the runner key in, as PEM (the same one
|
|
33
|
+
* the tick and `chant ci run` read). Kept here rather than in
|
|
34
|
+
* ./workspace/trust/ so the wave runner can ask whether it signs without
|
|
35
|
+
* loading a workspace module (#5219).
|
|
36
|
+
*/
|
|
37
|
+
export declare const CHECK_EVIDENCE_KEY_ENV = "CHANT_RUNNER_KEY";
|
|
38
|
+
/**
|
|
39
|
+
* The variable a generated job sets to `oidc` when it signs keyless from
|
|
40
|
+
* its OIDC identity (#4869) instead of with a runner key.
|
|
41
|
+
*/
|
|
42
|
+
export declare const RUNNER_IDENTITY_ENV = "CHANT_RUNNER_IDENTITY";
|
|
31
43
|
/** Where one check's pass is read from (#4926). */
|
|
32
44
|
export interface EvidenceSourceSpec {
|
|
33
45
|
/** The job's name in the run. Default: `--from-job`'s. */
|
|
@@ -30,6 +30,18 @@ export const EVIDENCE_SOURCES_ENV = "CHANT_EVIDENCE_SOURCES";
|
|
|
30
30
|
* did (#4870). See ./op/op-waves-evidence.ts.
|
|
31
31
|
*/
|
|
32
32
|
export const WAVE_EVIDENCE_ENV = "CHANT_WAVE_EVIDENCE";
|
|
33
|
+
/**
|
|
34
|
+
* The variable a generated job hands the runner key in, as PEM (the same one
|
|
35
|
+
* the tick and `chant ci run` read). Kept here rather than in
|
|
36
|
+
* ./workspace/trust/ so the wave runner can ask whether it signs without
|
|
37
|
+
* loading a workspace module (#5219).
|
|
38
|
+
*/
|
|
39
|
+
export const CHECK_EVIDENCE_KEY_ENV = "CHANT_RUNNER_KEY";
|
|
40
|
+
/**
|
|
41
|
+
* The variable a generated job sets to `oidc` when it signs keyless from
|
|
42
|
+
* its OIDC identity (#4869) instead of with a runner key.
|
|
43
|
+
*/
|
|
44
|
+
export const RUNNER_IDENTITY_ENV = "CHANT_RUNNER_IDENTITY";
|
|
33
45
|
/** The file name a check's claim is kept under: `plan:dev` is `plan-dev.json`. */
|
|
34
46
|
export function checkClaimFileName(check) {
|
|
35
47
|
return `${check.replace(/[^A-Za-z0-9._-]/g, "-")}.json`;
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The CI system apart from the forge (#5170).
|
|
3
|
+
*
|
|
4
|
+
* The forge is where pull requests, comments and commit statuses live, and
|
|
5
|
+
* whose REST API chant reads and writes with the forge's token. The CI system
|
|
6
|
+
* is what runs the jobs and reads the pipeline files chant writes. Until
|
|
7
|
+
* #5170 one `ForgeKind` named both, so `github` meant GitHub with GitHub
|
|
8
|
+
* Actions. It still does: each forge's CI system defaults to the forge's own,
|
|
9
|
+
* so a config that names only the forge builds what it always built.
|
|
10
|
+
*
|
|
11
|
+
* A CI system's value is the name of the lexicon that writes its pipeline
|
|
12
|
+
* files, the one `chant build --components --generate <name>` takes:
|
|
13
|
+
* `github` (GitHub Actions), `gitlab` (GitLab CI), `forgejo` (Forgejo
|
|
14
|
+
* Actions) and `prow` (Prow, whose jobs the prow lexicon declares and generates). Prow runs
|
|
15
|
+
* jobs for GitHub repositories, so `prow` pairs with the `github` forge only.
|
|
16
|
+
*
|
|
17
|
+
* Code that reads the forge's API takes the forge (`ForgeKind`, ./pr-forge.ts).
|
|
18
|
+
* Code that writes pipeline files, or reads a job's environment, takes the CI
|
|
19
|
+
* system. `detectCi` in ./ci-detect.ts reads it from a job's environment. This
|
|
20
|
+
* module imports nothing at run time, so chant.config.ts's loader can read it.
|
|
21
|
+
*/
|
|
22
|
+
import type { ForgeKind } from "./pr-forge.js";
|
|
23
|
+
/** What runs the jobs: the name of the lexicon that writes its pipeline files. */
|
|
24
|
+
export type CiSystem = "github" | "gitlab" | "forgejo" | "prow";
|
|
25
|
+
/** Every CI system chant writes pipelines for, the defaults first. */
|
|
26
|
+
export declare const CI_SYSTEMS: readonly CiSystem[];
|
|
27
|
+
/** The forges each CI system runs jobs for. */
|
|
28
|
+
export declare const CI_SYSTEM_FORGES: Readonly<Record<CiSystem, readonly ForgeKind[]>>;
|
|
29
|
+
/** The first chant with `@intentius/chant/ci-system`, `ci.forge` and `ci.system` in the workspace declaration, an environment executor's `ci`, forge reads from a Prow job's environment (#5170), and `--generate prow` with `--repo` for `chant build --components` and `chant run` (#5189). Products feature-detect on it. */
|
|
30
|
+
export declare const FORGE_CI_FLOOR = "0.124.101";
|
|
31
|
+
/** A forge and the CI system that runs its jobs. */
|
|
32
|
+
export interface ForgeCi {
|
|
33
|
+
forge: ForgeKind;
|
|
34
|
+
ci: CiSystem;
|
|
35
|
+
}
|
|
36
|
+
/** Whether `value` names a CI system. */
|
|
37
|
+
export declare function isCiSystem(value: unknown): value is CiSystem;
|
|
38
|
+
/** The CI system a forge runs when nothing names another: its own, so `github` is GitHub Actions. */
|
|
39
|
+
export declare function defaultCiOf(forge: ForgeKind): CiSystem;
|
|
40
|
+
/** The forge a CI system serves when nothing names one: `prow` serves GitHub, and the others serve their own forge. */
|
|
41
|
+
export declare function defaultForgeOf(ci: CiSystem): ForgeKind;
|
|
42
|
+
/** Why `ci` cannot run the jobs of a repository on `forge`, or undefined when it can. */
|
|
43
|
+
export declare function forgeCiProblem(forge: ForgeKind, ci: CiSystem): string | undefined;
|
|
44
|
+
/** Thrown by {@link resolveForgeCi} for a CI system that cannot serve the forge. */
|
|
45
|
+
export declare class ForgeCiError extends Error {
|
|
46
|
+
readonly forge: ForgeKind;
|
|
47
|
+
readonly ci: CiSystem;
|
|
48
|
+
constructor(forge: ForgeKind, ci: CiSystem, message: string);
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* The forge and its CI system, with the CI system defaulting to the forge's
|
|
52
|
+
* own. Throws {@link ForgeCiError} for a pair that cannot run, such as
|
|
53
|
+
* `forge: gitlab` with `ci: prow`.
|
|
54
|
+
*/
|
|
55
|
+
export declare function resolveForgeCi(input: {
|
|
56
|
+
forge: ForgeKind;
|
|
57
|
+
ci?: CiSystem;
|
|
58
|
+
}): ForgeCi;
|
|
59
|
+
/**
|
|
60
|
+
* The lexicon that writes `ci`'s pipeline files, by the name
|
|
61
|
+
* `chant build --components --generate` and the lexicon plugins use. The
|
|
62
|
+
* forge lexicons' generators write GitHub Actions, GitLab CI and Forgejo
|
|
63
|
+
* Actions files. For `prow` it is the prow lexicon, whose generator writes a
|
|
64
|
+
* Prow job config keyed by the forge's `owner/name` (#5189).
|
|
65
|
+
*/
|
|
66
|
+
export declare function pipelineLexiconOf(ci: CiSystem): string;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/** Every CI system chant writes pipelines for, the defaults first. */
|
|
2
|
+
export const CI_SYSTEMS = ["github", "gitlab", "forgejo", "prow"];
|
|
3
|
+
/** The forges each CI system runs jobs for. */
|
|
4
|
+
export const CI_SYSTEM_FORGES = {
|
|
5
|
+
github: ["github"],
|
|
6
|
+
gitlab: ["gitlab"],
|
|
7
|
+
forgejo: ["forgejo"],
|
|
8
|
+
prow: ["github"],
|
|
9
|
+
};
|
|
10
|
+
/** The first chant with `@intentius/chant/ci-system`, `ci.forge` and `ci.system` in the workspace declaration, an environment executor's `ci`, forge reads from a Prow job's environment (#5170), and `--generate prow` with `--repo` for `chant build --components` and `chant run` (#5189). Products feature-detect on it. */
|
|
11
|
+
export const FORGE_CI_FLOOR = "0.124.101";
|
|
12
|
+
/** Whether `value` names a CI system. */
|
|
13
|
+
export function isCiSystem(value) {
|
|
14
|
+
return typeof value === "string" && CI_SYSTEMS.includes(value);
|
|
15
|
+
}
|
|
16
|
+
/** The CI system a forge runs when nothing names another: its own, so `github` is GitHub Actions. */
|
|
17
|
+
export function defaultCiOf(forge) {
|
|
18
|
+
return forge;
|
|
19
|
+
}
|
|
20
|
+
/** The forge a CI system serves when nothing names one: `prow` serves GitHub, and the others serve their own forge. */
|
|
21
|
+
export function defaultForgeOf(ci) {
|
|
22
|
+
return CI_SYSTEM_FORGES[ci][0];
|
|
23
|
+
}
|
|
24
|
+
/** Why `ci` cannot run the jobs of a repository on `forge`, or undefined when it can. */
|
|
25
|
+
export function forgeCiProblem(forge, ci) {
|
|
26
|
+
const forges = CI_SYSTEM_FORGES[ci];
|
|
27
|
+
if (forges.includes(forge))
|
|
28
|
+
return undefined;
|
|
29
|
+
return `ci: ${ci} runs jobs for a repository on ${forges.join(" or ")}, and this forge is ${forge}`;
|
|
30
|
+
}
|
|
31
|
+
/** Thrown by {@link resolveForgeCi} for a CI system that cannot serve the forge. */
|
|
32
|
+
export class ForgeCiError extends Error {
|
|
33
|
+
constructor(forge, ci, message) {
|
|
34
|
+
super(message);
|
|
35
|
+
this.forge = forge;
|
|
36
|
+
this.ci = ci;
|
|
37
|
+
this.name = "ForgeCiError";
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* The forge and its CI system, with the CI system defaulting to the forge's
|
|
42
|
+
* own. Throws {@link ForgeCiError} for a pair that cannot run, such as
|
|
43
|
+
* `forge: gitlab` with `ci: prow`.
|
|
44
|
+
*/
|
|
45
|
+
export function resolveForgeCi(input) {
|
|
46
|
+
const ci = input.ci ?? defaultCiOf(input.forge);
|
|
47
|
+
const problem = forgeCiProblem(input.forge, ci);
|
|
48
|
+
if (problem)
|
|
49
|
+
throw new ForgeCiError(input.forge, ci, problem);
|
|
50
|
+
return { forge: input.forge, ci };
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* The lexicon that writes `ci`'s pipeline files, by the name
|
|
54
|
+
* `chant build --components --generate` and the lexicon plugins use. The
|
|
55
|
+
* forge lexicons' generators write GitHub Actions, GitLab CI and Forgejo
|
|
56
|
+
* Actions files. For `prow` it is the prow lexicon, whose generator writes a
|
|
57
|
+
* Prow job config keyed by the forge's `owner/name` (#5189).
|
|
58
|
+
*/
|
|
59
|
+
export function pipelineLexiconOf(ci) {
|
|
60
|
+
return ci;
|
|
61
|
+
}
|
|
@@ -307,6 +307,22 @@ async function runGenerateComponents(ctx) {
|
|
|
307
307
|
// workspace module loads only when a declaration was found, so a project
|
|
308
308
|
// outside any workspace generates exactly what it did before.
|
|
309
309
|
const found = findWorkspaceRoot(resolve(args.path));
|
|
310
|
+
// #5170: the declaration's ci.system names the CI system whose files this build may write. Read only inside a workspace.
|
|
311
|
+
if (found) {
|
|
312
|
+
const { ciForgeAt, generateTargetProblem } = await import("../../workspace/ci-forge.js");
|
|
313
|
+
let declared = null;
|
|
314
|
+
try {
|
|
315
|
+
declared = ciForgeAt(resolve(args.path));
|
|
316
|
+
}
|
|
317
|
+
catch {
|
|
318
|
+
// A declaration that does not read is reported by the member pipeline below.
|
|
319
|
+
}
|
|
320
|
+
const problem = generateTargetProblem(lexicon, declared);
|
|
321
|
+
if (problem) {
|
|
322
|
+
console.error(formatError({ message: problem }));
|
|
323
|
+
return 1;
|
|
324
|
+
}
|
|
325
|
+
}
|
|
310
326
|
let plan;
|
|
311
327
|
let memberPipeline;
|
|
312
328
|
// #4160: without --report-url, the declaration's ci.reportUrl. Read only inside a workspace.
|
|
@@ -401,6 +417,16 @@ async function runGenerateComponents(ctx) {
|
|
|
401
417
|
}
|
|
402
418
|
control = resolved.control;
|
|
403
419
|
}
|
|
420
|
+
// #5189: Prow keys the jobs by the GitHub repository's owner/name, from --repo or the origin remote.
|
|
421
|
+
let forgeRepo;
|
|
422
|
+
if (lexicon === "prow") {
|
|
423
|
+
const resolved = (await import("../../forge-remote.js")).prowRepoOf(resolve(args.path), args.ciRepo);
|
|
424
|
+
if ("error" in resolved) {
|
|
425
|
+
console.error(formatError({ message: resolved.error }));
|
|
426
|
+
return 1;
|
|
427
|
+
}
|
|
428
|
+
forgeRepo = resolved.repo;
|
|
429
|
+
}
|
|
404
430
|
// Which lexicons support generate mode is a property of the loaded lexicon
|
|
405
431
|
// plugins (those implementing `generateComponentPipeline`, #688), not a
|
|
406
432
|
// hard-coded core list — `generateComponentsPipeline` returns a descriptive
|
|
@@ -425,6 +451,7 @@ async function runGenerateComponents(ctx) {
|
|
|
425
451
|
...(args.beforeScript?.length ? { beforeScript: args.beforeScript } : {}),
|
|
426
452
|
// #4771: a workflow-level run group, which Forgejo's generator writes.
|
|
427
453
|
...(args.runGroup ? { runGroup: args.runGroup } : {}),
|
|
454
|
+
...(forgeRepo ? { forgeRepo } : {}),
|
|
428
455
|
}, args.sandbox, paramsResolution.provenance);
|
|
429
456
|
if (!result.success) {
|
|
430
457
|
console.error(formatError({ message: result.error ?? "Failed to generate CI pipeline from components" }));
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `chant release doctor [--json]` (#5161): before a cut, ask each target
|
|
3
|
+
* `release.publish` declares whether publishing from this environment can
|
|
4
|
+
* succeed. See ../../lifecycle/release-doctor.ts for the checks.
|
|
5
|
+
*
|
|
6
|
+
* Exits 1 when any check fails, and 0 otherwise, including when a check
|
|
7
|
+
* can't tell from here.
|
|
8
|
+
*/
|
|
9
|
+
import type { CommandContext } from "../registry.js";
|
|
10
|
+
import type { DoctorReport } from "../../lifecycle/release-doctor.js";
|
|
11
|
+
export declare function formatDoctorReport(report: DoctorReport): string[];
|
|
12
|
+
export declare function runReleaseDoctor(ctx: CommandContext): Promise<number>;
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `chant release doctor [--json]` (#5161): before a cut, ask each target
|
|
3
|
+
* `release.publish` declares whether publishing from this environment can
|
|
4
|
+
* succeed. See ../../lifecycle/release-doctor.ts for the checks.
|
|
5
|
+
*
|
|
6
|
+
* Exits 1 when any check fails, and 0 otherwise, including when a check
|
|
7
|
+
* can't tell from here.
|
|
8
|
+
*/
|
|
9
|
+
import { existsSync, realpathSync } from "node:fs";
|
|
10
|
+
import { join, resolve } from "node:path";
|
|
11
|
+
import { formatBold, formatError, formatSuccess } from "../format.js";
|
|
12
|
+
const USAGE = "chant release doctor [--json]";
|
|
13
|
+
/** The release workflow file from the repository root: `release.workflow.file` in the workspace root's config, or the forge's default. */
|
|
14
|
+
async function releaseWorkflowFile(cwd) {
|
|
15
|
+
const { findWorkspaceRoot } = await import("../../project-root.js");
|
|
16
|
+
const { gitTop } = await import("../../workspace/tree.js");
|
|
17
|
+
const { RELEASE_WORKFLOW_FILES } = await import("../../workspace/release-workflow.js");
|
|
18
|
+
const root = realpathSync(findWorkspaceRoot(cwd)?.dir ?? cwd);
|
|
19
|
+
const repoRoot = gitTop(root) ?? root;
|
|
20
|
+
let file;
|
|
21
|
+
try {
|
|
22
|
+
const { loadChantConfig } = await import("../../config.js");
|
|
23
|
+
file = (await loadChantConfig(root)).config.release?.workflow?.file;
|
|
24
|
+
}
|
|
25
|
+
catch {
|
|
26
|
+
file = undefined;
|
|
27
|
+
}
|
|
28
|
+
if (file)
|
|
29
|
+
return file;
|
|
30
|
+
const forge = existsSync(join(repoRoot, ".github", "workflows")) ? "github" : existsSync(join(repoRoot, ".forgejo", "workflows")) ? "forgejo" : existsSync(join(repoRoot, ".gitlab-ci.yml")) ? "gitlab" : "github";
|
|
31
|
+
// GitLab's trusted publishers name the top-level pipeline file, which includes chant's.
|
|
32
|
+
return forge === "gitlab" ? ".gitlab-ci.yml" : RELEASE_WORKFLOW_FILES[forge];
|
|
33
|
+
}
|
|
34
|
+
/** The green gate the cut would check (#5149), resolved as the cut resolves it. */
|
|
35
|
+
async function greenGate(cwd, declared) {
|
|
36
|
+
const { resolveGreenSource } = await import("../../lifecycle/release-green.js");
|
|
37
|
+
if (declared !== undefined)
|
|
38
|
+
return declared;
|
|
39
|
+
const { scopeSource } = await import("../../workspace/write-scope.js");
|
|
40
|
+
const { execFileSync } = await import("node:child_process");
|
|
41
|
+
let ciGreen = false;
|
|
42
|
+
try {
|
|
43
|
+
ciGreen = (scopeSource(cwd).declaration?.ci?.green ?? null) !== null;
|
|
44
|
+
}
|
|
45
|
+
catch {
|
|
46
|
+
ciGreen = false;
|
|
47
|
+
}
|
|
48
|
+
let tags = "";
|
|
49
|
+
try {
|
|
50
|
+
tags = execFileSync("git", ["tag", "--list", "ci/green/*", "ci/green-*/*"], { cwd, encoding: "utf-8", stdio: ["ignore", "pipe", "ignore"] }).trim();
|
|
51
|
+
}
|
|
52
|
+
catch {
|
|
53
|
+
tags = "";
|
|
54
|
+
}
|
|
55
|
+
return resolveGreenSource(undefined, ciGreen, tags !== "");
|
|
56
|
+
}
|
|
57
|
+
const MARK = { ok: "ok ", warn: "warn ", fail: "FAIL ", unknown: "can't tell" };
|
|
58
|
+
export function formatDoctorReport(report) {
|
|
59
|
+
const e = report.environment;
|
|
60
|
+
const where = e.ci === "github" ? `GitHub Actions${e.workflow ? `, ${e.workflow}` : ""}` : e.ci === "gitlab" ? "GitLab CI" : e.ci === "other" ? "CI" : "a workstation";
|
|
61
|
+
const lines = [
|
|
62
|
+
`Release doctor, from ${where}: OIDC ${e.oidc ? "yes" : "no"}; the release workflow is ${e.releaseWorkflow ?? "not known"}${e.repository ? ` in ${e.repository}` : ""}`,
|
|
63
|
+
];
|
|
64
|
+
for (const t of report.targets) {
|
|
65
|
+
lines.push(formatBold(t.name));
|
|
66
|
+
for (const c of t.checks) {
|
|
67
|
+
lines.push(` ${MARK[c.status]} ${c.check}: ${c.message}`);
|
|
68
|
+
if (c.fix && c.status !== "ok")
|
|
69
|
+
lines.push(` fix: ${c.fix}`);
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
const n = report.counts;
|
|
73
|
+
lines.push(`${n.ok} ok, ${n.warn} warning(s), ${n.fail} failed, ${n.unknown} can't be observed from here`);
|
|
74
|
+
return lines;
|
|
75
|
+
}
|
|
76
|
+
export async function runReleaseDoctor(ctx) {
|
|
77
|
+
const { args } = ctx;
|
|
78
|
+
const cwd = resolve(".");
|
|
79
|
+
let publish;
|
|
80
|
+
let declaredGreen;
|
|
81
|
+
let signing;
|
|
82
|
+
try {
|
|
83
|
+
const { loadChantConfig } = await import("../../config.js");
|
|
84
|
+
const release = (await loadChantConfig(cwd)).config.release;
|
|
85
|
+
publish = release?.publish ?? [];
|
|
86
|
+
declaredGreen = release?.green;
|
|
87
|
+
signing = release?.signing;
|
|
88
|
+
}
|
|
89
|
+
catch (err) {
|
|
90
|
+
console.error(formatError({ message: `release.publish in chant.config.ts could not be read: ${err instanceof Error ? err.message : String(err)} [doctor-config-invalid]`, hint: USAGE }));
|
|
91
|
+
return 1;
|
|
92
|
+
}
|
|
93
|
+
const { releaseDoctor } = await import("../../lifecycle/release-doctor.js");
|
|
94
|
+
// #5164: the security groups decide whether the publish signs, as they do for the publish.
|
|
95
|
+
let groups = new Set();
|
|
96
|
+
try {
|
|
97
|
+
const { scopeSource } = await import("../../workspace/write-scope.js");
|
|
98
|
+
const { securityGroupsIn } = await import("../../workspace/security.js");
|
|
99
|
+
groups = securityGroupsIn(scopeSource(cwd), cwd);
|
|
100
|
+
}
|
|
101
|
+
catch {
|
|
102
|
+
groups = new Set();
|
|
103
|
+
}
|
|
104
|
+
const report = await releaseDoctor({ cwd, publish, releaseWorkflow: await releaseWorkflowFile(cwd), green: await greenGate(cwd, declaredGreen), ...(signing !== undefined ? { signing } : {}), groups });
|
|
105
|
+
if (args.json) {
|
|
106
|
+
console.log(JSON.stringify(report, null, 2));
|
|
107
|
+
}
|
|
108
|
+
else if (report.targets.length === 0) {
|
|
109
|
+
console.log("Nothing to check: this member declares no publish target (release.publish in chant.config.ts).");
|
|
110
|
+
}
|
|
111
|
+
else {
|
|
112
|
+
for (const line of formatDoctorReport(report))
|
|
113
|
+
console.log(line);
|
|
114
|
+
if (report.counts.fail === 0)
|
|
115
|
+
console.log(formatSuccess("No check failed."));
|
|
116
|
+
}
|
|
117
|
+
return report.counts.fail > 0 ? 1 : 0;
|
|
118
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `chant release init [--yes] [--force] [--one-release] [--forge github|gitlab|forgejo] [--json]`
|
|
3
|
+
* (#5160): set up `chant release` in a project that has never used chant. A
|
|
4
|
+
* dry run unless `--yes`. An npm, pnpm or yarn workspace with several
|
|
5
|
+
* publishable packages gets a release train (#5154): a member per package
|
|
6
|
+
* and `release.train` at the root, unless `--one-release`. See
|
|
7
|
+
* ../../lifecycle/release-init.ts.
|
|
8
|
+
*/
|
|
9
|
+
import type { CommandContext } from "../registry.js";
|
|
10
|
+
export declare function runReleaseInit(ctx: CommandContext): Promise<number>;
|