新增 release artifact validation action plan API
This commit is contained in:
@@ -57,6 +57,7 @@ import {
|
||||
createProjectReleaseGateManifest,
|
||||
createProjectReleaseGateResultMatrix,
|
||||
createProjectReleaseReadinessArtifactValidation,
|
||||
createProjectReleaseReadinessArtifactValidationActionPlan,
|
||||
createProjectReleaseReadinessArtifactValidationSummaryViewModel,
|
||||
createProjectReleaseReadinessReport,
|
||||
createProjectReleaseReadinessSummaryViewModel,
|
||||
@@ -232,6 +233,10 @@ chain fail the same executable gate.
|
||||
`createProjectReleaseReadinessArtifactValidationSummaryViewModel()` turns that
|
||||
validation result into stable status text and display rows for dashboards or
|
||||
browser shells without reinterpreting the artifact fields.
|
||||
`createProjectReleaseReadinessArtifactValidationActionPlan()` turns a blocked
|
||||
artifact validation result into the exact project release gate and artifact
|
||||
validation commands to run next, plus the missing evidence list and shell
|
||||
script. Ready validations return no commands.
|
||||
|
||||
## OPFS/session persistence exports
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@ export {
|
||||
createProjectReleaseGateManifest,
|
||||
createProjectReleaseGateResultMatrix,
|
||||
createProjectReleaseReadinessArtifactValidation,
|
||||
createProjectReleaseReadinessArtifactValidationActionPlan,
|
||||
createProjectReleaseReadinessArtifactValidationSummaryViewModel,
|
||||
createProjectReleaseReadinessReport,
|
||||
createProjectReleaseReadinessSummaryViewModel,
|
||||
|
||||
@@ -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