feat(build): support optional BuildKit secrets
Platform CI tests / QuickStack deploy action tests (pull_request) Successful in 40s
Nuvisphere/Platform-CI: Immutable QuickStack OCI deployment / Build once and deploy exact digest (pull_request) Successful in 27s
Platform CI tests / QuickStack deploy action tests (push) Successful in 28s
Nuvisphere/Platform-CI: Immutable QuickStack OCI deployment / Build once and deploy exact digest (push) Successful in 29s

This commit was merged in pull request #4.
This commit is contained in:
2026-08-25 10:00:36 +02:00
parent b6a550e9a3
commit c8bc0ff58d
3 changed files with 66 additions and 0 deletions
@@ -6,6 +6,7 @@ import {
deployExactImage,
expandTokens,
mergeEnvironment,
resolveBuildSecretArguments,
resolveSecretEnvironment,
orderApplications,
resolveDeploymentBranch,
@@ -151,6 +152,34 @@ test("version 2 validates promotion contracts and token expansion", () => {
);
});
test("passes declared Actions secrets to Docker only through BuildKit secret mounts", () => {
const secretValue = "must-not-appear-in-docker-arguments";
const artifact = validateArtifact({
name: "web",
image: "owner/web",
buildSecrets: {
"next-server-actions-encryption-key": "NEXT_SERVER_ACTIONS_ENCRYPTION_KEY",
},
});
const args = resolveBuildSecretArguments(artifact.buildSecrets, {
NEXT_SERVER_ACTIONS_ENCRYPTION_KEY: secretValue,
});
assert.deepEqual(args, [
"--secret",
"id=next-server-actions-encryption-key,env=NEXT_SERVER_ACTIONS_ENCRYPTION_KEY",
]);
assert.doesNotMatch(JSON.stringify(args), new RegExp(secretValue));
assert.throws(
() => resolveBuildSecretArguments(artifact.buildSecrets, {}),
/Missing Actions secret NEXT_SERVER_ACTIONS_ENCRYPTION_KEY/,
);
assert.throws(
() => validateArtifact({ name: "web", image: "owner/web", buildSecrets: { "../invalid": "SECRET" } }),
/Invalid BuildKit secret ID/,
);
});
test("application dependencies reject missing nodes and cycles", () => {
assert.throws(
() => orderApplications([{ name: "web", dependsOn: ["missing"] }]),