新增发布 artifact validation summary view model
This commit is contained in:
@@ -55,6 +55,7 @@ import {
|
||||
createProjectReleaseGateManifest,
|
||||
createProjectReleaseGateResultMatrix,
|
||||
createProjectReleaseReadinessArtifactValidation,
|
||||
createProjectReleaseReadinessArtifactValidationSummaryViewModel,
|
||||
createProjectReleaseReadinessReport,
|
||||
createProjectReleaseReadinessSummaryViewModel,
|
||||
createSessionSnapshot,
|
||||
@@ -226,6 +227,9 @@ host test assertions. The validation result includes `expectedGateCount` and
|
||||
current manifest, plus `gateManifestReady`, `gateResultMatrixReady`, and
|
||||
`gateActionPlanReady` so stale artifacts that omit the embedded gate evidence
|
||||
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.
|
||||
|
||||
## OPFS/session persistence exports
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@ export {
|
||||
createProjectReleaseGateManifest,
|
||||
createProjectReleaseGateResultMatrix,
|
||||
createProjectReleaseReadinessArtifactValidation,
|
||||
createProjectReleaseReadinessArtifactValidationSummaryViewModel,
|
||||
createProjectReleaseReadinessReport,
|
||||
createProjectReleaseReadinessSummaryViewModel,
|
||||
parseProjectReleaseReadinessArtifactJson,
|
||||
|
||||
@@ -324,6 +324,59 @@ export function createProjectReleaseReadinessSummaryViewModel(
|
||||
};
|
||||
}
|
||||
|
||||
export function createProjectReleaseReadinessArtifactValidationSummaryViewModel(
|
||||
validation = createProjectReleaseReadinessArtifactValidation(),
|
||||
) {
|
||||
const missing = arrayOrEmpty(validation?.missing);
|
||||
const ready = validation?.ready === true;
|
||||
const statusText = ready ? "Ready" : "Blocked";
|
||||
const detailText = ready
|
||||
? "Artifact evidence complete"
|
||||
: (missing.length > 0 ? missing.join(", ") : "artifact evidence missing");
|
||||
return {
|
||||
apiName: "project-release-readiness-artifact-validation-summary-view-model",
|
||||
viewModelVersion: 1,
|
||||
phase: ready ? "ready" : "blocked",
|
||||
ready,
|
||||
title: "Project release artifact validation",
|
||||
statusText,
|
||||
detailText,
|
||||
statusLine: `${statusText}: ${detailText}`,
|
||||
rows: [
|
||||
{
|
||||
id: "artifact",
|
||||
label: "Readiness artifact",
|
||||
value: validation?.artifactApiName ?? "missing",
|
||||
},
|
||||
{
|
||||
id: "gate-count",
|
||||
label: "Gate count",
|
||||
value: `${validation?.gateCount ?? 0}/${validation?.expectedGateCount ?? 0}`,
|
||||
},
|
||||
{
|
||||
id: "gate-manifest",
|
||||
label: "Gate manifest",
|
||||
value: validation?.gateManifestReady === true ? "ready" : "missing",
|
||||
},
|
||||
{
|
||||
id: "gate-result-matrix",
|
||||
label: "Gate result matrix",
|
||||
value: validation?.gateResultMatrixReady === true ? "ready" : "missing",
|
||||
},
|
||||
{
|
||||
id: "gate-action-plan",
|
||||
label: "Gate action plan",
|
||||
value: validation?.gateActionPlanReady === true ? "ready" : "missing",
|
||||
},
|
||||
{
|
||||
id: "missing",
|
||||
label: "Missing artifact evidence",
|
||||
value: missing.length > 0 ? missing.join(", ") : "none",
|
||||
},
|
||||
],
|
||||
};
|
||||
}
|
||||
|
||||
export function parseProjectReleaseReadinessArtifactJson(text) {
|
||||
return JSON.parse(String(text));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user