新增 release artifact validation action plan API
This commit is contained in:
@@ -377,6 +377,69 @@ export function createProjectReleaseReadinessArtifactValidationSummaryViewModel(
|
||||
};
|
||||
}
|
||||
|
||||
export function createProjectReleaseReadinessArtifactValidationActionPlan(
|
||||
validation = createProjectReleaseReadinessArtifactValidation(),
|
||||
) {
|
||||
const missing = arrayOrEmpty(validation?.missing);
|
||||
const ready = validation?.ready === true;
|
||||
const commands = ready ? [] : [
|
||||
{
|
||||
step: 1,
|
||||
id: "project-release-gate",
|
||||
label: "Run project release gate",
|
||||
command: "wasm-port/tests/host/verify_project_release_gate.sh",
|
||||
expectedOutput: "project_release_gate=ok",
|
||||
},
|
||||
{
|
||||
step: 2,
|
||||
id: "artifact-validation",
|
||||
label: "Validate project release readiness artifact",
|
||||
command: "wasm-port/tests/host/verify_project_release_readiness_artifact.sh build/project-release-readiness.json",
|
||||
expectedOutput: "project_release_readiness_artifact_node_smoke=ok",
|
||||
},
|
||||
];
|
||||
const shellScript = commands.length > 0
|
||||
? [
|
||||
"#!/usr/bin/env bash",
|
||||
"set -euo pipefail",
|
||||
"",
|
||||
...commands.map(({ command }) => command),
|
||||
"",
|
||||
].join("\n")
|
||||
: "# Project release readiness artifact validation is already ready.\n";
|
||||
|
||||
return {
|
||||
apiName: "project-release-readiness-artifact-validation-action-plan",
|
||||
planVersion: 1,
|
||||
phase: ready ? "ready" : "blocked",
|
||||
ready,
|
||||
missing,
|
||||
missingCount: missing.length,
|
||||
commandCount: commands.length,
|
||||
nextActionId: commands[0]?.id ?? null,
|
||||
nextCommand: commands[0]?.command ?? null,
|
||||
commands,
|
||||
shellScript,
|
||||
rows: [
|
||||
{
|
||||
id: "artifact-validation",
|
||||
label: "Artifact validation",
|
||||
value: ready ? "ready" : "blocked",
|
||||
},
|
||||
{
|
||||
id: "missing",
|
||||
label: "Missing artifact evidence",
|
||||
value: missing.length > 0 ? missing.join(", ") : "none",
|
||||
},
|
||||
{
|
||||
id: "next-command",
|
||||
label: "Next command",
|
||||
value: commands[0]?.command ?? "none",
|
||||
},
|
||||
],
|
||||
};
|
||||
}
|
||||
|
||||
export function parseProjectReleaseReadinessArtifactJson(text) {
|
||||
return JSON.parse(String(text));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user