暴露项目发布 gate manifest API
This commit is contained in:
@@ -51,6 +51,7 @@ import {
|
||||
createMachineSessionPersistenceRenderState,
|
||||
createMachineSessionPersistenceSummary,
|
||||
createMachineSessionSnapshotPayload,
|
||||
createProjectReleaseGateManifest,
|
||||
createProjectReleaseReadinessArtifactValidation,
|
||||
createProjectReleaseReadinessReport,
|
||||
createSessionSnapshot,
|
||||
@@ -189,12 +190,14 @@ It does not implement or reinterpret LinuxCNC error semantics.
|
||||
|
||||
## Project release readiness export
|
||||
|
||||
`createProjectReleaseReadinessReport()` returns a machine-readable release
|
||||
readiness report for CI dashboards and external SDK callers. The report lists
|
||||
the required project release gate command, expected smoke outputs, the current
|
||||
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.
|
||||
`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.
|
||||
|
||||
This helper does not execute shell commands and does not inspect or implement
|
||||
CNC behavior. It only packages project-level release evidence and blocked
|
||||
@@ -207,7 +210,9 @@ validates that artifact with
|
||||
`tests/host/verify_project_release_readiness_artifact.sh`. External tools can
|
||||
load that JSON with `parseProjectReleaseReadinessArtifactJson()` and validate
|
||||
it with `createProjectReleaseReadinessArtifactValidation()` without copying the
|
||||
host test assertions.
|
||||
host test assertions. The validation result includes `expectedGateCount` and
|
||||
`expectedGateIds` so external callers can compare an artifact against the
|
||||
current manifest.
|
||||
|
||||
## OPFS/session persistence exports
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
export { createLinuxCncIniSdk } from "./linuxcnc-ini.js";
|
||||
export { createLinuxCncInterpSdk } from "./linuxcnc-interp.js";
|
||||
export {
|
||||
createProjectReleaseGateManifest,
|
||||
createProjectReleaseReadinessArtifactValidation,
|
||||
createProjectReleaseReadinessReport,
|
||||
parseProjectReleaseReadinessArtifactJson,
|
||||
|
||||
@@ -98,6 +98,21 @@ function arrayOrEmpty(value) {
|
||||
return Array.isArray(value) ? value : [];
|
||||
}
|
||||
|
||||
export function createProjectReleaseGateManifest() {
|
||||
return {
|
||||
apiName: "project-release-gate-manifest",
|
||||
manifestVersion: 1,
|
||||
gateCount: REQUIRED_RELEASE_GATES.length,
|
||||
gateIds: REQUIRED_RELEASE_GATES.map(({ id }) => id),
|
||||
gates: REQUIRED_RELEASE_GATES.map((gate) => ({
|
||||
id: gate.id,
|
||||
label: gate.label,
|
||||
command: gate.command,
|
||||
expectedOutput: gate.expectedOutput ?? null,
|
||||
})),
|
||||
};
|
||||
}
|
||||
|
||||
export function createProjectReleaseReadinessReport({
|
||||
gateResults = {},
|
||||
observedOutputs = [],
|
||||
@@ -106,7 +121,8 @@ export function createProjectReleaseReadinessReport({
|
||||
promotedRuntimeFamilies = [],
|
||||
} = {}) {
|
||||
const outputs = Array.isArray(observedOutputs) ? observedOutputs : [];
|
||||
const gateRows = REQUIRED_RELEASE_GATES.map((gate) => {
|
||||
const gateManifest = createProjectReleaseGateManifest();
|
||||
const gateRows = gateManifest.gates.map((gate) => {
|
||||
const passed = readGatePassed({ gate, gateResults, observedOutputs: outputs });
|
||||
return {
|
||||
id: gate.id,
|
||||
@@ -149,6 +165,7 @@ export function createProjectReleaseReadinessReport({
|
||||
blockedRuntimeFamilies: blockedFamilies,
|
||||
promotedRuntimeFamilies: promotedFamilies,
|
||||
promotedBlockedFamilies,
|
||||
gateManifest,
|
||||
gates: gateRows,
|
||||
rows: [
|
||||
{
|
||||
@@ -215,6 +232,8 @@ export function createProjectReleaseReadinessArtifactValidation(artifact = {}) {
|
||||
artifactApiName: artifactObject.apiName ?? null,
|
||||
artifactVersion: artifactObject.reportVersion ?? null,
|
||||
gateCount: gates.length,
|
||||
expectedGateCount: REQUIRED_RELEASE_GATES.length,
|
||||
expectedGateIds: createProjectReleaseGateManifest().gateIds,
|
||||
blockedRuntimeFamilies: arrayOrEmpty(artifactObject.blockedRuntimeFamilies),
|
||||
rows: [
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user