新增项目发布 gate result matrix API
This commit is contained in:
@@ -52,6 +52,7 @@ import {
|
||||
createMachineSessionPersistenceSummary,
|
||||
createMachineSessionSnapshotPayload,
|
||||
createProjectReleaseGateManifest,
|
||||
createProjectReleaseGateResultMatrix,
|
||||
createProjectReleaseReadinessArtifactValidation,
|
||||
createProjectReleaseReadinessReport,
|
||||
createSessionSnapshot,
|
||||
@@ -192,12 +193,13 @@ It does not implement or reinterpret LinuxCNC error semantics.
|
||||
|
||||
`createProjectReleaseGateManifest()` returns the required release gate IDs,
|
||||
commands, expected smoke outputs, and gate count for CI dashboards and external
|
||||
SDK callers. `createProjectReleaseReadinessReport()` returns a
|
||||
machine-readable release readiness report that embeds the same manifest beside
|
||||
the current gate results, sim-config inventory baseline, and blocked runtime
|
||||
families. It is evidence driven: the default report is `ready: false` until the
|
||||
caller supplies observed gate output such as `project_release_gate=ok` or
|
||||
explicit gate results.
|
||||
SDK callers. `createProjectReleaseGateResultMatrix()` maps observed gate output
|
||||
and explicit gate results onto that manifest as stable `passed`/`unknown` rows.
|
||||
`createProjectReleaseReadinessReport()` returns a machine-readable release
|
||||
readiness report that embeds the same manifest and result matrix beside the
|
||||
sim-config inventory baseline and blocked runtime families. It is evidence
|
||||
driven: the default report is `ready: false` until the caller supplies observed
|
||||
gate output such as `project_release_gate=ok` or explicit gate results.
|
||||
|
||||
This helper does not execute shell commands and does not inspect or implement
|
||||
CNC behavior. It only packages project-level release evidence and blocked
|
||||
|
||||
@@ -2,6 +2,7 @@ export { createLinuxCncIniSdk } from "./linuxcnc-ini.js";
|
||||
export { createLinuxCncInterpSdk } from "./linuxcnc-interp.js";
|
||||
export {
|
||||
createProjectReleaseGateManifest,
|
||||
createProjectReleaseGateResultMatrix,
|
||||
createProjectReleaseReadinessArtifactValidation,
|
||||
createProjectReleaseReadinessReport,
|
||||
parseProjectReleaseReadinessArtifactJson,
|
||||
|
||||
@@ -113,16 +113,14 @@ export function createProjectReleaseGateManifest() {
|
||||
};
|
||||
}
|
||||
|
||||
export function createProjectReleaseReadinessReport({
|
||||
export function createProjectReleaseGateResultMatrix({
|
||||
gateResults = {},
|
||||
observedOutputs = [],
|
||||
simConfigInventory = DEFAULT_SIM_CONFIG_INVENTORY_BASELINE,
|
||||
blockedRuntimeFamilies = BLOCKED_RUNTIME_FAMILIES,
|
||||
promotedRuntimeFamilies = [],
|
||||
manifest = createProjectReleaseGateManifest(),
|
||||
} = {}) {
|
||||
const outputs = Array.isArray(observedOutputs) ? observedOutputs : [];
|
||||
const gateManifest = createProjectReleaseGateManifest();
|
||||
const gateRows = gateManifest.gates.map((gate) => {
|
||||
const gates = Array.isArray(manifest?.gates) ? manifest.gates : [];
|
||||
const rows = gates.map((gate) => {
|
||||
const passed = readGatePassed({ gate, gateResults, observedOutputs: outputs });
|
||||
return {
|
||||
id: gate.id,
|
||||
@@ -133,6 +131,34 @@ export function createProjectReleaseReadinessReport({
|
||||
passed,
|
||||
};
|
||||
});
|
||||
return {
|
||||
apiName: "project-release-gate-result-matrix",
|
||||
matrixVersion: 1,
|
||||
phase: rows.every(({ passed }) => passed) ? "ready" : "waiting",
|
||||
ready: rows.every(({ passed }) => passed),
|
||||
gateCount: rows.length,
|
||||
passedCount: rows.filter(({ passed }) => passed).length,
|
||||
unknownCount: rows.filter(({ passed }) => !passed).length,
|
||||
missingGateIds: rows.filter(({ passed }) => !passed).map(({ id }) => id),
|
||||
manifest,
|
||||
rows,
|
||||
};
|
||||
}
|
||||
|
||||
export function createProjectReleaseReadinessReport({
|
||||
gateResults = {},
|
||||
observedOutputs = [],
|
||||
simConfigInventory = DEFAULT_SIM_CONFIG_INVENTORY_BASELINE,
|
||||
blockedRuntimeFamilies = BLOCKED_RUNTIME_FAMILIES,
|
||||
promotedRuntimeFamilies = [],
|
||||
} = {}) {
|
||||
const gateManifest = createProjectReleaseGateManifest();
|
||||
const gateResultMatrix = createProjectReleaseGateResultMatrix({
|
||||
gateResults,
|
||||
observedOutputs,
|
||||
manifest: gateManifest,
|
||||
});
|
||||
const gateRows = gateResultMatrix.rows;
|
||||
const releaseGatePassed = gateRows.find(({ id }) => id === "project-release-gate")?.passed === true;
|
||||
const inventory = {
|
||||
...DEFAULT_SIM_CONFIG_INVENTORY_BASELINE,
|
||||
@@ -166,6 +192,7 @@ export function createProjectReleaseReadinessReport({
|
||||
promotedRuntimeFamilies: promotedFamilies,
|
||||
promotedBlockedFamilies,
|
||||
gateManifest,
|
||||
gateResultMatrix,
|
||||
gates: gateRows,
|
||||
rows: [
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user