@kungfu-tech/buildchain 4.1.0-alpha.0 → 4.1.0-alpha.2
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/AGENTS.md +30 -41
- package/CONTRIBUTING.md +6 -7
- package/architecture/action-taxonomy.json +5 -21
- package/architecture/agent-change-map.md +74 -56
- package/architecture/build-orchestration.json +8 -1
- package/architecture/ci-lane-change-budget.json +179 -69
- package/architecture/floating-consumer-policy.json +7 -17
- package/architecture/internal-capabilities.json +58 -72
- package/architecture/maintainability-debt.json +138 -52
- package/architecture/maintainability-policy.json +6 -15
- package/architecture/promotion-job-topology.json +39 -20
- package/architecture/release-topology.json +26 -37
- package/architecture/runtime-entry.json +26 -0
- package/architecture/runtime-resume-lineage.json +23 -0
- package/architecture/stage-capsule-qualification.json +2 -2
- package/architecture/universal-workflow-bootstrap.json +10 -25
- package/architecture/universal-workflow-capability-policy.json +61 -0
- package/architecture/universal-workflow-fault-campaign.json +18 -24
- package/architecture/workflow-taxonomy.json +0 -11
- package/contracts/fixtures/{v4-runtime-ref-resume-authority-v1 → runtime-resume-lineage-v2}/scenario.json +2 -3
- package/contracts/fixtures/v4-floating-consumer-policy-v1/cases.json +2 -2
- package/contracts/fixtures/v4-tail-reseal-v1/valid.json +1 -1
- package/contracts/promotion-invocation-v1.schema.json +0 -44
- package/contracts/promotion-request-v1.schema.json +0 -39
- package/contracts/runtime-resume-lineage-v2.schema.json +182 -0
- package/dist/site/buildchain-contract.json +472 -361
- package/dist/site/buildchain-site.json +99 -99
- package/dist/site/capability-registry.json +3 -3
- package/dist/site/cli-registry.json +4 -4
- package/dist/site/controller-registry.json +94 -78
- package/dist/site/kfd-claims.json +224 -343
- package/dist/site/kfd-upstream-aggregate.json +1 -1
- package/dist/site/manual-registry.json +15 -15
- package/dist/site/node-api-registry.json +239 -354
- package/dist/site/page-registry.json +80 -80
- package/dist/site/public-surface-audit.json +203 -254
- package/dist/site/publication-authority-registry.json +1 -24
- package/dist/site/publication-registry.json +4 -4
- package/dist/site/release-provenance.json +1 -1
- package/dist/site/site-manifest.json +19 -19
- package/dist/site/workflow-registry.json +197 -357
- package/docs/MAP.md +3 -3
- package/docs/auditable-demo.md +4 -4
- package/docs/cli-reference.md +2 -2
- package/docs/code-organization.md +5 -4
- package/docs/controller-evidence.md +2 -2
- package/docs/dev-alpha-candidate-patrol.md +5 -5
- package/docs/dev-delivery-warrant.md +14 -24
- package/docs/engineering-housekeeper.md +3 -3
- package/docs/github-artifact-attestation.md +9 -12
- package/docs/github-governance-authority.md +4 -4
- package/docs/node-api-reference.md +153 -167
- package/docs/publication-artifacts.md +3 -4
- package/docs/publication-authority.md +2 -2
- package/docs/release-candidate.md +21 -27
- package/docs/release-governance.md +10 -10
- package/docs/release-promotion-request.md +11 -18
- package/docs/release-propagation.md +5 -6
- package/docs/release-tail-provider-plane.md +2 -3
- package/docs/reusable-build-surface.md +13 -7
- package/docs/runtime-entry.md +122 -0
- package/docs/runtime-train-validation.md +30 -41
- package/docs/v4-publication-rehearsal.md +5 -5
- package/docs/v4-stage-capsule.md +9 -10
- package/docs/web-surface-deployments.md +16 -20
- package/docs/workflow-catalog.md +0 -1
- package/package.json +6 -6
- package/packages/core/adoption/commands/init-repo.mjs +2 -2
- package/packages/core/adoption/cross-platform-adopter-qualification.js +2 -13
- package/packages/core/adoption/qualification/actions.js +3 -5
- package/packages/core/adoption/qualification/admission.js +2 -3
- package/packages/core/build/artifact/attestation.js +0 -1
- package/packages/core/build/artifact/contracts.js +1 -4
- package/packages/core/build/artifact/store.js +6 -5
- package/packages/core/build/artifact-signing.js +4 -10
- package/packages/core/build/binary/actions.js +15 -9
- package/packages/core/build/binary-publication-dispatch.js +2 -6
- package/packages/core/build/demo/action-context.js +2 -11
- package/packages/core/build/demo/binary-action.js +8 -10
- package/packages/core/build/gate/controller.js +0 -2
- package/packages/core/build/github-attestation/action.js +2 -7
- package/packages/core/build/github-attestation/admission.js +0 -8
- package/packages/core/build/github-attestation/transaction.js +1 -2
- package/packages/core/build/lifecycle/stage-action.js +2 -0
- package/packages/core/build/lifecycle/stage.js +6 -3
- package/packages/core/build/macos-credential-island/dmg-assembly.js +0 -2
- package/packages/core/build/macos-credential-island/lib.js +2 -6
- package/packages/core/build/plan/action-context.js +0 -7
- package/packages/core/build/plan/action.js +7 -11
- package/packages/core/build/plan/admission.js +6 -73
- package/packages/core/build/plan/configuration.js +1 -1
- package/packages/core/build/plan/environment.js +1 -1
- package/packages/core/build/plan/identity.js +1 -5
- package/packages/core/build/plan/resolve.js +7 -1
- package/packages/core/build/recovery/checkpoint.js +158 -0
- package/packages/core/build/recovery/transaction.js +51 -0
- package/packages/core/build/signing/authority-actions.js +2 -11
- package/packages/core/build/signing/control.js +0 -5
- package/packages/core/build/signing/controller-transaction.js +0 -1
- package/packages/core/build/signing/delegation.js +2 -4
- package/packages/core/build/signing/dispatch.js +10 -56
- package/packages/core/build/signing/intake.js +0 -4
- package/packages/core/build/signing/prepare.js +1 -1
- package/packages/core/build/signing/request.js +3 -8
- package/packages/core/build/source/checkout-action.js +6 -10
- package/packages/core/build/source/controller.js +1 -4
- package/packages/core/build/source/lifecycle.js +3 -13
- package/packages/core/build/stage-capsule/actions.js +3 -13
- package/packages/core/build/stage-capsule/campaign/resume.js +10 -5
- package/packages/core/build/stage-capsule/rehearsal/verify.js +3 -4
- package/packages/core/build/stage-capsule-resume-planner.js +0 -1
- package/packages/core/build/summary/aggregation.js +5 -5
- package/packages/core/build/summary/finalization.js +1 -1
- package/packages/core/build/verification/actions.js +3 -12
- package/packages/core/build/verification/runner.js +22 -20
- package/packages/core/consumer/floating-consumer-evidence.js +3 -21
- package/packages/core/consumer/floating-consumer-policy.js +2 -93
- package/packages/core/consumer/floating-consumer-release-passport.js +1 -34
- package/packages/core/consumer/policy-admission.js +1 -3
- package/packages/core/contracts/buildchain-contract.js +12 -146
- package/packages/core/contracts/workflow-yaml-contract.js +11 -1
- package/packages/core/dev-delivery/candidate/admission.js +3 -4
- package/packages/core/dev-delivery/candidate/coordinates.js +0 -8
- package/packages/core/dev-delivery/commands/dev-delivery-request.sh +5 -13
- package/packages/core/dev-delivery/commands/dev-delivery-source-proof-reuse.mjs +0 -3
- package/packages/core/dev-delivery/dev-delivery-contract-surface.js +4 -52
- package/packages/core/dev-delivery/dev-delivery-execution-transfer.js +2 -15
- package/packages/core/dev-delivery/native/action-context.js +4 -32
- package/packages/core/dev-delivery/native/provider-boundary.js +0 -2
- package/packages/core/dev-delivery/native/transactions.js +1 -2
- package/packages/core/dev-delivery/queue/reconciliation-action.js +6 -10
- package/packages/core/dev-delivery/source-proof/predicates.js +0 -6
- package/packages/core/dev-delivery/source-proof/reuse.js +0 -2
- package/packages/core/dev-delivery/source-proof/seal.js +0 -2
- package/packages/core/governance/alpha-candidate/action.js +1 -10
- package/packages/core/governance/audit/actions.js +1 -3
- package/packages/core/governance/audit/collection.js +1 -3
- package/packages/core/governance/audit/identity.js +3 -31
- package/packages/core/governance/audit/transactions.js +2 -4
- package/packages/core/governance/buildchain-publication-authority.js +0 -1
- package/packages/core/governance/commands/audit-github-governance.mjs +3 -2
- package/packages/core/governance/github-governance-authority.js +0 -5
- package/packages/core/governance/receipt-admission.js +0 -15
- package/packages/core/index.js +1 -1
- package/packages/core/observability/controller/identity.js +4 -5
- package/packages/core/observability/controller-evidence.js +5 -10
- package/packages/core/paper/commands/paper.mjs +6 -6
- package/packages/core/paper/operations/plans.js +2 -2
- package/packages/core/paper/operations/provisioning-validation.js +1 -1
- package/packages/core/paper/operations/scaffold-workflows.js +29 -12
- package/packages/core/paper/operations/scaffold.js +97 -69
- package/packages/core/paper/paper-agent-entry.js +0 -11
- package/packages/core/paper/paper-runtime-channels.js +21 -66
- package/packages/core/paper/paper-scaffold-content.js +1 -1
- package/packages/core/paper/paper.js +9 -5
- package/packages/core/paper/publication/candidate.js +0 -9
- package/packages/core/paper/publication-controller.js +2 -4
- package/packages/core/providers/github/artifact-attestation.js +1 -1
- package/packages/core/publication/authority/actions.js +9 -8
- package/packages/core/publication/authority/admission.js +0 -11
- package/packages/core/publication/authority/assembly.js +2 -7
- package/packages/core/publication/authority/control-plane.js +2 -2
- package/packages/core/publication/authority/governance.js +2 -9
- package/packages/core/publication/authority/request.js +7 -2
- package/packages/core/publication/authority/verification.js +3 -18
- package/packages/core/publication/binary/action.js +5 -7
- package/packages/core/publication/candidate/qualification-action.js +1 -6
- package/packages/core/publication/candidate/stage-capsules.js +1 -1
- package/packages/core/publication/npm/preview-action.js +9 -15
- package/packages/core/publication/oci/preview-actions.js +1 -10
- package/packages/core/publication/publication-artifact-candidate.js +2 -2
- package/packages/core/publication/publication-authority.js +2 -2
- package/packages/core/publication/publication-rehearsal-projection.js +3 -3
- package/packages/core/publication/settlement/actions.js +2 -11
- package/packages/core/release/binary/coordinates-action.js +0 -13
- package/packages/core/release/binary/coordinates.js +2 -19
- package/packages/core/release/commands/promotion-channel-router.mjs +12 -56
- package/packages/core/release/commands/resume-from-candidate-run.mjs +2 -3
- package/packages/core/release/dev-alpha-active-release-train.js +0 -5
- package/packages/core/release/line/action.js +2 -13
- package/packages/core/release/next-development/actions.js +2 -5
- package/packages/core/release/passport/consumer-validation.js +1 -28
- package/packages/core/release/promote-candidate/development-source.js +7 -8
- package/packages/core/release/promotion/actions.js +7 -38
- package/packages/core/release/promotion/admission.js +3 -50
- package/packages/core/release/promotion/candidate.js +2 -4
- package/packages/core/release/promotion/channel.js +13 -101
- package/packages/core/release/promotion/qualification-action.js +2 -13
- package/packages/core/release/promotion/routing.js +16 -81
- package/packages/core/release/promotion/selection.js +1 -9
- package/packages/core/release/promotion-request.js +1 -40
- package/packages/core/release/qualification/actions.js +0 -8
- package/packages/core/release/qualification/public-build.js +1 -1
- package/packages/core/release/recovery/candidate.js +15 -21
- package/packages/core/release/recovery/capsules.js +2 -10
- package/packages/core/release/recovery/lineage.js +305 -0
- package/packages/core/release/recovery/provenance.js +1 -2
- package/packages/core/release/recovery/publication.js +4 -14
- package/packages/core/release/recovery/readback.js +19 -32
- package/packages/core/release/recovery/runtime.js +4 -95
- package/packages/core/release/release-candidate-recovery.js +4 -9
- package/packages/core/release/release-candidate.js +2 -5
- package/packages/core/release/reseal/actions.js +3 -22
- package/packages/core/release/reseal/admission.js +0 -2
- package/packages/core/release/reseal/finalize-platform.js +0 -2
- package/packages/core/release/tail-reseal-github.js +1 -2
- package/packages/core/release/tail-reseal-receipt.js +0 -1
- package/packages/core/release/tail-reseal.js +2 -20
- package/packages/core/release/version-state.js +16 -13
- package/packages/core/runtime/buildchain-domain.wasm +0 -0
- package/packages/core/runtime/checkout-identity.js +0 -13
- package/packages/core/runtime/domain-wasm-artifact.js +2 -2
- package/packages/core/runtime/entry/actions.js +121 -0
- package/packages/core/runtime/entry/activation.js +86 -0
- package/packages/core/runtime/entry/github.js +55 -0
- package/packages/core/runtime/entry/recovery.js +37 -0
- package/packages/core/runtime/entry/selection.js +110 -0
- package/packages/core/web/controller.js +1 -1
- package/packages/core/web/publication-admission-action.js +1 -8
- package/packages/core/web/web-surface-publication-candidate.js +2 -5
- package/packages/core/workflow/admission/actions.js +6 -26
- package/packages/core/workflow/admission/recovery.js +3 -43
- package/packages/core/workflow/admission/transactions.js +8 -24
- package/packages/core/workflow/commands/buildchain-cli-help.mjs +1 -1
- package/packages/core/workflow/commands/universal-workflow-engine.mjs +2 -7
- package/packages/core/workflow/dogfood/actions.js +0 -17
- package/packages/core/workflow/engine/action.js +0 -5
- package/packages/core/workflow/engine/conformance.js +1 -1
- package/packages/core/workflow/engine/execution.js +2 -6
- package/packages/core/workflow/engine/identity.js +1 -6
- package/packages/core/workflow/engine/release-environment.js +11 -35
- package/packages/core/workflow/engine/release-promotion.js +2 -2
- package/packages/core/workflow/settlement/actions.js +0 -12
- package/packages/core/workflow/universal-self-dogfood.js +2 -16
- package/packages/core/workflow/universal-workflow-bootstrap.js +16 -241
- package/packages/core/workflow/workflow-taxonomy.mjs +2 -2
- package/scripts/check-dev-delivery-actions.mjs +17 -8
- package/scripts/check-floating-consumer-policy-contract.mjs +6 -6
- package/scripts/check-inventory.mjs +1 -10
- package/scripts/check-public-dogfood-contract.mjs +34 -21
- package/scripts/check-release-topology.mjs +2 -6
- package/scripts/check-runtime-entry.mjs +133 -0
- package/scripts/check-universal-workflow-bootstrap.mjs +45 -281
- package/scripts/check-workflows.sh +0 -7
- package/scripts/generate-bootstrap-admission.mjs +1 -1
- package/scripts/generate-channel-promotion-workflow.mjs +4 -4
- package/scripts/inventory/binary.mjs +4 -4
- package/scripts/inventory/promotion.mjs +5 -3
- package/scripts/runtime-source-boundaries.mjs +70 -0
- package/scripts/site-capability-metadata.mjs +2 -2
- package/scripts/workflow-action-graph.mjs +5 -18
- package/scripts/workflow-self-reference.mjs +20 -0
- package/templates/native-dev-delivery.yml +4 -4
- package/templates/universal-buildchain-bootstrap.yml +12 -2
- package/architecture/runtime-ref-resume-authority.json +0 -64
- package/architecture/universal-workflow-train-admission.json +0 -76
- package/contracts/v4-runtime-ref-resume-authority-v1.schema.json +0 -235
- package/docs/v4-runtime-ref-resume-authority.md +0 -69
- package/packages/core/consumer/channel-selection.js +0 -211
- package/packages/core/consumer/commands/buildchain-channel-router.mjs +0 -81
- package/packages/core/consumer/invocation-selector.js +0 -4
- package/packages/core/consumer/runtime-ref-resume-authority.js +0 -621
- package/packages/core/consumer/workflow-definition-authority.js +0 -64
- package/packages/core/contracts/runtime-contract-action.js +0 -48
- package/packages/core/release/commands/promotion-identity-resolver.mjs +0 -77
- package/packages/core/release/commands/verify-promotion-router-binding.sh +0 -36
- package/packages/core/release/promotion/identities.js +0 -56
- package/packages/core/release/runtime-override-authorization.js +0 -242
- package/packages/core/runtime/commands/runtime-ref-core.mjs +0 -171
- package/packages/core/runtime/provider-closure.js +0 -60
- package/packages/core/runtime/runtime-selection-action.js +0 -34
- package/packages/core/runtime/runtime-selection.js +0 -136
- package/packages/core/runtime/workflow-runtime.js +0 -11
- package/packages/core/workflow/admission/review.js +0 -188
- package/packages/core/workflow/commands/universal-workflow-backflow.mjs +0 -26
- package/packages/core/workflow/installation.js +0 -33
- package/packages/core/workflow/settlement/backflow.js +0 -187
- package/scripts/generate-bootstrap-recovery.mjs +0 -94
- package/templates/bootstrap-recovery/actions/build/source/admit/action.yml +0 -17
- package/templates/bootstrap-recovery/actions/build/source/admit/dist/index.js +0 -63
- package/templates/bootstrap-recovery/actions/runtime/dependencies/install/action.yml +0 -18
- package/templates/bootstrap-recovery/actions/runtime/dependencies/install/dist/index.js +0 -63
- package/templates/bootstrap-recovery/actions/runtime/environment/prepare/action.yml +0 -21
- package/templates/bootstrap-recovery/actions/workflow/admission/inspect/action.yml +0 -27
- package/templates/bootstrap-recovery/actions/workflow/admission/inspect/dist/index.js +0 -64
- package/templates/bootstrap-recovery/actions/workflow/admission/review/action.yml +0 -15
- package/templates/bootstrap-recovery/actions/workflow/admission/review/dist/index.js +0 -65
- package/templates/bootstrap-recovery/actions/workflow/recovery/admit/action.yml +0 -47
- package/templates/bootstrap-recovery/actions/workflow/recovery/execute/action.yml +0 -48
- package/templates/bootstrap-recovery/actions/workflow/recovery/settle/action.yml +0 -54
- package/templates/bootstrap-recovery/actions/workflow/settlement/seal/action.yml +0 -17
- package/templates/bootstrap-recovery/actions/workflow/settlement/seal/dist/index.js +0 -65
- package/templates/bootstrap-recovery/manifest.json +0 -68
- package/templates/bootstrap-recovery/package.json +0 -9
- package/templates/universal-buildchain-bootstrap-recovery.yml +0 -115
|
@@ -12,6 +12,7 @@ const parse = (value) => (value ? JSON.parse(value) : undefined);
|
|
|
12
12
|
function context(core, env) {
|
|
13
13
|
const request = publicationAuthorityRequest(
|
|
14
14
|
JSON.parse(core.getInput("request-json", { required: true })),
|
|
15
|
+
JSON.parse(env.BUILDCHAIN_RUNTIME_SELECTION),
|
|
15
16
|
);
|
|
16
17
|
return {
|
|
17
18
|
request: { ...request, callerRepository: env.GITHUB_REPOSITORY },
|
|
@@ -22,12 +23,16 @@ function context(core, env) {
|
|
|
22
23
|
export function inspectPublicationAuthorityAction(core, env) {
|
|
23
24
|
admitPublicationAuthorityRequest(context(core, env).request);
|
|
24
25
|
}
|
|
25
|
-
export function verifyPublicationGovernanceAction(
|
|
26
|
+
export function verifyPublicationGovernanceAction(
|
|
27
|
+
core,
|
|
28
|
+
env,
|
|
29
|
+
{ verify = verifyLivePublicationGovernance } = {},
|
|
30
|
+
) {
|
|
26
31
|
const { request, workspace, runtimeRoot } = context(core, env);
|
|
27
|
-
return
|
|
32
|
+
return verify({
|
|
28
33
|
repository: request.evidenceRepository || env.GITHUB_REPOSITORY,
|
|
29
34
|
targetRef: request.targetRef,
|
|
30
|
-
runtimeSha: request.
|
|
35
|
+
runtimeSha: request.runtimeSha,
|
|
31
36
|
runtimeRoot,
|
|
32
37
|
outputRoot: path.join(workspace, ".buildchain/publication-authority"),
|
|
33
38
|
token: core.getInput("token", { required: true }),
|
|
@@ -43,11 +48,7 @@ export function locateAuthorityControllerAction(core, env) {
|
|
|
43
48
|
}
|
|
44
49
|
export async function qualifyAuthorityConsumerGateAction(core, env) {
|
|
45
50
|
const { request, workspace, runtimeRoot } = context(core, env);
|
|
46
|
-
|
|
47
|
-
directory: runtimeRoot,
|
|
48
|
-
sha: request.buildchainRef,
|
|
49
|
-
label: "Consumer Gate authority",
|
|
50
|
-
});
|
|
51
|
+
|
|
51
52
|
const subjectRoot = path.join(
|
|
52
53
|
workspace,
|
|
53
54
|
".buildchain/publication-consumer-source",
|
|
@@ -1,11 +1,5 @@
|
|
|
1
1
|
import { requireValue } from "../../runtime/action-process.mjs";
|
|
2
2
|
|
|
3
|
-
export function requireImmutableAuthority(request) {
|
|
4
|
-
requireValue(
|
|
5
|
-
/^[0-9a-f]{40}$/i.test(request.buildchainRef || ""),
|
|
6
|
-
"Publication authority requires an exact 40-character GitHub commit SHA",
|
|
7
|
-
);
|
|
8
|
-
}
|
|
9
3
|
export function requireSealedInputs(request) {
|
|
10
4
|
const names = [
|
|
11
5
|
"admissionJson",
|
|
@@ -21,10 +15,6 @@ export function requireSealedInputs(request) {
|
|
|
21
15
|
);
|
|
22
16
|
}
|
|
23
17
|
export function requireManagedInputs(request) {
|
|
24
|
-
requireValue(
|
|
25
|
-
request.buildchainRepository === "kungfu-systems/buildchain",
|
|
26
|
-
"Automatic publication admission requires the canonical Buildchain authority repository",
|
|
27
|
-
);
|
|
28
18
|
requireValue(
|
|
29
19
|
/^[0-9a-f]{40}$/i.test(request.sourceSha),
|
|
30
20
|
"Automatic publication admission requires an exact source SHA",
|
|
@@ -107,7 +97,6 @@ export function requireManagedInputs(request) {
|
|
|
107
97
|
|
|
108
98
|
export function admitPublicationAuthorityRequest(request) {
|
|
109
99
|
if (request.dryRun) return;
|
|
110
|
-
requireImmutableAuthority(request);
|
|
111
100
|
if (request.autoAdmission) requireManagedInputs(request);
|
|
112
101
|
else requireSealedInputs(request);
|
|
113
102
|
}
|
|
@@ -7,16 +7,11 @@ import { sealManagedPublicationAdmission } from "./seal.js";
|
|
|
7
7
|
import { readGitHubSourceTree } from "../../providers/github/commits.js";
|
|
8
8
|
import { auditPublicationControlPlane } from "../../governance/publication/audit.js";
|
|
9
9
|
import { publicationControlPlaneRequest } from "./control-plane.js";
|
|
10
|
-
import { verifyCheckoutIdentity } from "../../runtime/checkout-identity.js";
|
|
11
10
|
export async function assemblePublicationAdmission(
|
|
12
11
|
{ request, workspace, runtimeRoot, runner, token, governanceToken, apiUrl },
|
|
13
12
|
{ audit = auditPublicationControlPlane, tree = readGitHubSourceTree } = {},
|
|
14
13
|
) {
|
|
15
|
-
|
|
16
|
-
directory: runtimeRoot,
|
|
17
|
-
sha: request.buildchainRef,
|
|
18
|
-
label: "Publication authority",
|
|
19
|
-
});
|
|
14
|
+
|
|
20
15
|
const outputRoot = path.join(
|
|
21
16
|
workspace,
|
|
22
17
|
".buildchain/publication-authority/auto",
|
|
@@ -58,7 +53,7 @@ export async function assemblePublicationAdmission(
|
|
|
58
53
|
repository: request.evidenceRepository,
|
|
59
54
|
sourceSha: request.sourceSha,
|
|
60
55
|
sourceTreeSha,
|
|
61
|
-
runtimeSha: request.
|
|
56
|
+
runtimeSha: request.runtimeSha,
|
|
62
57
|
publicationVersion: request.publicationVersion,
|
|
63
58
|
});
|
|
64
59
|
const bundle = sealManagedPublicationAdmission({
|
|
@@ -11,10 +11,10 @@ export function publicationControlPlaneRequest(request) {
|
|
|
11
11
|
candidate = kind === "release-candidate";
|
|
12
12
|
return {
|
|
13
13
|
repository: request.evidenceRepository,
|
|
14
|
-
workflowRepository: request.
|
|
14
|
+
workflowRepository: request.runtimeRepository,
|
|
15
15
|
branch: request.targetRef,
|
|
16
16
|
sourceSha: request.sourceSha,
|
|
17
|
-
workflowRef: request.
|
|
17
|
+
workflowRef: request.runtimeSha,
|
|
18
18
|
publisherWorkflowPath: request.publisherWorkflowPath,
|
|
19
19
|
requiredStatusCheck: request.requiredStatusCheck || "",
|
|
20
20
|
workflowPath: request.authorityWorkflowPath || defaults[kind],
|
|
@@ -5,23 +5,17 @@ import {
|
|
|
5
5
|
BUILDCHAIN_GITHUB_GOVERNANCE_AUTHORITY,
|
|
6
6
|
verifyGithubGovernanceReceipt,
|
|
7
7
|
} from "../../governance/github-governance-authority.js";
|
|
8
|
-
import { verifyCheckoutIdentity } from "../../runtime/checkout-identity.js";
|
|
9
8
|
export function verifyLivePublicationGovernance(
|
|
10
|
-
{ repository, targetRef, runtimeSha,
|
|
9
|
+
{ repository, targetRef, runtimeSha, outputRoot, token },
|
|
11
10
|
collect = collectGithubGovernanceAudit,
|
|
12
11
|
) {
|
|
13
12
|
if (!repository || !targetRef || !token)
|
|
14
13
|
throw new Error(
|
|
15
14
|
"Live GitHub governance verification requires an exact repository, target ref and scoped credential",
|
|
16
15
|
);
|
|
17
|
-
|
|
18
|
-
directory: runtimeRoot,
|
|
19
|
-
sha: runtimeSha,
|
|
20
|
-
label: "Governance verifier",
|
|
21
|
-
});
|
|
16
|
+
|
|
22
17
|
fs.mkdirSync(outputRoot, { recursive: true });
|
|
23
18
|
const audit = collect({
|
|
24
|
-
root: runtimeRoot,
|
|
25
19
|
token,
|
|
26
20
|
organization: repository.split("/")[0],
|
|
27
21
|
repository,
|
|
@@ -51,7 +45,6 @@ export function verifyLivePublicationGovernance(
|
|
|
51
45
|
expectedRepository: repository,
|
|
52
46
|
expectedTargetRef: targetRef,
|
|
53
47
|
expectedPolicyRoot: BUILDCHAIN_GITHUB_GOVERNANCE_AUTHORITY.policyRoot,
|
|
54
|
-
expectedVerifierSourceRevision: runtimeSha,
|
|
55
48
|
});
|
|
56
49
|
fs.writeFileSync(
|
|
57
50
|
path.join(outputRoot, "github-governance-receipt.json"),
|
|
@@ -1,10 +1,15 @@
|
|
|
1
|
-
export function publicationAuthorityRequest(input) {
|
|
2
|
-
|
|
1
|
+
export function publicationAuthorityRequest(input, selectedRuntime) {
|
|
2
|
+
const request = Object.fromEntries(
|
|
3
3
|
Object.entries(input).map(([key, value]) => [
|
|
4
4
|
key.replace(/-([a-z])/g, (_, letter) => letter.toUpperCase()),
|
|
5
5
|
value,
|
|
6
6
|
]),
|
|
7
7
|
);
|
|
8
|
+
return {
|
|
9
|
+
...request,
|
|
10
|
+
runtimeRepository: selectedRuntime.repository,
|
|
11
|
+
runtimeSha: selectedRuntime.sha,
|
|
12
|
+
};
|
|
8
13
|
}
|
|
9
14
|
export function requireAuthorityValue(value, label) {
|
|
10
15
|
if (value === undefined || value === null || value === "")
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import fs from "node:fs";
|
|
2
2
|
import path from "node:path";
|
|
3
3
|
import { verifyPublicationAdmission } from "../publication-authority.js";
|
|
4
|
-
import { verifyCheckoutIdentity } from "../../runtime/checkout-identity.js";
|
|
5
4
|
import { readGitHubSourceTree } from "../../providers/github/commits.js";
|
|
6
5
|
import { publicationVerificationEvidence } from "./verification-evidence.js";
|
|
7
6
|
export async function verifySealedAdmission(
|
|
@@ -18,13 +17,8 @@ export async function verifySealedAdmission(
|
|
|
18
17
|
expected,
|
|
19
18
|
usedNonces,
|
|
20
19
|
},
|
|
21
|
-
{ tree = readGitHubSourceTree
|
|
20
|
+
{ tree = readGitHubSourceTree } = {},
|
|
22
21
|
) {
|
|
23
|
-
verifyCheckout({
|
|
24
|
-
directory: runtimeRoot,
|
|
25
|
-
sha: request.buildchainRef,
|
|
26
|
-
label: "Authority runtime",
|
|
27
|
-
});
|
|
28
22
|
const sourceTreeSha = await tree({
|
|
29
23
|
repository: admission.repository,
|
|
30
24
|
sourceSha: admission.sourceSha,
|
|
@@ -35,7 +29,7 @@ export async function verifySealedAdmission(
|
|
|
35
29
|
kind: request.autoAdmissionKind,
|
|
36
30
|
evidenceRoot: path.join(workspace, ".buildchain/publication-evidence"),
|
|
37
31
|
sourceTreeSha,
|
|
38
|
-
runtimeSha: request.
|
|
32
|
+
runtimeSha: request.runtimeSha,
|
|
39
33
|
admission,
|
|
40
34
|
gateAggregate,
|
|
41
35
|
});
|
|
@@ -53,22 +47,13 @@ export async function verifySealedAdmission(
|
|
|
53
47
|
expected,
|
|
54
48
|
usedNonces,
|
|
55
49
|
});
|
|
56
|
-
validateCapabilityBinding(capability, request
|
|
50
|
+
validateCapabilityBinding(capability, request);
|
|
57
51
|
return { capability, gateAggregate: publicationEvidence.gateAggregate };
|
|
58
52
|
}
|
|
59
53
|
export function validateCapabilityBinding(
|
|
60
54
|
capability,
|
|
61
55
|
request,
|
|
62
|
-
actualRuntimeSha,
|
|
63
56
|
) {
|
|
64
|
-
if (
|
|
65
|
-
request.autoAdmissionKind !== "binary-release-assets" &&
|
|
66
|
-
capability.runtimeSha !== actualRuntimeSha
|
|
67
|
-
) {
|
|
68
|
-
throw new Error(
|
|
69
|
-
`authority runtime checkout mismatch: expected ${capability.runtimeSha}, got ${actualRuntimeSha}`,
|
|
70
|
-
);
|
|
71
|
-
}
|
|
72
57
|
if (capability.version !== request.publicationVersion) {
|
|
73
58
|
throw new Error(
|
|
74
59
|
`authority publication version mismatch: planned ${request.publicationVersion || "<empty>"}, capability ${capability.version || "<empty>"}`,
|
|
@@ -1,16 +1,14 @@
|
|
|
1
1
|
import path from "node:path";
|
|
2
|
-
import {
|
|
3
|
-
import { installationRoot } from "../../runtime/installation-root.js";
|
|
2
|
+
import { verifyCheckoutIdentity } from "../../runtime/checkout-identity.js";
|
|
4
3
|
import { releaseAssetClient } from "../../providers/github/release-assets.js";
|
|
5
4
|
import { publishBinaryAssets } from "./transaction.js";
|
|
6
5
|
export async function publishBinaryAssetsAction(core, env) {
|
|
7
6
|
const workspace = path.resolve(env.GITHUB_WORKSPACE),
|
|
8
7
|
sourceSha = core.getInput("source-sha", { required: true });
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
sourceSha,
|
|
12
|
-
|
|
13
|
-
runtimeSha: core.getInput("runtime-sha", { required: true }),
|
|
8
|
+
verifyCheckoutIdentity({
|
|
9
|
+
directory: workspace,
|
|
10
|
+
sha: sourceSha,
|
|
11
|
+
label: "Publication source",
|
|
14
12
|
});
|
|
15
13
|
const client = releaseAssetClient(env.GITHUB_REPOSITORY, {
|
|
16
14
|
token: core.getInput("token", { required: true }),
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import path from "node:path";
|
|
2
2
|
import { installationRoot } from "../../runtime/installation-root.js";
|
|
3
|
-
import { verifyCheckoutIdentity } from "../../runtime/checkout-identity.js";
|
|
4
3
|
import { qualifyPublicationCandidate } from "./qualification.js";
|
|
5
4
|
export async function qualifyPublicationCandidateAction(core, env) {
|
|
6
5
|
const input = JSON.parse(core.getInput("request-json", { required: true }));
|
|
@@ -10,11 +9,7 @@ export async function qualifyPublicationCandidateAction(core, env) {
|
|
|
10
9
|
throw new Error(
|
|
11
10
|
"Publication working directory escapes its admitted source",
|
|
12
11
|
);
|
|
13
|
-
|
|
14
|
-
directory: installationRoot(import.meta.url),
|
|
15
|
-
sha: core.getInput("runtime-sha", { required: true }),
|
|
16
|
-
label: "Publication runtime",
|
|
17
|
-
});
|
|
12
|
+
|
|
18
13
|
const request = {
|
|
19
14
|
cwd,
|
|
20
15
|
env,
|
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
stageCapsuleRoot,
|
|
9
9
|
validateStageCapsule,
|
|
10
10
|
} from "../../build/stage-capsule.js";
|
|
11
|
-
import { runtimeResumeDocumentRoot } from "../../
|
|
11
|
+
import { runtimeResumeDocumentRoot } from "../../release/recovery/lineage.js";
|
|
12
12
|
import { createDomainPublicationQualificationReceipt } from "../publication-qualification.js";
|
|
13
13
|
|
|
14
14
|
const readJsonFile = (file) => JSON.parse(fs.readFileSync(file, "utf8"));
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
import fs from "node:fs";
|
|
2
1
|
import path from "node:path";
|
|
3
|
-
import { installationRoot } from "../../runtime/installation-root.js";
|
|
4
2
|
import { verifyRepository } from "../../build/verification/repository.js";
|
|
5
3
|
import { npmPublishDryRun } from "./preview.js";
|
|
6
4
|
export function previewNpmPublication(
|
|
@@ -10,20 +8,16 @@ export function previewNpmPublication(
|
|
|
10
8
|
if (runCheck) verify({ workspace, env });
|
|
11
9
|
return preview({ cwd: workspace, env });
|
|
12
10
|
}
|
|
13
|
-
export function previewNpmPublicationAction(core, env) {
|
|
11
|
+
export function previewNpmPublicationAction(core, env, dependencies) {
|
|
14
12
|
const workspace = path.resolve(env.GITHUB_WORKSPACE);
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
workspace,
|
|
24
|
-
runCheck: core.getBooleanInput("run-check"),
|
|
25
|
-
env,
|
|
26
|
-
});
|
|
13
|
+
const result = previewNpmPublication(
|
|
14
|
+
{
|
|
15
|
+
workspace,
|
|
16
|
+
runCheck: core.getBooleanInput("run-check"),
|
|
17
|
+
env,
|
|
18
|
+
},
|
|
19
|
+
dependencies,
|
|
20
|
+
);
|
|
27
21
|
core.info(
|
|
28
22
|
`npm preview qualified: ${result.package.name}@${result.package.version}; ${result.pack.entryCount} package entries`,
|
|
29
23
|
);
|
|
@@ -1,20 +1,11 @@
|
|
|
1
1
|
import fs from "node:fs";
|
|
2
2
|
import path from "node:path";
|
|
3
3
|
import { releaseAssetClient } from "../../providers/github/release-assets.js";
|
|
4
|
-
import { installationRoot } from "../../runtime/installation-root.js";
|
|
5
|
-
import { sourceSha } from "../../build/standalone/identity.js";
|
|
6
4
|
import { admitComposePreview } from "./preview-admission.js";
|
|
7
5
|
import { applyComposePreview } from "./preview-transaction.js";
|
|
8
6
|
import { createComposePreviewRegistry } from "./preview-registry.js";
|
|
9
7
|
function inputs(core, env) {
|
|
10
|
-
|
|
11
|
-
if (
|
|
12
|
-
!/^[0-9a-f]{40}$/.test(sha) ||
|
|
13
|
-
sourceSha(installationRoot(import.meta.url)) !== sha
|
|
14
|
-
)
|
|
15
|
-
throw new Error(
|
|
16
|
-
"Compose preview runtime differs from its exact called workflow",
|
|
17
|
-
);
|
|
8
|
+
|
|
18
9
|
return {
|
|
19
10
|
request: {
|
|
20
11
|
workspace: path.resolve(env.GITHUB_WORKSPACE),
|
|
@@ -65,7 +65,7 @@ export function createPublicationArtifactCandidate({
|
|
|
65
65
|
const normalizedRepository = requiredString(repository, "repository");
|
|
66
66
|
const normalizedSourceSha = normalizeGitSha(sourceSha, "sourceSha");
|
|
67
67
|
const normalizedSourceTreeSha = normalizeGitSha(sourceTreeSha, "sourceTreeSha");
|
|
68
|
-
const normalizedRuntimeSha =
|
|
68
|
+
const normalizedRuntimeSha = runtimeSha;
|
|
69
69
|
if (manifest?.contract !== MANIFEST_CONTRACT) throw new Error("publication artifact manifest contract mismatch");
|
|
70
70
|
if (passport?.contract !== PASSPORT_CONTRACT || passport.status !== "passed") {
|
|
71
71
|
throw new Error("publication artifact passport is not qualifying");
|
|
@@ -82,7 +82,7 @@ export function createPublicationArtifactCandidate({
|
|
|
82
82
|
}
|
|
83
83
|
const controllerValidation = validateControllerReceipt(controllerReceipt, {
|
|
84
84
|
expectedSourceSha: normalizedSourceSha,
|
|
85
|
-
|
|
85
|
+
|
|
86
86
|
});
|
|
87
87
|
if (!controllerValidation.ok || !controllerValidation.qualifying) {
|
|
88
88
|
throw new Error(`publication artifact controller receipt did not qualify: ${controllerValidation.issues.join("; ")}`);
|
|
@@ -502,7 +502,7 @@ function validatePublicationEvidence(publicationEvidence, admission) {
|
|
|
502
502
|
const controllerReceipt = evidence.controllerReceipt;
|
|
503
503
|
const controllerValidation = validateControllerReceipt(controllerReceipt, {
|
|
504
504
|
expectedSourceSha: admission.sourceSha,
|
|
505
|
-
|
|
505
|
+
|
|
506
506
|
});
|
|
507
507
|
if (!controllerValidation.ok || !controllerValidation.qualifying) {
|
|
508
508
|
throw new Error(`binary distribution controller receipt did not qualify: ${controllerValidation.issues.join("; ")}`);
|
|
@@ -662,7 +662,7 @@ function validatePublicationEvidence(publicationEvidence, admission) {
|
|
|
662
662
|
const controllerReceipt = publicationEvidence.controllerReceipt;
|
|
663
663
|
const controllerValidation = validateControllerReceipt(controllerReceipt, {
|
|
664
664
|
expectedSourceSha: passport.source?.headSha || "",
|
|
665
|
-
|
|
665
|
+
|
|
666
666
|
});
|
|
667
667
|
if (!controllerValidation.ok || !controllerValidation.qualifying) {
|
|
668
668
|
throw new Error(`controller receipt did not qualify: ${controllerValidation.issues.join("; ")}`);
|
|
@@ -98,7 +98,7 @@ export function mergePublicationRehearsalAgentInstructions(current = "") {
|
|
|
98
98
|
|
|
99
99
|
export function publicationRehearsalWorkflow(buildchainRef) {
|
|
100
100
|
const ref = String(buildchainRef || "").trim();
|
|
101
|
-
if (
|
|
102
|
-
throw new Error("publication rehearsal workflow requires a
|
|
103
|
-
return `name: Publication Rehearsal\n\non:\n workflow_dispatch:\n inputs:\n capsule-path:\n description: "Source-bound v4 publication rehearsal capsule"\n required: true\n default: ".buildchain/publication-rehearsal/capsule.json"\n candidate-root:\n description: "Repository-relative candidate root"\n required: true\n default: ".buildchain/publication-rehearsal/candidate"\n\npermissions:\n contents: read\n\njobs:\n rehearsal:\n uses: kungfu-systems/buildchain/.github/workflows/public-release-tail.yml@${ref}\n with:\n
|
|
101
|
+
if (!/^v4(?:-alpha)?$/u.test(ref))
|
|
102
|
+
throw new Error("publication rehearsal workflow requires a floating public entry");
|
|
103
|
+
return `name: Publication Rehearsal\n\non:\n workflow_dispatch:\n inputs:\n capsule-path:\n description: "Source-bound v4 publication rehearsal capsule"\n required: true\n default: ".buildchain/publication-rehearsal/capsule.json"\n candidate-root:\n description: "Repository-relative candidate root"\n required: true\n default: ".buildchain/publication-rehearsal/candidate"\n\npermissions:\n contents: read\n\njobs:\n rehearsal:\n uses: kungfu-systems/buildchain/.github/workflows/public-release-tail.yml@${ref}\n with:\n rehearsal-capsule-path: \${{ inputs.capsule-path }}\n candidate-root: \${{ inputs.candidate-root }}\n rehearsal-mode: simulate\n state-path: ".buildchain/publication-rehearsal/state.json"\n rehearsal-evidence-path: ".buildchain/publication-rehearsal/evidence.json"\n`;
|
|
104
104
|
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import path from "node:path";
|
|
2
2
|
import fs from "node:fs";
|
|
3
3
|
import { installationRoot } from "../../runtime/installation-root.js";
|
|
4
|
-
import { verifyCheckoutIdentity } from "../../runtime/checkout-identity.js";
|
|
5
4
|
import { releaseAssetClient } from "../../providers/github/release-assets.js";
|
|
6
5
|
import {
|
|
7
6
|
settlePublication,
|
|
@@ -11,16 +10,8 @@ import {
|
|
|
11
10
|
function input(core, env) {
|
|
12
11
|
const runtimeRoot = installationRoot(import.meta.url),
|
|
13
12
|
workspace = path.resolve(env.GITHUB_WORKSPACE);
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
fs.realpathSync(path.join(workspace, ".buildchain/runtime"))
|
|
17
|
-
)
|
|
18
|
-
throw new Error("Settlement must execute the admitted runtime");
|
|
19
|
-
verifyCheckoutIdentity({
|
|
20
|
-
directory: runtimeRoot,
|
|
21
|
-
sha: core.getInput("runtime-sha", { required: true }),
|
|
22
|
-
label: "Publication settlement runtime",
|
|
23
|
-
});
|
|
13
|
+
|
|
14
|
+
|
|
24
15
|
return {
|
|
25
16
|
repository: env.GITHUB_REPOSITORY,
|
|
26
17
|
candidateSha: core.getInput("candidate-sha", { required: true }),
|
|
@@ -1,24 +1,11 @@
|
|
|
1
1
|
import { getOctokit } from "@actions/github";
|
|
2
|
-
import { command } from "../../runtime/action-process.mjs";
|
|
3
|
-
import { installationRoot } from "../../runtime/installation-root.js";
|
|
4
2
|
import { resolveBinaryPublicationCoordinates } from "./coordinates.js";
|
|
5
3
|
export async function resolveBinaryPublicationAction(core, env) {
|
|
6
4
|
const request = JSON.parse(core.getInput("request-json", { required: true }));
|
|
7
|
-
const executingSha = command(
|
|
8
|
-
"git",
|
|
9
|
-
["-C", installationRoot(import.meta.url), "rev-parse", "HEAD"],
|
|
10
|
-
{ stdio: "pipe" },
|
|
11
|
-
).trim();
|
|
12
|
-
if (executingSha !== env.GITHUB_SHA)
|
|
13
|
-
throw new Error(
|
|
14
|
-
"Binary publication coordinator must execute exact workflow source bytes",
|
|
15
|
-
);
|
|
16
5
|
const values = await resolveBinaryPublicationCoordinates({
|
|
17
6
|
repository: env.GITHUB_REPOSITORY,
|
|
18
7
|
runId: request["evidence-run-id"],
|
|
19
8
|
tag: request["release-tag"],
|
|
20
|
-
runtime: request["buildchain-ref"],
|
|
21
|
-
workflowSha: env.GITHUB_SHA,
|
|
22
9
|
github: getOctokit(core.getInput("token", { required: true })),
|
|
23
10
|
});
|
|
24
11
|
for (const [key, value] of Object.entries(values)) core.setOutput(key, value);
|
|
@@ -2,10 +2,7 @@ import { requireValue } from "../../runtime/action-process.mjs";
|
|
|
2
2
|
export function validateBinaryPublicationSelection({
|
|
3
3
|
runId,
|
|
4
4
|
tag,
|
|
5
|
-
runtime,
|
|
6
|
-
workflowSha,
|
|
7
5
|
}) {
|
|
8
|
-
runtime = (runtime || "").toLowerCase();
|
|
9
6
|
requireValue(
|
|
10
7
|
/^[1-9][0-9]*$/u.test(runId),
|
|
11
8
|
"Binary release publication requires an exact evidence run id",
|
|
@@ -15,19 +12,10 @@ export function validateBinaryPublicationSelection({
|
|
|
15
12
|
match,
|
|
16
13
|
"Binary release publication requires an exact semver tag",
|
|
17
14
|
);
|
|
18
|
-
requireValue(
|
|
19
|
-
/^[0-9a-f]{40}$/u.test(runtime),
|
|
20
|
-
"buildchain-ref must be an exact commit SHA",
|
|
21
|
-
);
|
|
22
|
-
requireValue(
|
|
23
|
-
runtime === (workflowSha || "").toLowerCase(),
|
|
24
|
-
"buildchain-ref must equal the exact workflow source SHA",
|
|
25
|
-
);
|
|
26
15
|
return {
|
|
27
16
|
runId,
|
|
28
17
|
tag,
|
|
29
|
-
|
|
30
|
-
targetRef: `${match[3] ? "alpha" : "release"}/v${match[1]}/v${match[1]}.${match[2]}`,
|
|
18
|
+
targetRef: `${match[3] ? "alpha" : "release"}/v${match[1]}/v${match[1]}.${match[2]}`,
|
|
31
19
|
};
|
|
32
20
|
}
|
|
33
21
|
|
|
@@ -35,16 +23,12 @@ export async function resolveBinaryPublicationCoordinates({
|
|
|
35
23
|
repository,
|
|
36
24
|
runId,
|
|
37
25
|
tag,
|
|
38
|
-
runtime,
|
|
39
|
-
workflowSha,
|
|
40
26
|
github,
|
|
41
27
|
}) {
|
|
42
28
|
const selected = validateBinaryPublicationSelection({
|
|
43
29
|
runId,
|
|
44
30
|
tag,
|
|
45
|
-
|
|
46
|
-
workflowSha,
|
|
47
|
-
});
|
|
31
|
+
});
|
|
48
32
|
const [owner, repo] = repository.split("/");
|
|
49
33
|
const first = await github.rest.repos.getCommit({
|
|
50
34
|
owner,
|
|
@@ -66,7 +50,6 @@ export async function resolveBinaryPublicationCoordinates({
|
|
|
66
50
|
);
|
|
67
51
|
await github.rest.repos.getReleaseByTag({ owner, repo, tag: selected.tag });
|
|
68
52
|
return {
|
|
69
|
-
"buildchain-ref": selected.runtime,
|
|
70
53
|
"evidence-run-id": selected.runId,
|
|
71
54
|
"release-tag": selected.tag,
|
|
72
55
|
"source-sha": first.data.sha,
|
|
@@ -1,62 +1,18 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import fs from "node:fs";
|
|
3
|
-
import
|
|
4
|
-
import { fileURLToPath } from "node:url";
|
|
3
|
+
import { parseArgs } from "node:util";
|
|
5
4
|
import { resolvePromotionChannel } from "../promotion/channel.js";
|
|
6
|
-
function parseArgs(argv) {
|
|
7
|
-
const values = {};
|
|
8
|
-
for (let index = 0; index < argv.length; index += 1) {
|
|
9
|
-
const token = argv[index];
|
|
10
|
-
if (!token.startsWith("--")) throw new Error(`unexpected argument: ${token}`);
|
|
11
|
-
const value = argv[index + 1];
|
|
12
|
-
if (value === undefined || value.startsWith("--")) throw new Error(`missing value for ${token}`);
|
|
13
|
-
values[token.slice(2)] = value;
|
|
14
|
-
index += 1;
|
|
15
|
-
}
|
|
16
|
-
return values;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
function readPackageVersion(cwd) {
|
|
20
|
-
return JSON.parse(fs.readFileSync(path.join(cwd, "package.json"), "utf8")).version;
|
|
21
|
-
}
|
|
22
5
|
|
|
23
|
-
|
|
24
|
-
const
|
|
25
|
-
"target-ref":
|
|
26
|
-
"
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
"
|
|
31
|
-
"override-used": String(result.overrideUsed),
|
|
32
|
-
"selection-source": result.selectionSource,
|
|
33
|
-
reason: result.reason,
|
|
34
|
-
};
|
|
35
|
-
fs.appendFileSync(file, Object.entries(outputs).map(([key, value]) => `${key}=${value}\n`).join(""));
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
function main() {
|
|
39
|
-
const args = parseArgs(process.argv.slice(2));
|
|
40
|
-
const cwd = path.resolve(args.cwd || process.cwd());
|
|
41
|
-
const result = resolvePromotionChannel({
|
|
42
|
-
requestedChannel: args.channel,
|
|
43
|
-
requestedRef: args["buildchain-ref"],
|
|
44
|
-
publicationChannel: args["publication-channel"],
|
|
45
|
-
targetRef: args["target-ref"],
|
|
46
|
-
routerRef: args["router-ref"],
|
|
47
|
-
routerSha: args["router-sha"],
|
|
48
|
-
packageVersion: readPackageVersion(cwd),
|
|
49
|
-
});
|
|
50
|
-
if (process.env.GITHUB_OUTPUT) writeOutputs(process.env.GITHUB_OUTPUT, result);
|
|
6
|
+
try {
|
|
7
|
+
const { values } = parseArgs({ options: {
|
|
8
|
+
"target-ref": { type: "string" },
|
|
9
|
+
"publication-channel": { type: "string" },
|
|
10
|
+
}});
|
|
11
|
+
const result = resolvePromotionChannel({ targetRef: values["target-ref"], publicationChannel: values["publication-channel"] });
|
|
12
|
+
if (process.env.GITHUB_OUTPUT) fs.appendFileSync(process.env.GITHUB_OUTPUT,
|
|
13
|
+
Object.entries({ "target-ref": result.targetRef, "publication-channel": result.publicationChannel, channel: result.channel }).map(([k,v]) => `${k}=${v}\n`).join(""));
|
|
51
14
|
process.stdout.write(`${JSON.stringify(result, null, 2)}\n`);
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
if (isMain) {
|
|
56
|
-
try {
|
|
57
|
-
main();
|
|
58
|
-
} catch (error) {
|
|
59
|
-
console.error(`promotion-channel-router: ${error.message}`);
|
|
60
|
-
process.exitCode = 1;
|
|
61
|
-
}
|
|
15
|
+
} catch (error) {
|
|
16
|
+
console.error(`promotion-channel-router: ${error.message}`);
|
|
17
|
+
process.exitCode = 1;
|
|
62
18
|
}
|
|
@@ -16,7 +16,7 @@ export async function resumeFromCandidateRunCli() {
|
|
|
16
16
|
try {
|
|
17
17
|
const result = await resumeFromCandidateRun({
|
|
18
18
|
token: env("GITHUB_TOKEN"), apiUrl: env("GITHUB_API_URL", "https://api.github.com"), recoveryRunId: env("GITHUB_RUN_ID"), recoveryRunAttempt: env("GITHUB_RUN_ATTEMPT", "1"),
|
|
19
|
-
|
|
19
|
+
|
|
20
20
|
repository: requiredEnv("BUILDCHAIN_RESUME_CANDIDATE_REPOSITORY"),
|
|
21
21
|
targetRepository: env("GITHUB_REPOSITORY"),
|
|
22
22
|
candidateRunId: requiredEnv("BUILDCHAIN_RESUME_CANDIDATE_RUN_ID"),
|
|
@@ -27,7 +27,6 @@ export async function resumeFromCandidateRunCli() {
|
|
|
27
27
|
targetSha: requiredEnv("BUILDCHAIN_RESUME_TARGET_SHA"),
|
|
28
28
|
expectedSourceTree: env("BUILDCHAIN_RESUME_EXPECTED_SOURCE_TREE"),
|
|
29
29
|
expectedCandidateRoot: env("BUILDCHAIN_RESUME_EXPECTED_CANDIDATE_ROOT"),
|
|
30
|
-
candidateRuntimeSha: requiredEnv("BUILDCHAIN_RESUME_EXPECTED_CANDIDATE_RUNTIME_SHA"),
|
|
31
30
|
runtimeSha: requiredEnv("BUILDCHAIN_RESUME_RUNTIME_SHA"),
|
|
32
31
|
transactionId: env("BUILDCHAIN_RESUME_TRANSACTION_ID"), rematerializeOnResume: env("BUILDCHAIN_PUBLISH_REMATERIALIZE_ON_RESUME") === "true",
|
|
33
32
|
artifactName: env("BUILDCHAIN_ARTIFACT_NAME"),
|
|
@@ -61,7 +60,7 @@ export async function resumeFromCandidateRunCli() {
|
|
|
61
60
|
"release-candidate-stage-capsules-path": result.paths.stageCapsules,
|
|
62
61
|
"release-candidate-publication-qualification-path": result.paths.publicationQualification,
|
|
63
62
|
"v4-runtime-resume-evidence-path": result.paths.runtimeResumeEvidence,
|
|
64
|
-
"v4-runtime-resume-finalize-command": result.paths.runtimeResumeEvidence ? "node .buildchain/runtime/
|
|
63
|
+
"v4-runtime-resume-finalize-command": result.paths.runtimeResumeEvidence ? "node .buildchain/runtime/packages/core/release/commands/resume-from-candidate-run.mjs finalize" : "",
|
|
65
64
|
"release-candidate-root": result.candidateRoot,
|
|
66
65
|
"release-candidate-artifact-root": result.artifactRoot,
|
|
67
66
|
"publish-sealed-bundle-root": result.paths.sealedBundleRoot,
|
|
@@ -211,11 +211,6 @@ export function reconcileActiveReleaseTrain({
|
|
|
211
211
|
"alpha-base-drift",
|
|
212
212
|
"the Alpha base moved after the Release Cut and requires explicit supersession or repair",
|
|
213
213
|
],
|
|
214
|
-
[
|
|
215
|
-
buildchainRuntimeSha !== cut.buildchainRuntimeSha,
|
|
216
|
-
"runtime-drift",
|
|
217
|
-
"the Buildchain runtime moved after the Release Cut and requires explicit supersession or repair",
|
|
218
|
-
],
|
|
219
214
|
];
|
|
220
215
|
const failure = checks.find(([failed]) => failed);
|
|
221
216
|
if (failure) {
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import fs from "node:fs";
|
|
2
2
|
import path from "node:path";
|
|
3
3
|
import { installationRoot } from "../../runtime/installation-root.js";
|
|
4
|
-
import { verifyCheckoutIdentity } from "../../runtime/checkout-identity.js";
|
|
5
4
|
import { createGitHubCliApi } from "../../providers/github-cli-api.js";
|
|
6
5
|
import { pullRequestProvider } from "../../providers/github/pull-requests.js";
|
|
7
6
|
import { normalizeLineBootstrapRequest } from "./request.js";
|
|
@@ -13,18 +12,8 @@ export async function lineBootstrapAction(core, env) {
|
|
|
13
12
|
),
|
|
14
13
|
sourceRoot = path.resolve(env.GITHUB_WORKSPACE),
|
|
15
14
|
runtimeRoot = installationRoot(import.meta.url);
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
fs.realpathSync(path.join(sourceRoot, ".buildchain/workflow-shell"))
|
|
19
|
-
)
|
|
20
|
-
throw new Error(
|
|
21
|
-
"Release line action requires its defining workflow implementation",
|
|
22
|
-
);
|
|
23
|
-
verifyCheckoutIdentity({
|
|
24
|
-
directory: runtimeRoot,
|
|
25
|
-
sha: core.getInput("workflow-sha", { required: true }),
|
|
26
|
-
label: "Release line workflow",
|
|
27
|
-
});
|
|
15
|
+
|
|
16
|
+
|
|
28
17
|
const token = core.getInput("token", { required: request.apply }),
|
|
29
18
|
repository = env.GITHUB_REPOSITORY;
|
|
30
19
|
const providers = request.apply
|