新增 release artifact URL workflow summary API
This commit is contained in:
@@ -65,6 +65,8 @@ continuation records are in `../text14.txt`.
|
||||
`loadProjectReleaseReadinessArtifactUrlWorkflow()` provides the same
|
||||
SDK-side workflow from an artifact URL and caller-provided fetch
|
||||
implementation, including fetch status and next-command output.
|
||||
`createProjectReleaseReadinessArtifactUrlWorkflowSummaryViewModel()` turns
|
||||
that SDK URL workflow into stable dashboard rows and status text.
|
||||
Browser shells can also pass the JSON to
|
||||
`linuxCncIniPanelWorkflowOverviewApi.validateWorkflowOverviewReleaseReadinessArtifactJson()`
|
||||
through the workflow overview iframe and receive stable validation rows. They
|
||||
|
||||
@@ -57,6 +57,7 @@ import {
|
||||
createProjectReleaseGateManifest,
|
||||
createProjectReleaseGateResultMatrix,
|
||||
createProjectReleaseReadinessArtifactJsonWorkflow,
|
||||
createProjectReleaseReadinessArtifactUrlWorkflowSummaryViewModel,
|
||||
createProjectReleaseReadinessArtifactValidation,
|
||||
createProjectReleaseReadinessArtifactValidationActionPlan,
|
||||
createProjectReleaseReadinessArtifactValidationSummaryViewModel,
|
||||
@@ -248,6 +249,9 @@ action plan instead of throwing.
|
||||
for callers that supply a `fetch` implementation. It fetches the artifact URL,
|
||||
runs the JSON workflow, and returns fetch status, validation, summary, and
|
||||
action-plan output without executing release gates.
|
||||
`createProjectReleaseReadinessArtifactUrlWorkflowSummaryViewModel()` turns the
|
||||
URL workflow result into stable dashboard status text and rows for ready,
|
||||
missing-input, fetch-failure, and artifact-validation-blocked states.
|
||||
|
||||
## OPFS/session persistence exports
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@ export {
|
||||
createProjectReleaseGateManifest,
|
||||
createProjectReleaseGateResultMatrix,
|
||||
createProjectReleaseReadinessArtifactJsonWorkflow,
|
||||
createProjectReleaseReadinessArtifactUrlWorkflowSummaryViewModel,
|
||||
createProjectReleaseReadinessArtifactValidation,
|
||||
createProjectReleaseReadinessArtifactValidationActionPlan,
|
||||
createProjectReleaseReadinessArtifactValidationSummaryViewModel,
|
||||
|
||||
@@ -674,6 +674,59 @@ export async function loadProjectReleaseReadinessArtifactUrlWorkflow({
|
||||
}
|
||||
}
|
||||
|
||||
export function createProjectReleaseReadinessArtifactUrlWorkflowSummaryViewModel(
|
||||
workflow = {},
|
||||
) {
|
||||
const missing = arrayOrEmpty(workflow?.missing);
|
||||
const ready = workflow?.ready === true;
|
||||
const statusText = ready ? "Ready" : "Blocked";
|
||||
const detailText = ready
|
||||
? "Artifact URL workflow complete"
|
||||
: (missing.length > 0 ? missing.join(", ") : workflow?.fetchError ?? "artifact URL workflow blocked");
|
||||
return {
|
||||
apiName: "project-release-readiness-artifact-url-workflow-summary-view-model",
|
||||
viewModelVersion: 1,
|
||||
phase: ready ? "ready" : "blocked",
|
||||
ready,
|
||||
title: "Project release artifact URL workflow",
|
||||
statusText,
|
||||
detailText,
|
||||
statusLine: `${statusText}: ${detailText}`,
|
||||
rows: [
|
||||
{
|
||||
id: "artifact-url",
|
||||
label: "Artifact URL",
|
||||
value: workflow?.artifactUrl || "missing",
|
||||
},
|
||||
{
|
||||
id: "fetch",
|
||||
label: "Fetch",
|
||||
value: workflow?.fetched === true ? `ready${workflow?.httpStatus ? ` (${workflow.httpStatus})` : ""}` : "blocked",
|
||||
},
|
||||
{
|
||||
id: "json-workflow",
|
||||
label: "JSON workflow",
|
||||
value: workflow?.jsonWorkflow?.ready === true ? "ready" : "blocked",
|
||||
},
|
||||
{
|
||||
id: "artifact-validation",
|
||||
label: "Artifact validation",
|
||||
value: workflow?.validation?.ready === true ? "ready" : "blocked",
|
||||
},
|
||||
{
|
||||
id: "next-command",
|
||||
label: "Next command",
|
||||
value: workflow?.actionPlan?.nextCommand ?? "none",
|
||||
},
|
||||
{
|
||||
id: "missing",
|
||||
label: "Missing workflow evidence",
|
||||
value: missing.length > 0 ? missing.join(", ") : "none",
|
||||
},
|
||||
],
|
||||
};
|
||||
}
|
||||
|
||||
export function createProjectReleaseReadinessArtifactValidation(artifact = {}) {
|
||||
const artifactObject = objectOrEmpty(artifact);
|
||||
const releaseGate = objectOrEmpty(artifactObject.releaseGate);
|
||||
|
||||
@@ -42,6 +42,7 @@ for (const phrase of [
|
||||
"createProjectReleaseReadinessArtifactValidationActionPlan()",
|
||||
"createProjectReleaseReadinessArtifactValidationSummaryViewModel()",
|
||||
"loadProjectReleaseReadinessArtifactUrlWorkflow()",
|
||||
"createProjectReleaseReadinessArtifactUrlWorkflowSummaryViewModel()",
|
||||
"embedded gate manifest, result matrix, and action plan",
|
||||
"validateWorkflowOverviewReleaseReadinessArtifactJson()",
|
||||
"loadWorkflowOverviewReleaseReadinessArtifactUrl()",
|
||||
@@ -121,6 +122,7 @@ for (const phrase of [
|
||||
"gateActionPlanReady",
|
||||
"loadIniPanelShellWorkflowOverviewReleaseReadinessArtifactUrl()",
|
||||
"loadProjectReleaseReadinessArtifactUrlWorkflow()",
|
||||
"createProjectReleaseReadinessArtifactUrlWorkflowSummaryViewModel()",
|
||||
"build/project-release-readiness.json",
|
||||
"INI panel shell handoff exports",
|
||||
"createIniPanelShellApiSurfaceInventory()",
|
||||
|
||||
@@ -5,6 +5,7 @@ import {
|
||||
createProjectReleaseGateManifest,
|
||||
createProjectReleaseGateResultMatrix,
|
||||
createProjectReleaseReadinessArtifactJsonWorkflow,
|
||||
createProjectReleaseReadinessArtifactUrlWorkflowSummaryViewModel,
|
||||
createProjectReleaseReadinessArtifactValidation,
|
||||
createProjectReleaseReadinessArtifactValidationActionPlan,
|
||||
createProjectReleaseReadinessArtifactValidationSummaryViewModel,
|
||||
@@ -193,6 +194,9 @@ const artifactUrlWorkflow = await loadProjectReleaseReadinessArtifactUrlWorkflow
|
||||
text: async () => JSON.stringify(report),
|
||||
}),
|
||||
});
|
||||
const artifactUrlWorkflowSummary = createProjectReleaseReadinessArtifactUrlWorkflowSummaryViewModel(
|
||||
artifactUrlWorkflow,
|
||||
);
|
||||
assert.equal(
|
||||
artifactValidationSummary.apiName,
|
||||
"project-release-readiness-artifact-validation-summary-view-model",
|
||||
@@ -278,6 +282,24 @@ assert.deepEqual(
|
||||
["next-command", "none"],
|
||||
],
|
||||
);
|
||||
assert.equal(
|
||||
artifactUrlWorkflowSummary.apiName,
|
||||
"project-release-readiness-artifact-url-workflow-summary-view-model",
|
||||
);
|
||||
assert.equal(artifactUrlWorkflowSummary.viewModelVersion, 1);
|
||||
assert.equal(artifactUrlWorkflowSummary.phase, "ready");
|
||||
assert.equal(artifactUrlWorkflowSummary.statusLine, "Ready: Artifact URL workflow complete");
|
||||
assert.deepEqual(
|
||||
artifactUrlWorkflowSummary.rows.map(({ id, value }) => [id, value]),
|
||||
[
|
||||
["artifact-url", "/project-release-readiness.json"],
|
||||
["fetch", "ready (200)"],
|
||||
["json-workflow", "ready"],
|
||||
["artifact-validation", "ready"],
|
||||
["next-command", "none"],
|
||||
["missing", "none"],
|
||||
],
|
||||
);
|
||||
const staleArtifactValidationSummary = createProjectReleaseReadinessArtifactValidationSummaryViewModel(
|
||||
createProjectReleaseReadinessArtifactValidation({}),
|
||||
);
|
||||
@@ -301,6 +323,12 @@ const failedArtifactUrlWorkflow = await loadProjectReleaseReadinessArtifactUrlWo
|
||||
text: async () => "",
|
||||
}),
|
||||
});
|
||||
const missingArtifactUrlWorkflowSummary = createProjectReleaseReadinessArtifactUrlWorkflowSummaryViewModel(
|
||||
missingArtifactUrlWorkflow,
|
||||
);
|
||||
const failedArtifactUrlWorkflowSummary = createProjectReleaseReadinessArtifactUrlWorkflowSummaryViewModel(
|
||||
failedArtifactUrlWorkflow,
|
||||
);
|
||||
assert.equal(staleArtifactValidationSummary.phase, "blocked");
|
||||
assert.match(staleArtifactValidationSummary.statusLine, /^Blocked: apiName, reportVersion/);
|
||||
assert.equal(staleArtifactValidationSummary.rows.find(({ id }) => id === "gate-action-plan")?.value, "missing");
|
||||
@@ -357,5 +385,17 @@ assert.equal(
|
||||
failedArtifactUrlWorkflow.actionPlan.nextCommand,
|
||||
"wasm-port/tests/host/verify_project_release_gate.sh",
|
||||
);
|
||||
assert.equal(missingArtifactUrlWorkflowSummary.phase, "blocked");
|
||||
assert.match(missingArtifactUrlWorkflowSummary.statusLine, /^Blocked: artifact-url, fetch/);
|
||||
assert.equal(
|
||||
missingArtifactUrlWorkflowSummary.rows.find(({ id }) => id === "artifact-url")?.value,
|
||||
"missing",
|
||||
);
|
||||
assert.equal(failedArtifactUrlWorkflowSummary.phase, "blocked");
|
||||
assert.match(failedArtifactUrlWorkflowSummary.statusLine, /^Blocked: artifact-fetch/);
|
||||
assert.equal(
|
||||
failedArtifactUrlWorkflowSummary.rows.find(({ id }) => id === "fetch")?.value,
|
||||
"blocked",
|
||||
);
|
||||
|
||||
console.log("project_release_gate_manifest_node_smoke=ok");
|
||||
|
||||
@@ -38,6 +38,7 @@ import {
|
||||
createProjectReleaseGateManifest,
|
||||
createProjectReleaseGateResultMatrix,
|
||||
createProjectReleaseReadinessArtifactJsonWorkflow,
|
||||
createProjectReleaseReadinessArtifactUrlWorkflowSummaryViewModel,
|
||||
createProjectReleaseReadinessArtifactValidation,
|
||||
createProjectReleaseReadinessArtifactValidationActionPlan,
|
||||
createProjectReleaseReadinessArtifactValidationSummaryViewModel,
|
||||
@@ -97,6 +98,10 @@ const requiredExports = [
|
||||
["createProjectReleaseGateManifest", createProjectReleaseGateManifest],
|
||||
["createProjectReleaseGateResultMatrix", createProjectReleaseGateResultMatrix],
|
||||
["createProjectReleaseReadinessArtifactJsonWorkflow", createProjectReleaseReadinessArtifactJsonWorkflow],
|
||||
[
|
||||
"createProjectReleaseReadinessArtifactUrlWorkflowSummaryViewModel",
|
||||
createProjectReleaseReadinessArtifactUrlWorkflowSummaryViewModel,
|
||||
],
|
||||
["createProjectReleaseReadinessArtifactValidation", createProjectReleaseReadinessArtifactValidation],
|
||||
[
|
||||
"createProjectReleaseReadinessArtifactValidationActionPlan",
|
||||
@@ -368,6 +373,19 @@ assert.equal(
|
||||
})).summaryViewModel.statusLine,
|
||||
"Ready: Artifact evidence complete",
|
||||
);
|
||||
assert.equal(
|
||||
createProjectReleaseReadinessArtifactUrlWorkflowSummaryViewModel(
|
||||
await loadProjectReleaseReadinessArtifactUrlWorkflow({
|
||||
artifactUrl: "/project-release-readiness.json",
|
||||
fetchRef: async () => ({
|
||||
ok: true,
|
||||
status: 200,
|
||||
text: async () => JSON.stringify(releaseReadinessArtifact),
|
||||
}),
|
||||
}),
|
||||
).statusLine,
|
||||
"Ready: Artifact URL workflow complete",
|
||||
);
|
||||
assert.equal(
|
||||
(await loadProjectReleaseReadinessArtifactUrlWorkflow({
|
||||
artifactUrl: "/missing.json",
|
||||
|
||||
Reference in New Issue
Block a user