推进 workflow overview 发布 artifact URL workflow

This commit is contained in:
2026-06-16 10:15:35 +08:00
parent b63669588c
commit 56175e29cc
18 changed files with 443 additions and 8 deletions

View File

@@ -194,6 +194,7 @@ export function createIniPanelLaunchApiManifest(entries = getVisibleIniPanelEntr
"getWorkflowOverviewContract",
"getWorkflowOverviewReadiness",
"mountWorkflowOverviewEmbedding",
"loadWorkflowOverviewReleaseReadinessArtifactUrl",
"getWorkflowOverviewEmbeddingReport",
"getWorkflowOverviewEmbeddingDisplayViewModel",
"getWorkflowOverviewEmbeddingRenderState",
@@ -1874,6 +1875,7 @@ export function createIniPanelShellWorkflowOverviewContract() {
"getWorkflowOverviewApiSurfaceInventory",
"getWorkflowOverviewPersistenceSummary",
"validateWorkflowOverviewReleaseReadinessArtifactJson",
"loadWorkflowOverviewReleaseReadinessArtifactUrl",
"getWorkflowOverviewReleaseReadinessArtifactDisplayViewModel",
"getWorkflowOverviewReleaseReadinessArtifactRenderState",
"getWorkflowOverviewReleaseReadinessArtifactDomContract",
@@ -1929,6 +1931,111 @@ export function validateIniPanelShellWorkflowOverviewReleaseReadinessArtifactJso
}
}
export async function loadIniPanelShellWorkflowOverviewReleaseReadinessArtifactUrl({
artifactUrl = "",
fetchRef = globalThis.fetch,
mount = false,
mountOptions = {},
} = {}) {
const missing = [
...(artifactUrl ? [] : ["artifact-url"]),
...(typeof fetchRef === "function" ? [] : ["fetch"]),
];
if (missing.length > 0) {
return {
apiName: "ini-panel-shell-workflow-overview-release-readiness-artifact-url-workflow",
workflowVersion: 1,
phase: "blocked",
ready: false,
artifactUrl,
httpStatus: null,
missing,
error: null,
validation: null,
displayViewModel: null,
renderState: null,
mountResult: null,
statusLine: `Blocked: ${missing.join(", ")}`,
};
}
try {
const response = await fetchRef(artifactUrl);
const httpStatus = response?.status ?? null;
if (!response?.ok) {
return {
apiName: "ini-panel-shell-workflow-overview-release-readiness-artifact-url-workflow",
workflowVersion: 1,
phase: "blocked",
ready: false,
artifactUrl,
httpStatus,
missing: ["artifact-url"],
error: `HTTP ${httpStatus ?? "error"}`,
validation: null,
displayViewModel: null,
renderState: null,
mountResult: null,
statusLine: `Blocked: HTTP ${httpStatus ?? "error"}`,
};
}
const artifactJson = await response.text();
const validation = validateIniPanelShellWorkflowOverviewReleaseReadinessArtifactJson(artifactJson);
const displayViewModel = createIniPanelShellWorkflowOverviewReleaseReadinessArtifactDisplayViewModel(
validation,
);
const renderState = createIniPanelShellWorkflowOverviewReleaseReadinessArtifactRenderState(
displayViewModel,
);
const mountResult = mount
? mountIniPanelShellWorkflowOverviewReleaseReadinessArtifactState({
renderState,
...mountOptions,
})
: null;
const mountMissing = mount && mountResult?.ready !== true
? (mountResult?.domReadiness?.missing ?? ["release-readiness-artifact-dom"])
: [];
const workflowMissing = [
...validation.missing,
...mountMissing,
];
const ready = validation.ready === true && (!mount || mountResult?.ready === true);
return {
apiName: "ini-panel-shell-workflow-overview-release-readiness-artifact-url-workflow",
workflowVersion: 1,
phase: ready ? "ready" : "blocked",
ready,
artifactUrl,
httpStatus,
missing: workflowMissing,
error: null,
validation,
displayViewModel,
renderState,
mountResult,
statusLine: ready ? renderState.statusLine : `Blocked: ${workflowMissing.join(", ")}`,
};
} catch (error) {
return {
apiName: "ini-panel-shell-workflow-overview-release-readiness-artifact-url-workflow",
workflowVersion: 1,
phase: "blocked",
ready: false,
artifactUrl,
httpStatus: null,
missing: ["artifact-url"],
error: error?.message ?? String(error),
validation: null,
displayViewModel: null,
renderState: null,
mountResult: null,
statusLine: `Blocked: ${error?.message ?? "release readiness artifact URL load error"}`,
};
}
}
export function createIniPanelShellWorkflowOverviewReleaseReadinessArtifactDisplayViewModel(
validation = validateIniPanelShellWorkflowOverviewReleaseReadinessArtifactJson("{}"),
) {
@@ -3163,6 +3270,8 @@ export function createIniPanelShellViewModel(entries = getVisibleIniPanelEntries
mountShellSessionHandoffWorkflow: mountIniPanelShellSessionHandoffWorkflow,
createWorkflowOverviewContract: createIniPanelShellWorkflowOverviewContract,
createWorkflowOverviewReadiness: createIniPanelShellWorkflowOverviewReadiness,
loadWorkflowOverviewReleaseReadinessArtifactUrl:
loadIniPanelShellWorkflowOverviewReleaseReadinessArtifactUrl,
mountWorkflowOverviewEmbedding: mountIniPanelShellWorkflowOverviewEmbedding,
createWorkflowOverviewEmbeddingReport: createIniPanelShellWorkflowOverviewEmbeddingReport,
createWorkflowOverviewEmbeddingDisplayViewModel: createIniPanelShellWorkflowOverviewEmbeddingDisplayViewModel,