补齐 release artifact URL workflow summary

This commit is contained in:
2026-06-16 11:30:55 +08:00
parent 61779cad55
commit 4970d156c1
10 changed files with 112 additions and 14 deletions

View File

@@ -166,7 +166,9 @@ behavior.
Use `loadIniPanelShellWorkflowOverviewReleaseReadinessArtifactUrl()` or
`linuxCncIniPanelWorkflowOverviewApi.loadWorkflowOverviewReleaseReadinessArtifactUrl()`
when the shell should fetch the artifact JSON URL, validate it, and optionally
mount the render-state into caller-owned DOM without executing gates.
mount the render-state into caller-owned DOM without executing gates. The URL
workflow result includes `validationSummaryViewModel` so callers can show
stable validation status and rows from the same fetch.
Use `createIniPanelShellWorkflowOverviewReleaseReadinessArtifactValidationSummaryViewModel()` or
`linuxCncIniPanelWorkflowOverviewApi.getWorkflowOverviewReleaseReadinessArtifactValidationSummaryViewModel()`
when the shell needs stable artifact validation status text and dashboard rows

View File

@@ -299,7 +299,8 @@ for external browser shells:
`workflow-overview.html`. Use
`loadIniPanelShellWorkflowOverviewReleaseReadinessArtifactUrl()` when a
browser or shell should fetch the artifact JSON URL, validate it, and
optionally mount the resulting render-state into caller-owned DOM.
optionally mount the resulting render-state into caller-owned DOM. The URL
workflow result includes `validationSummaryViewModel` for dashboards.
`createIniPanelShellWorkflowOverviewReleaseReadinessArtifactDisplayViewModel()`,
`createIniPanelShellWorkflowOverviewReleaseReadinessArtifactRenderState()`,
`createIniPanelShellWorkflowOverviewReleaseReadinessArtifactValidationSummaryViewModel()`,

View File

@@ -1956,6 +1956,7 @@ export async function loadIniPanelShellWorkflowOverviewReleaseReadinessArtifactU
missing,
error: null,
validation: null,
validationSummaryViewModel: null,
displayViewModel: null,
renderState: null,
mountResult: null,
@@ -1977,6 +1978,7 @@ export async function loadIniPanelShellWorkflowOverviewReleaseReadinessArtifactU
missing: ["artifact-url"],
error: `HTTP ${httpStatus ?? "error"}`,
validation: null,
validationSummaryViewModel: null,
displayViewModel: null,
renderState: null,
mountResult: null,
@@ -1986,6 +1988,10 @@ export async function loadIniPanelShellWorkflowOverviewReleaseReadinessArtifactU
const artifactJson = await response.text();
const validation = validateIniPanelShellWorkflowOverviewReleaseReadinessArtifactJson(artifactJson);
const validationSummaryViewModel =
createIniPanelShellWorkflowOverviewReleaseReadinessArtifactValidationSummaryViewModel(
validation,
);
const displayViewModel = createIniPanelShellWorkflowOverviewReleaseReadinessArtifactDisplayViewModel(
validation,
);
@@ -2016,6 +2022,7 @@ export async function loadIniPanelShellWorkflowOverviewReleaseReadinessArtifactU
missing: workflowMissing,
error: null,
validation,
validationSummaryViewModel,
displayViewModel,
renderState,
mountResult,
@@ -2032,6 +2039,7 @@ export async function loadIniPanelShellWorkflowOverviewReleaseReadinessArtifactU
missing: ["artifact-url"],
error: error?.message ?? String(error),
validation: null,
validationSummaryViewModel: null,
displayViewModel: null,
renderState: null,
mountResult: null,

View File

@@ -460,7 +460,7 @@ TOOL_TABLE = browser-shell-tool.tbl
);
assertEqual(
workflowOverviewReleaseArtifactRenderResult.rowCount,
3,
6,
"shell workflow overview release artifact render rows",
);
assertEqual(
@@ -473,6 +473,11 @@ TOOL_TABLE = browser-shell-tool.tbl
true,
"shell workflow overview release artifact URL workflow readiness",
);
assertEqual(
workflowOverviewReleaseArtifactUrlWorkflow.validationSummaryViewModel.statusLine,
"Ready: Artifact evidence complete",
"shell workflow overview release artifact URL workflow summary",
);
assertEqual(
workflowOverviewReleaseArtifactUrlWorkflow.mountResult.ready,
true,
@@ -483,6 +488,11 @@ TOOL_TABLE = browser-shell-tool.tbl
true,
"launch release artifact URL workflow readiness",
);
assertEqual(
launchReleaseArtifactUrlWorkflow.validationSummaryViewModel.statusLine,
"Ready: Artifact evidence complete",
"launch release artifact URL workflow summary",
);
assertEqual(
document.querySelector("[data-external-release-artifact-status]").textContent,
"Ready: No blocking reasons",

View File

@@ -264,6 +264,11 @@
assertEqual(releaseArtifactMountResult.renderResult.rowCount, 6, "workflow overview release artifact mount rows");
assertEqual(releaseArtifactUrlWorkflow.ready, true, "workflow overview release artifact URL workflow readiness");
assertEqual(releaseArtifactUrlWorkflow.httpStatus, 200, "workflow overview release artifact URL workflow status");
assertEqual(
releaseArtifactUrlWorkflow.validationSummaryViewModel.statusLine,
"Ready: Artifact evidence complete",
"workflow overview release artifact URL workflow summary",
);
assertEqual(releaseArtifactUrlWorkflow.mountResult.ready, true, "workflow overview release artifact URL workflow mount");
assertEqual(releaseArtifactStatus.textContent, releaseArtifactRenderState.statusLine, "workflow overview release artifact rendered status");
assertEqual(

View File

@@ -64,6 +64,11 @@
assertEqual(readyWorkflow.ready, true, "ready workflow readiness");
assertEqual(readyWorkflow.httpStatus, 200, "ready workflow HTTP status");
assertEqual(readyWorkflow.validation.gateCount, 10, "ready workflow gate count");
assertEqual(
readyWorkflow.validationSummaryViewModel.statusLine,
"Ready: Artifact evidence complete",
"ready workflow validation summary",
);
assertEqual(readyWorkflow.renderState.statusLine, "Ready: No blocking reasons", "ready workflow status");
assertEqual(readyWorkflow.mountResult.ready, true, "ready workflow mount readiness");
assertEqual(readyWorkflow.mountResult.renderResult.rowCount, 6, "ready workflow mount rows");

View File

@@ -352,16 +352,18 @@ assert.equal(
validateIniPanelShellWorkflowOverviewReleaseReadinessArtifactJson(JSON.stringify(releaseReadinessArtifact)).ready,
true,
);
const releaseReadinessArtifactUrlWorkflow = await loadIniPanelShellWorkflowOverviewReleaseReadinessArtifactUrl({
artifactUrl: "/project-release-readiness.json",
fetchRef: async () => ({
ok: true,
status: 200,
text: async () => JSON.stringify(releaseReadinessArtifact),
}),
});
assert.equal(releaseReadinessArtifactUrlWorkflow.ready, true);
assert.equal(
(await loadIniPanelShellWorkflowOverviewReleaseReadinessArtifactUrl({
artifactUrl: "/project-release-readiness.json",
fetchRef: async () => ({
ok: true,
status: 200,
text: async () => JSON.stringify(releaseReadinessArtifact),
}),
})).ready,
true,
releaseReadinessArtifactUrlWorkflow.validationSummaryViewModel.statusLine,
"Ready: Artifact evidence complete",
);
assert.equal(
createIniPanelShellWorkflowOverviewReleaseReadinessArtifactRenderState(

View File

@@ -1380,6 +1380,10 @@ assert.equal(
(await loadIniPanelShellWorkflowOverviewReleaseReadinessArtifactUrl()).statusLine,
"Blocked: artifact-url",
);
assert.equal(
(await loadIniPanelShellWorkflowOverviewReleaseReadinessArtifactUrl()).validationSummaryViewModel,
null,
);
const releaseArtifactUrlWorkflow = await loadIniPanelShellWorkflowOverviewReleaseReadinessArtifactUrl({
artifactUrl: "/project-release-readiness.json",
fetchRef: async (url) => ({
@@ -1402,6 +1406,10 @@ assert.equal(
assert.equal(releaseArtifactUrlWorkflow.ready, true);
assert.equal(releaseArtifactUrlWorkflow.httpStatus, 200);
assert.equal(releaseArtifactUrlWorkflow.validation.ready, true);
assert.equal(
releaseArtifactUrlWorkflow.validationSummaryViewModel.statusLine,
"Ready: Artifact evidence complete",
);
assert.equal(releaseArtifactUrlWorkflow.renderState.statusLine, "Ready: No blocking reasons");
assert.equal(releaseArtifactUrlWorkflow.mountResult.ready, true);
assert.equal(releaseArtifactUrlWorkflow.mountResult.renderResult.rowCount, 6);
@@ -1426,6 +1434,7 @@ const releaseArtifactUrlWorkflowHttpBlocked = await loadIniPanelShellWorkflowOve
});
assert.equal(releaseArtifactUrlWorkflowHttpBlocked.ready, false);
assert.equal(releaseArtifactUrlWorkflowHttpBlocked.statusLine, "Blocked: HTTP 404");
assert.equal(releaseArtifactUrlWorkflowHttpBlocked.validationSummaryViewModel, null);
assert.deepEqual(createIniPanelShellWorkflowOverviewReadiness(), {
apiName: "ini-panel-shell-workflow-overview-readiness",
readinessVersion: 1,