新增 release artifact URL workflow summary API
This commit is contained in:
@@ -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